S2C [2] $SSW/yohkoh/ucon/idl/slater/c2s.pro
[Previous] [Next]
 NAME:
	S2C
 PURPOSE:
	Returns Cartesian coordinates (X,Y,Z) of a position vector
	or array of position vectors whose spherical coordinates are
	specified by V0.
 CALLING SEQUENCE:
	V1 = C2S(V0,YOFF=YOFF,ZOFF=ZOFF,ROLL=ROLL,B0=B0)
 INPUTS:
	V0 = Cartesian coordinates (x,y,z) of a 3-vector or
	     array of 3-vectors.
 OPTIONAL INPUTS:
       YOFF, ZOFF = Y AND Z TRANSLATIONS
       ROLL
       B0
 OUTPUTS:
       V1 = 3-vector containing spherical coordinates (r,theta,phi)
       corresponding to Cartesian coordinates specified in V0.  It is
       a 3xn array if v0 is.
 CALLS: ***
	C2S, MAKARR, MAKVEC
 CALLED BY:
	DRAW_GRID [1], DRAW_GRID [2], DRAW_GRID [3], GET_TRACUBE, MK_GRID_COORDS2
	PLOT_CLON, mk_strip_file, mplot_nar, plot_ar_pfi, plot_nar [1], plot_nar [2]
	rot_pix2
 MODIFICATION HISTORY:
       Written, Jan, 1991, G. L. Slater, LPARL
       GLS - Modified to allow translation, roll, and b0 corrections


S_TO_C $SSW/yohkoh/sxt/idl/register/s_to_c.pro
[Previous] [Next]
 NAME:
	S_TO_C
	
 PURPOSE:
	Returns Cartesian coordinates (X,Y,Z) of a position vector
	or array of position vectors whose spherical coordinates are
	specified by V0.

 CALLING SEQUENCE:
	V1 = S_TO_C(V0)

 INPUTS:
	V0 = Spherical coordinates (r,theta,phi) of a 3-vector or
	     array of 3-vectors

 OUTPUTS:
	V1 = Cartesian coordinates (x,y,z) corresponding to sperical
	     coordinates specified by V0

 MODIFICATION HISTORY:
	Version 1.0 - Feb, 1991, G. L. Slater, LPARL


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

  Purpose: boolean - is input time in SAA? Use Yohkoh ephemeris OR/AND RBM

  Input Paramters:
     index - Yohkoh index record (roadmap ok, but cant check RBM)

  Keyword Parameters:
     rbm_only - just check rbm veto flag
     fem_only - just check FEM file (via tim2orbit,saa=saa)
     rbm_and_fem - if set, do logical AND of FEM and RBM (default is OR)     

  Restrictions - need to handle flares in rbm_status 

 CALLS: ***
	MASK, str_is [1], str_is [2], tim2orbit [1], tim2orbit [2]
 CALLED BY:
	QUICKDARK [2], chk_pointing, may_eclipse, mk_sdc [2], mk_sdc [3], mk_sdc [4]
	mk_sff_pair [1], mk_sff_pair [2]
  History:
     8-Sep-1993 (SLF) - Written
     8-Jul-1994 (SLF) - Return ephem saa if roadmap, just print warning


sacpeak_image $SSW/yohkoh/ucon/idl/hudson/sacpeak_image.pro
[Previous] [Next]
 NAME:
	sacpeak_image
 PURPOSE:
	quick version of SXT_MERGE to make a composite image
         of 3 offpoint images in order (1,3,2)
 CATEGORY:
       Yohkoh
 CALLING SEQUENCE:
       sacpeak_image, index, data, img_out
 INPUTS:
       index, data pre-selected
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
       img_out suitable for writing onto /0p/ftp/pub/sacpeak as an
         IDL save set
 CALLS: ***
	FMT_TIMER [1], FMT_TIMER [2], WDEF [1], WDEF [2], grid, gt_expdur [1], gt_expdur [2]
	gt_filtb, gt_time [1], gt_time [2], leak_sub [1], leak_sub [2], leak_sub [3]
	sxt_off_axis, sxt_prep [1], sxt_prep [2], sxt_prep [3]
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
       JRL, HSH 11-Oct-94, written


sat_av_arr $SSW/yohkoh/ucon/idl/mctiernan/sat_av_arr.pro
[Previous] [Next]
 NAME:
	sat_av_arr
 PURPOSE: 
	This will return an average of the saturated pixels in each 
	column, with the pixels above and below included, for two 
	images.
 CALLING SEQUENCE:
	sat_av_arr,dn,satpix
 INPUT:
	dn = Uncompressed data number for SXT images
       satpix= an array the same size as dn, with a value gt 0 if the
            pixel is saturated, note that this flags the pixels
            above and below already, if it's output from sxt_prep.
 OUTPUT:
	dn with the appropriate pixels averaged..
 COMMENT: 
	This won't work yet for non-continuous saturated pixels in 
	a given column.
 CALLS: ***
	twod_subs
 CALLED BY:
	box_sxthxt_fsp, sxt_fl_analxpro, sxtbox_fsp, sxtbox_teem
 HISTORY:
	Written by J. McT Dec. '92
       Changed to work on SXT_PREP output, 15-jul-94, jmm


sav_bda $SSW/yohkoh/gen/idl/ref_access/sav_bda.pro
[Previous] [Next]
NAME:
	sav_bda
PURPOSE:
	To save BDA index and data to a file
CALLING SEQUENCE:
	sav_bda, outfil, index, data, qs, dp_sync
	sav_bda, 'bda_15nov_flare', index, data, qs, dp_sync, /append
INPUT:
	outfil	- The name of the file to create or append the
		  the data.  NOTE: IDL "findfile" has a problem
		  with filename that use the ~ to specify the
		  directory.  This means that the /append option
		  will not work with file name using ~.
	index	- An array of index structures
	data	- A data array.  NX x N where the number of
		  elements in index must be "N".  "N" can be 1.
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], GEN_STRUCT [1], GEN_STRUCT [2]
	GET_NBYTES, OPEN_DA_FILE, REF_STRUCT, Rd_Pointer [1], Rd_Pointer [2]
	Rd_fHeader [1], Rd_fHeader [2], Rd_fHeader [3], WRT1P_FH, WRTBCSMAP
	break_file [4], rdwrt [1], rdwrt [2], rdwrt [3]
OPTIONAL KEYWORD INPUT:
	dir	- The output directory (option not to have to
		  specify it in the filename)
	append	- If set, append the dataset to an existing file
		  If the file does not exist, it will create a new
		  file.
	skipmap	- If set, do not generate the roadmap for the file.
		  This would be used when writing out a large number
		  of datasets and using the /APPEND
		  option.  The final call writing out the datasets
		  will have to not have this switch set in order to
		  have the roadmap created and the file be readable.
       progname - The name of the program that is calling SAV_SDA
       progverno - The version number of the program that is calling SAV_SDA
       fhead_input - The file header of the input files to the program
                 that is calling SAV_BDA so that the REFORMAT version
                 number is saved in the output file header
HISTORY:
	Written 23-Oct-92 91 by M.Morrison


sav_bsc $SSW/yohkoh/gen/idl/ref_access/sav_bsc.pro
[Previous] [Next]
NAME:
	sav_bsc
PURPOSE:
	To save an BCS processed spectra (BSC) index and data
CALLING SEQUENCE:
	sav_bsc, outfil, index, data
	sav_bsc, 'hxi_15nov_flare', index, data, /append
INPUT:
	outfil	- The name of the file to create or append the
		  the data.  NOTE: IDL "findfile" has a problem
		  with filename that use the ~ to specify the
		  directory.  This means that the /append option
		  will not work with file name using ~.
	index	- An array of index structures
	data	- A BSC data structure.  It is possible to save only
		  the index by not passing data, or by passing
		  "byte(0)".  If data is passed, it should be an
		  array the same length as index.
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], GEN_STRUCT [1], GEN_STRUCT [2]
	GET_NBYTES, OPEN_DA_FILE, REF_STRUCT, Rd_Pointer [1], Rd_Pointer [2]
	Rd_fHeader [1], Rd_fHeader [2], Rd_fHeader [3], WRT1P_FH, WRTBSCMAP, bits [1]
	bits [2], break_file [4], rdwrt [1], rdwrt [2], rdwrt [3], tag_index [1]
	tag_index [2]
 CALLED BY:
	MK_BSC [1], MK_BSC [2]
OPTIONAL KEYWORD INPUT:
	dir	- The output directory (option not to have to
		  specify it in the filename)
	append	- If set, append the dataset to an existing file
		  If the file does not exist, it will create a new
		  file.
	skipmap	- If set, do not generate the roadmap for the file.
		  This would be used when writing out a large number
		  of datasets and using the /APPEND
		  option.  The final call writing out the datasets
		  will have to not have this switch set in order to
		  have the roadmap created and the file be readable.
       progname - The name of the program that is calling SAV_SDA
       progverno - The version number of the program that is calling SAV_SDA
       fhead_input - The file header of the input files to the program
                 that is calling SAV_SDA so that the REFORMAT version
                 number is saved in the output file header
HISTORY:
	Written 13-Nov-92 91 by M.Morrison
	 16-Dec-92 (MDM) - Changed to break up BSC index into two parts
	 		   GEN and BSC
Ver 1.10  3-Feb-93 (MDM) - Added DATA.FLUX option
Ver 1.11  8-Nov-93 (MDM) - Added .FLUX_FIT2
Ver 1.12 26-Jan-94 (MDM) - Added /BLOCK switch to openu command


sav_hxi $SSW/yohkoh/gen/idl/ref_access/sav_hxi.pro
[Previous] [Next]
NAME:
	sav_hxi
PURPOSE:
	To save an HXT synthesized image index and data array to a file
CALLING SEQUENCE:
	sav_hxi, outfil, index, data
	sav_hxi, 'hxi_15nov_flare', index, data, /append
INPUT:
	outfil	- The name of the file to create or append the
		  the data.  NOTE: IDL "findfile" has a problem
		  with filename that use the ~ to specify the
		  directory.  This means that the /append option
		  will not work with file name using ~.
	index	- An array of index structures
	data	- A data array.  NX x NY x N where the number of
		  elements in index must be "N".  "N" can be 1.
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], GEN_STRUCT [1], GEN_STRUCT [2]
	GET_NBYTES, OPEN_DA_FILE, REF_STRUCT, Rd_Pointer [1], Rd_Pointer [2]
	Rd_fHeader [1], Rd_fHeader [2], Rd_fHeader [3], WRT1P_FH, WRTHXIMAP
	break_file [4], rdwrt [1], rdwrt [2], rdwrt [3]
 CALLED BY:
	HXTPIXON, HXT_QLOOK, hxt_multimg, hxt_sources
OPTIONAL KEYWORD INPUT:
	dir	- The output directory (option not to have to
		  specify it in the filename)
	append	- If set, append the dataset to an existing file
		  If the file does not exist, it will create a new
		  file.
	skipmap	- If set, do not generate the roadmap for the file.
		  This would be used when writing out a large number
		  of datasets and using the /APPEND
		  option.  The final call writing out the datasets
		  will have to not have this switch set in order to
		  have the roadmap created and the file be readable.
       progname - The name of the program that is calling SAV_SDA
       progverno - The version number of the program that is calling SAV_SDA
       fhead_input - The file header of the input files to the program
                 that is calling SAV_SDA so that the REFORMAT version
                 number is saved in the output file header
HISTORY:
	Written 23-Jul-92 91 by M.Morrison
V 1.0  24-Aug-92 MDM - Added "progverno", "progname" and "fhead_input"
                       keyword inputs
V 1.1	20-Jun-95 MDM - Modified to allow non-multiple of 16 word image
			sizes


sav_sda [1] $SSW/yohkoh/gen/idl/atest/sav_sda.pro
[Previous] [Next]
NAME:
	sav_sda
PURPOSE:
	To save an SXT index and data array to a file
CALLING SEQUENCE:
	sav_sda, outfil, index, data
	sav_sda, 'sfm_15nov_flare', index, data, /append
INPUT:
	outfil	- The name of the file to create or append the
		  the data.  NOTE: IDL "findfile" has a problem
		  with filename that use the ~ to specify the
		  directory.  This means that the /append option
		  will not work with file name using ~.
	index	- An array of index structures
	data	- A data array.  NX x NY x N where the number of
		  elements in index must be "N".  "N" can be 1.
OPTIONAL INPUT:
	qs	- The quasi-static structure
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], BTEST0, GEN_STRUCT [1]
	GEN_STRUCT [2], GET_NBYTES, MASK, OPEN_DA_FILE, REF_STRUCT, Rd_Pointer [1]
	Rd_Pointer [2], Rd_Roadmap [2], Rd_fHeader [1], Rd_fHeader [2], Rd_fHeader [3]
	WRT1P_FH, break_file [4], data_compress [1], data_compress [2]
	data_compress [3], rd_roadmap [1], rdwrt [1], rdwrt [2], rdwrt [3], wrtsxtmap
 CALLED BY:
	GET_SUBARR2, GET_TRACUBE, MK_SSX, comp_sda, diskbench, ffi_prep, his_suncen, mk_desat
	mk_desat_wl, mk_sdc [2], mk_sdc [3], mk_sdc [4], mk_sdm, mk_sdp, mk_sfc [1]
	mk_sfc [2], mk_sfd [1], mk_sfd [2], mk_sfd [3], mk_sfd [4], mk_sfs, mk_sft [1]
	mk_sft [2], mk_sfw, mk_spd, mk_ssc [1], mk_ssc [2], mk_strip_file, mk_sxh, sft2sfc
	ssc_scan2, sxt_prep [1], sxt_prep [2], sxt_prep [3], sxt_ssc2sss, wl_process, wr_sda
OPTIONAL KEYWORD INPUT:
	dir	- The output directory (option not to have to
		  specify it in the filename)
	append	- If set, append the dataset to an existing file
		  If the file does not exist, it will create a new
		  file.
	skipmap	- If set, do not generate the roadmap for the file.
		  This would be used when writing out a large number
		  of datasets (typically PFI) and using the /APPEND
		  option.  The final call writing out the datasets
		  will have to not have this switch set in order to
		  have the roadmap created and the file be readable.
	use_index_size - If set, look at the size of the image as
		  specified in the index and write out only that portion.
		  This is generally needed when saving FFI images and
		  there are 4x4 images embedded in a 512x512xN data
		  array.  The default is to save it how it is passed in
		  since it might have been processed and it's size
		  changed on purpose.
	progname - The name of the program that is calling SAV_SDA
	progverno - The version number of the program that is calling SAV_SDA
	fhead_input - The file header of the input files to the program
		  that is calling SAV_SDA so that the REFORMAT version 
		  number is saved in the output file header
	compress - If set, then compress the data portion of the data.
		  If it is a scalar, then it is used for all images.
		  If it is an array, then it applies to each of the images.

       type_comp - Determines compression type used. 1 = Unix Compress, 
                    2 = gzip, Default = 1.
HISTORY:
	Written Sep-91 by M.Morrison
	11-Nov-91 MDM - Changed to allow to save only index if wanted.
			Need to pass data as undefined or a one element
			scalar.
			Also added the option to skip generating the map
			so that the writes are faster.  The last time it is
			called, the map should be written. - BECAREFUL
	12-Nov-91 MDM - Added "use_index_size" option so that if a matrix
			is passed and it had images that were padded because
			of a large image, the size of the image saved is the
			"original" image size.  The default is to save it as
			passed since it might have had it's size changed
			in another routine (change 4x4 to 2x2)
	 5-May-92 MDM - Added document header
V 1.00	24-Aug-92 MDM - Added "progverno", "progname" and "fhead_input" 
			keyword inputs
V 1.01 24-Aug-92 MDM - Added /shape_sav to WRTSXTMAP call -- 
       		copy the shape_sav values to the roadmap
			"shape_cmd" field (instead of the shape_cmd values)
			This is needed because the roadmap field "shape_cmd"
			is used to figure out the output array size.
V 1.02 12-Oct-92 MDM - Modification to allow non-standard image shapes
			to be saved.  Previous restriction was that nx*ny
			be a multiple of 16 (the file record size)
V 1.03	 6-Dec-93 MDM - Modification to WRTSXTMAP to use the old roadmap instead
			of re-generating the whole thing.
V 1.04  7-Dec-93 MDM - Modified not to read the roadmap when /append and
			/skipmap is set.
	26-Jan-94 AKT - Modified to add /block keyword to openu call.  mk_sfd
			crashed because couldn't position within last 512 bytes.
	 9-Mar-94 MDM - Modified the header information
V 1.10	 7-Mar-95 MDM - Added /COMPRESS option
		      - Added /QDEBUG
       12-Dec 97 PGS - Added type_comp keyword, wrote compression type to 
                       bits 6 & 7 of index0.gen.data_word_type. 
                       bit6=1 => Unix compress = default, bit7=1 => gzip compress. 
       25-Jan-98 SLF - define COMPRESS if not already done


sav_sda [2] $SSW/yohkoh/gen/idl/ref_access/sav_sda.pro
[Previous] [Next]
NAME:
	sav_sda
PURPOSE:
	To save an SXT index and data array to a file
CALLING SEQUENCE:
	sav_sda, outfil, index, data
	sav_sda, 'sfm_15nov_flare', index, data, /append
INPUT:
	outfil	- The name of the file to create or append the
		  the data.  NOTE: IDL "findfile" has a problem
		  with filename that use the ~ to specify the
		  directory.  This means that the /append option
		  will not work with file name using ~.
	index	- An array of index structures
	data	- A data array.  NX x NY x N where the number of
		  elements in index must be "N".  "N" can be 1.
OPTIONAL INPUT:
	qs	- The quasi-static structure
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], BTEST0, GEN_STRUCT [1]
	GEN_STRUCT [2], GET_NBYTES, MASK, OPEN_DA_FILE, REF_STRUCT, Rd_Pointer [1]
	Rd_Pointer [2], Rd_Roadmap [2], Rd_fHeader [1], Rd_fHeader [2], Rd_fHeader [3]
	WRT1P_FH, break_file [4], data_compress [1], data_compress [2]
	data_compress [3], rd_roadmap [1], rdwrt [1], rdwrt [2], rdwrt [3], wrtsxtmap
 CALLED BY:
	GET_SUBARR2, GET_TRACUBE, MK_SSX, comp_sda, diskbench, ffi_prep, his_suncen, mk_desat
	mk_desat_wl, mk_sdc [2], mk_sdc [3], mk_sdc [4], mk_sdm, mk_sdp, mk_sfc [1]
	mk_sfc [2], mk_sfd [1], mk_sfd [2], mk_sfd [3], mk_sfd [4], mk_sfs, mk_sft [1]
	mk_sft [2], mk_sfw, mk_spd, mk_ssc [1], mk_ssc [2], mk_strip_file, mk_sxh, sft2sfc
	ssc_scan2, sxt_prep [1], sxt_prep [2], sxt_prep [3], sxt_ssc2sss, wl_process, wr_sda
OPTIONAL KEYWORD INPUT:
	dir	- The output directory (option not to have to
		  specify it in the filename)
	append	- If set, append the dataset to an existing file
		  If the file does not exist, it will create a new
		  file.
	skipmap	- If set, do not generate the roadmap for the file.
		  This would be used when writing out a large number
		  of datasets (typically PFI) and using the /APPEND
		  option.  The final call writing out the datasets
		  will have to not have this switch set in order to
		  have the roadmap created and the file be readable.
	use_index_size - If set, look at the size of the image as
		  specified in the index and write out only that portion.
		  This is generally needed when saving FFI images and
		  there are 4x4 images embedded in a 512x512xN data
		  array.  The default is to save it how it is passed in
		  since it might have been processed and it's size
		  changed on purpose.
	progname - The name of the program that is calling SAV_SDA
	progverno - The version number of the program that is calling SAV_SDA
	fhead_input - The file header of the input files to the program
		  that is calling SAV_SDA so that the REFORMAT version 
		  number is saved in the output file header
	compress - If set, then compress the data portion of the data.
		  If it is a scalar, then it is used for all images.
		  If it is an array, then it applies to each of the images.
HISTORY:
	Written Sep-91 by M.Morrison
	11-Nov-91 MDM - Changed to allow to save only index if wanted.
			Need to pass data as undefined or a one element
			scalar.
			Also added the option to skip generating the map
			so that the writes are faster.  The last time it is
			called, the map should be written. - BECAREFUL
	12-Nov-91 MDM - Added "use_index_size" option so that if a matrix
			is passed and it had images that were padded because
			of a large image, the size of the image saved is the
			"original" image size.  The default is to save it as
			passed since it might have had it's size changed
			in another routine (change 4x4 to 2x2)
	 5-May-92 MDM - Added document header
V 1.00	24-Aug-92 MDM - Added "progverno", "progname" and "fhead_input" 
			keyword inputs
V 1.01 24-Aug-92 MDM - Added /shape_sav to WRTSXTMAP call -- 
       		copy the shape_sav values to the roadmap
			"shape_cmd" field (instead of the shape_cmd values)
			This is needed because the roadmap field "shape_cmd"
			is used to figure out the output array size.
V 1.02 12-Oct-92 MDM - Modification to allow non-standard image shapes
			to be saved.  Previous restriction was that nx*ny
			be a multiple of 16 (the file record size)
V 1.03	 6-Dec-93 MDM - Modification to WRTSXTMAP to use the old roadmap instead
			of re-generating the whole thing.
V 1.04  7-Dec-93 MDM - Modified not to read the roadmap when /append and
			/skipmap is set.
	26-Jan-94 AKT - Modified to add /block keyword to openu call.  mk_sfd
			crashed because couldn't position within last 512 bytes.
	 9-Mar-94 MDM - Modified the header information
V 1.10	 7-Mar-95 MDM - Added /COMPRESS option
		      - Added /QDEBUG


sav_sda [3] $SSW/yohkoh/sxt/idl/atest/sav_sda.pro
[Previous] [Next]
NAME:
	sav_sda
PURPOSE:
	To save an SXT index and data array to a file
CALLING SEQUENCE:
	sav_sda, outfil, index, data
	sav_sda, 'sfm_15nov_flare', index, data, /append
INPUT:
	outfil	- The name of the file to create or append the
		  the data.  NOTE: IDL "findfile" has a problem
		  with filename that use the ~ to specify the
		  directory.  This means that the /append option
		  will not work with file name using ~.
	index	- An array of index structures
	data	- A data array.  NX x NY x N where the number of
		  elements in index must be "N".  "N" can be 1.
OPTIONAL INPUT:
	qs	- The quasi-static structure
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], BTEST0, GEN_STRUCT [1]
	GEN_STRUCT [2], GET_NBYTES, MASK, OPEN_DA_FILE, REF_STRUCT, Rd_Pointer [1]
	Rd_Pointer [2], Rd_Roadmap [2], Rd_fHeader [1], Rd_fHeader [2], Rd_fHeader [3]
	WRT1P_FH, break_file [4], data_compress [1], data_compress [2]
	data_compress [3], rd_roadmap [1], rdwrt [1], rdwrt [2], rdwrt [3], wrtsxtmap
 CALLED BY:
	GET_SUBARR2, GET_TRACUBE, MK_SSX, comp_sda, diskbench, ffi_prep, his_suncen, mk_desat
	mk_desat_wl, mk_sdc [2], mk_sdc [3], mk_sdc [4], mk_sdm, mk_sdp, mk_sfc [1]
	mk_sfc [2], mk_sfd [1], mk_sfd [2], mk_sfd [3], mk_sfd [4], mk_sfs, mk_sft [1]
	mk_sft [2], mk_sfw, mk_spd, mk_ssc [1], mk_ssc [2], mk_strip_file, mk_sxh, sft2sfc
	ssc_scan2, sxt_prep [1], sxt_prep [2], sxt_prep [3], sxt_ssc2sss, wl_process, wr_sda
OPTIONAL KEYWORD INPUT:
	dir	- The output directory (option not to have to
		  specify it in the filename)
	append	- If set, append the dataset to an existing file
		  If the file does not exist, it will create a new
		  file.
	skipmap	- If set, do not generate the roadmap for the file.
		  This would be used when writing out a large number
		  of datasets (typically PFI) and using the /APPEND
		  option.  The final call writing out the datasets
		  will have to not have this switch set in order to
		  have the roadmap created and the file be readable.
	use_index_size - If set, look at the size of the image as
		  specified in the index and write out only that portion.
		  This is generally needed when saving FFI images and
		  there are 4x4 images embedded in a 512x512xN data
		  array.  The default is to save it how it is passed in
		  since it might have been processed and it's size
		  changed on purpose.
	progname - The name of the program that is calling SAV_SDA
	progverno - The version number of the program that is calling SAV_SDA
	fhead_input - The file header of the input files to the program
		  that is calling SAV_SDA so that the REFORMAT version 
		  number is saved in the output file header
	compress - If set, then compress the data portion of the data.
		  If it is a scalar, then it is used for all images.
		  If it is an array, then it applies to each of the images.

       type_comp - Determines compression type used. 1 = Unix Compress, 
                    2 = gzip, Default = 1.
HISTORY:
	Written Sep-91 by M.Morrison
	11-Nov-91 MDM - Changed to allow to save only index if wanted.
			Need to pass data as undefined or a one element
			scalar.
			Also added the option to skip generating the map
			so that the writes are faster.  The last time it is
			called, the map should be written. - BECAREFUL
	12-Nov-91 MDM - Added "use_index_size" option so that if a matrix
			is passed and it had images that were padded because
			of a large image, the size of the image saved is the
			"original" image size.  The default is to save it as
			passed since it might have had it's size changed
			in another routine (change 4x4 to 2x2)
	 5-May-92 MDM - Added document header
V 1.00	24-Aug-92 MDM - Added "progverno", "progname" and "fhead_input" 
			keyword inputs
V 1.01 24-Aug-92 MDM - Added /shape_sav to WRTSXTMAP call -- 
       		copy the shape_sav values to the roadmap
			"shape_cmd" field (instead of the shape_cmd values)
			This is needed because the roadmap field "shape_cmd"
			is used to figure out the output array size.
V 1.02 12-Oct-92 MDM - Modification to allow non-standard image shapes
			to be saved.  Previous restriction was that nx*ny
			be a multiple of 16 (the file record size)
V 1.03	 6-Dec-93 MDM - Modification to WRTSXTMAP to use the old roadmap instead
			of re-generating the whole thing.
V 1.04  7-Dec-93 MDM - Modified not to read the roadmap when /append and
			/skipmap is set.
	26-Jan-94 AKT - Modified to add /block keyword to openu call.  mk_sfd
			crashed because couldn't position within last 512 bytes.
	 9-Mar-94 MDM - Modified the header information
V 1.10	 7-Mar-95 MDM - Added /COMPRESS option
		      - Added /QDEBUG
       12-Dec 97 PGS - Added type_comp keyword, wrote compression type to 
                       bits 6 & 7 of index0.gen.data_word_type. 
                       bit6=1 => Unix compress = default, bit7=1 => gzip compress. 
       25-Jan-98 SLF - define COMPRESS if not already done
        5-May-99 SLF - add /NOLOWER to open_da_file call
                       (permit upper case file/path names)


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

   Purpose: save string to xdr file for Yohkoh !path, documentation, filemaps

   Input Parameters:
	infile -  filename of file to write
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], concat_dir [4]
  		  NOTE: by default, the extention .strx is forced
	string - string variable to save
 
   Optional Keyword Parameters:
	
   Method: 
       special files contain a single string (but the string may be long)
	in XDR format for transporability 
   
   Calling Sequence: 
	sav_string, string, infile [,type=type] [,/path] [,/doc] [,/refdata]

   Categories:
	swmaint, file i/o, gen, util

   Notes: 
	The pair of routines [sav_string/get_string] were developed to allow
	saving and restoring of several yohkoh parameters (ex: !path) to help 
	manage the Yohkoh idl environment but they are generic in nature and 
	other uses may be considered.  They can be used in conjunction with 
	arr2str and str2arr to allow storing of string 'arrays' 

   History: slf, 30-July-92
	     slf, 22-Jul-93	(use SITE instead of GEN)


save_event [1] $SSW/yohkoh/gen/idl/atest/op_get_event.pro
[Previous] [Next]
  NAME:
    save_event
  PURPOSE:
    Called by op_get_event to save orbital event information in output structure.

 CALLS: ***
	ADDTIME [1], ADDTIME [2], int2secarr [1], int2secarr [2], op_get_event [1]
	op_get_event [2]
 CALLED BY:
	OP_ADD_SPECIAL, get_dn_rate [1], get_dn_rate [2], make_32 [1], make_32 [2]
	op_bdr_opt, op_edit [1], op_edit [2], op_get_event [1], op_get_event [2]
	op_saa_med [1], op_saa_med [2], op_terminator [1], op_terminator [2]
	op_time_sort, valid_pass4 [1], valid_pass4 [2]
  Modification History:
    Written,     oct-91, J. R. Lemen
    Modified, 13-jan-92, J. R. Lemen,  Fixed comments for og's > 127
    Updated,  23-jan-92, J. R. Lemen,  Added aligment feature
    Updated,   6-jul-92, JRL, Added op_cmd=260 (null)
     4-may-93, JRL, Added DN flag to the event structure.


save_event [2] $SSW/yohkoh/gen/idl/orbit/op_get_event.pro
[Previous] [Next]
  NAME:
    save_event
  PURPOSE:
    Called by op_get_event to save orbital event information in output structure.

 CALLS: ***
	ADDTIME [1], ADDTIME [2], int2secarr [1], int2secarr [2], op_get_event [1]
	op_get_event [2]
 CALLED BY:
	OP_ADD_SPECIAL, get_dn_rate [1], get_dn_rate [2], make_32 [1], make_32 [2]
	op_bdr_opt, op_edit [1], op_edit [2], op_get_event [1], op_get_event [2]
	op_saa_med [1], op_saa_med [2], op_terminator [1], op_terminator [2]
	op_time_sort, valid_pass4 [1], valid_pass4 [2]
  Modification History:
    Written,     oct-91, J. R. Lemen
    Modified, 13-jan-92, J. R. Lemen,  Fixed comments for og's > 127
    Updated,  23-jan-92, J. R. Lemen,  Added aligment feature
    Updated,   6-jul-92, JRL, Added op_cmd=260 (null)
     4-may-93, JRL, Added DN flag to the event structure.


SBT_HXT_DATA $SSW/yohkoh/ucon/idl/sakao/sbt_hxt_data.pro
[Previous] [Next]
 NAME:
	SBT_HXT_DATA
 PURPOSE:
	Subtract a certain BGD level derived from a structure (or an array) 
	variable 'bgd'.
 CALLING SEQUENCE:
	data = SBT_HXT_DATA(index, raw_data, bgd)
 INPUT:
	index		- HXT index
	raw_data	- HXT data before BGD subtraction.
	bgd		- BGD data (either a structure or an array variable)
			  If an array is selected, then the format should be:
				[L,M1,M2,H]-bands BGD counts/sec/SC.
 OUTPUT:
	data		- BGD-subtracted data.
 CALLED BY:
	AVE_CTS
 NOTE:
	Note that 'data' is not a structure, which is a remarkable difference 
	of sbt_hxt_data from mk_hxt_sbt. Also a simple count profile is 
	returned.
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], GT_HS_SUM, HXT_HALFSEC, HXT_HALFSEC2
 SIDE EFFECTS:
	none
 CATEGORY:
	HXT data analysis.
 MODIFICATION HISTORY:
	version 1.0	92.11.30 (Mon)
	version 1.1	92.12.03 (Thu)
		Return value of this function was changed from sbt(4,*) to 
		sbt(4,64,4,*) so as to ensure compatibility with 
		hxt_hs_hardness.pro and hxt_halfsec.pro.
		In fact, ver 1.0 does not match with any of .pro in hxt_proc/.
	version 1.2	93.02.16 (Tue)
		Unit of accum_time is changed to 'sec' instead of 'msec'.
		Usage :
			IDL > sbt = sbt_hxt_data(index,data,bgd)
			where  data = bytarr(4,64,4,*) ... raw 'data' from 
			RF database.
			bgd  = HXT BGD structure.

	MAKE SURE VER 1.1 DOES NOT GIVE CORRECT ANSWER AT ALL (LOTS OF BUGS 
	IN IT).
	version 1.3	93.02.17 (Wed)
		Option var added.
		Usage :
			IDL > sbt = sbt_hxt_data(index,data,bgd,var=var)
			where  var = fltarr(4,64,4,*), gives variance for 
			each 'sbt'.
	version 1.4	97.06.25 (Wed)
		Array-type for the bgd variable was added.


scale_gbo $SSW/yohkoh/gen/idl/gbo/scale_gbo.pro
[Previous] [Next]
       NAME:
             scale_gbo

       PURPOSE:
               To resize, and repostion a gbo image to match the last
               sfd image produced by first_light.
      
       METHOD: The sfd image is passed through sxt_cen to find the centroid
               and the axial diameters, the gbo image is passed through gen_loc
               for the same purpose and is then resized and reposisitioned to 
               match the first (TARGET).  The rescaled gbo image is then displayed.
               This is based on A. McA.'s gbo_scale2 procedure.

	CALLING SEQUENCE:

               outimg=scale_gbo(trgimg,gboimg,indx1)
               outimg=scale_gbo(gboimg,diam=npix)
               
               indx1 is the index entry for the sxtimg.

	PARAMETERS:
	   gboimg      the input GBO image.
          trgimg      the target image to which it is to be matched.
	   outimg      the rescaled output image.

	KEYWORDS:

       OUTPUT TYPE:
 
       CALLS: ***
	CONGRID [1], CONGRID [2], CONGRID [3], GEN_LOC, get_rb0p [1], get_rb0p [2]
	sxt_cen [1], sxt_cen [2]
 CALLED BY:
	fl_suntoday [1], fl_suntoday [2], fl_suntoday [3], mk_sun_mosaic, sun_today [1]
	sun_today [2], sun_today [3]
	HISTORY:
	   Procedure developed to shrink BBSO Halpha image and 
	   place it correctly in a 512x512 SXT image 
	   Written by L. Acton  7-nov-91
	   Modified for generality  10-apr-92
          Added automatic sun finder, A. McA. 16-apr-92
          Corrected for different vertical/horizontal scaling A.McA 18-apr-92
          Version 2. Rewrote for general sized matrices, using dsk_loc.
          changed calling sequence to include target image, A.McA 24-apr-92
          Replaced location routine. Can now handle SXT images, A.McA. 6-may-92
          Added fractional pixel repositioning, A.McA. 7-may-92
          Changed congrid call to use bilinear extrapolation, A.McA. 26-may-92
          Output variable type now same as input type, A.McA. 2-dec-92
          Modified by DA for specific use with first_light.
          15-Sep-1994 (SLF) add SIZE_ONLY keyword (resize but dont reposition)
           9-sep-1994 (SLF) allow diam to be passed in (pixels)


scale_teem $SSW/yohkoh/sxt/idl/sensitivity/scale_teem.pro
[Previous] [Next]
  NAME:
    scale_teem
  PURPOSE:
    Scale the results from sxt_teem to that they can be displayed
  CALLING SEQUENCE:
    out_te = scale_teem(Te,dTe)
    out_te = scale_teem(Te,dTe,level=level)
  INPUTS:
    Te	    = Log10(Te) of Temperatures
    dTe    = d(Log10(Te)) of Temperatures
  OPTIONAL INPUT PARAMETER:
    level = Cutoff value of dTe for plotting Te
  MODIFICATION HISTORY:
    14-oct-94, J. R. Lemen, LPARL (adapted from J. McTiernan's t664_screen)


scat_avg $SSW/yohkoh/ucon/idl/acton/scat_avg.pro
[Previous] [Next]

 NAME
       scat_avg
 PURPOSE
	To derive an expression for average x-ray scattering by the SXT
	mirror.  Starburst difference imagas are used.
 CALLING SEQUENCE
       scat_avg,img,index,x0,y0,fit_param=fit_param, $
	   [rr,source,xy=xy,new=new,xxx,out]
 INPUT
       img - SXT starburst difference image
	x0,y0 - coordinates of the flare
 OPTIONAL INPUT
	rr, to save time if this has already been computed once
 OUTPUT
       rr - array of radii of all distances from x,y
	fit_param - Intensity and slope parameters derived with poly_fit
	xxx - linear array of R values for plotting
	out - array of signal values, averaged over annuli, function of R
 KEYWORD INPUT
 OPTIONAL KEYWORD INPUT
	xy - array defining target area
	     	default is to read from image with WDEFROI
       /new - if this is a new value of x0,y0 and/or rr does not exist
       from a previous calculation (To save time.)
 HISTORY
       LWA 21-June-1994
	Changed to a procedure and added averaging around a radius,
	   fitting, and display and printed output.   LWA 22-June-1994
 CALLS:


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

   Purpose: manage scratch files (names, auto-delete, units,...)
	     (compatible with VMS/Unix)

   Input Parameters:
      u0, u1, ... u9 	 ;if defined on input, log units to close and delete
   
   Output Parameters:
      u0, u1, ... u9    ;if undefined, logical units assigned during open

   Keyword Parameters:
      nodelete - (input) dont delete on close (default is to delete)
      cleanup  - (input) deletes all scratchf generated files (even old stuff)
      open     - (input) force open mode (default if u0 present and undefined)
      close    - (input) force close mode (default if u0 present and defined)
      names    - (output) scratch file names acted upon (open/close/delete)

   Calling Sequence:
      scratchf,u1,u2,u3 ; if parameters undefined, open 3 scratch files
			 ; if parameters defined,   close/delete files

   Calling Examples:
      scratchf, u1, u2, u3, /open ; open 3 files, return luns in u1, u2, u3
      scratchf, u1, u2, /close    ; close and delete files open w/luns u1/u2
      scratchf, u2, /print 	   ; same, but print before deleting
      scratchf, u1, /nodelete	   ; close, dont delete
      scratchf, u1, u2 	   ; if u1 is undfined: open 2 files
				     (same as scratchf, u1, u2 ,/open)
				     if u1 is defined, close/delete 2 files
				     (same as scratchf, u1, u2, /close)
      scratchf, u1, name=name	   ; return file name
      scratchf			   ; close/delete all open scratchfiles
      scratchf,/cleanup	   ; same plus any old scratchf files from
      scratchf,/clean,/nodel,name=name ; new and old scratchf file names

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DPRINT, LPRINT, SCRATCHF
	concat_dir [4]
   Restrictions:
      uses execute statement, so no recursion allowed

   History: slf, 3-March-1993


sda2fits $SSW/yohkoh/gen/idl/gbo/sxt2fits.pro
[Previous] [Next]
NAME:
	sda2fits
PURPOSE:
	Take a SXT index and data and write a FITS file
CALLING SEQUENCE:
	sxt2fits, index, data
	sxt2fits, index, data, outfil='sda_sample.fits'
	sxt2fits, infil=infil
	sxt2fits, infil=infil, ss=ss
	sxt2fits, infil='$DIR_SXT_SFM/sfm930300.0000', outdir='/yd3/morrison/sgd'
INPUT:
	index	- The index structure to be saved
	data	- The data array to be saved
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], GET_NBYTES, RD_XDA [1], RD_XDA [2]
	Rd_Roadmap [2], SXADDPAR [1], SXADDPAR [2], SXADDPAR [3], SXT2FITS, anytim2ex [1]
	anytim2ex [2], anytim2ints [1], anytim2ints [2], concat_dir [4], ex2fid [1]
	ex2fid [2], fmt_tim [1], fmt_tim [2], get_rb0p [1], get_rb0p [2], get_roll
	gt_corner, gt_day [1], gt_day [2], gt_dp_mode [1], gt_dp_mode [2], gt_dp_rate [1]
	gt_dp_rate [2], gt_dpe, gt_expdur [1], gt_expdur [2], gt_expmode, gt_filta, gt_filtb
	gt_pfi_ffi, gt_pix_size, gt_res, gt_time [1], gt_time [2], rd_roadmap [1]
	sxt_cen [1], sxt_cen [2], wrt_fits [1], wrt_fits [2]
OPTIONAL KEYWORD INPUT:
	outfil	- The output file name(s).  There should be one filename
		  per image saved.  If "outfil" is not specified, then
		  the output file name is:
			SF_FITSyymmdd.hhmmss	(for FFI)
			SP_FITSyymmdd.hhmmss	(for FFI)
		  If "outfil" is passed as a scalar and there are
		  multiple images passed in, then a .0001, .0002, .0003
		  and so forth is appended to the end.
	infil	- Instead of passing in the "index" and "data", it
		  is possible to pass in the SDA file name.  If 
		  "ss" is not passed, then all data sets are saved
	ss	- A list of the indicies to be saved (either within
		  the "index" variable, or datasets within the
		  "infil"
	outdir	- The output directory where to put the FITS file created
OUTPUT:
	Creates FITS files
HISTORY:
	Written 19-Oct-92 by M.Morrison
	 5-May-93 (MDM) - Modification to the header
	 6-Mar-95 (MDM) - Added center pixel information (as per Hudson's Request)
	 8-Mar-95 (GAL) - Fixed typo-bug from 6-Mar-95
       10-may-95 (SLF) - add CRROTA and call to get_roll
	23-Jun-95 (MDM) - Removed the blank lines in the header (put COMMENT)
	26-Jun-95 (MDM) - Replaced all of the format statements to build the
			  FITS header with calls to SXADPAR
        7-aug-95 (SLF) - change DATE-OBS to conform to NOST FITS stds.
			  add DATEOBS (Yohkoh String Format Time & Date)
       22-sep-95 (SLF) - add QUIET keyword and function


sda_look [3] $SSW/yohkoh/gen/idl/util/sda_look.pro
[Previous] [Next]


SDC_VERIFY $SSW/yohkoh/sxt/idl/atest/sdc_verify.pro
[Previous] [Next]

function sdc_verify,index,data,verbose=verbose,progress=progress, $
                    correct_col_blem=correct_col_blem,version=version

NAME:
   SDC_VERIFY
PURPOSE:
   Check the SDC database for bad dark frames
CATEGORY:
CALLING SEQUENCE:
     quality = sdc_verify(index,data)
INPUTS:
     index = SDC index
     data = SDC data
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     /correct_col_blem = attempt to fix column blemish problems by
                      interpolating over the bad areas.  WARNING:  if this
                      keyword is set, the data will be modified if any areas
                      of the images appear to have bleed or blemishes.  NOte
                      that the quality structure will have the values for the 
                      *uncorrected* data so that data which did not need to
                      be corrected will be used in favor of data which did
                      need to be corrected.
     /progress = print out progress reports as the checks are underway.
                 Like /verbose, but with fewer diagnostics and no
                 images.
     /verbose = spit out lots of diagnostics and display the good and bad 
                images.
     version = Outputs with the version number
OUTPUTS:
     quality = index type structure for images
        quality.badness = measure of how bad the image is.  Allows ranking.
                          0 means "perfect", higher numbers are worse.
                          0-20 is probably OK; 
                          20-100 is marginal;
                          >=100 is probably bad;
                          >= 1000. do not use the image.
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], GET_INFO2, MASK, MEAN, RM_FEATURE, STDEV
	fmt_tim [1], fmt_tim [2], get_info [1], get_info [2], get_info [3], get_info [4]
	gt_comp, gt_dpe, gt_expdur [1], gt_expdur [2], gt_expmode, gt_res, sxt_decomp [1]
	sxt_decomp [2], sxt_satpix [1], sxt_satpix [2], sxt_uvf_info [1]
	sxt_uvf_info [2], sxt_uvf_info [3], xstepper [1], xstepper [2]
 CALLED BY:
	mk_sdc [2], mk_sdc [3], mk_sdc [4]
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:

MODIFICATION HISTORY:
    T. Metcalf 1998-Sep-21
    1998-Sep-29 TRM Added check for exposure mode and BLS mode
    1998-Dec-16 TRM Major modification to the tests
    1999-May-24 TRM Added minimum 8ms exposure to gt_dpe call
    1999-Jun-15 TRM Added column blemish correction
    2002-Dec-02 TRM Small change to "ignore vertical lines" so that
                    streaks are picked up more readily.
    2002-Dec-03 TRM Version 1.0.  Added version number. 
    2002-Dec-03 TRM Version 1.1.  Added TFMS check and percent
                                  check.  Increased pixcut from 0 to 30.
    2002-Dec-12 TRM Version 1.2.  Added check for nx=1024 images


sea $SSW/yohkoh/ucon/idl/morrison/sea.pro
[Previous] [Next]
NAME:
	sea
PURPOSE:
	Search all files in a set of Unix sub-directories for an input string
CALLING SEQUENCE:
	sea
	sea, indir, instr, outfil, fil_spec=fil_spec
	sea, '/ys', 'makvec'
	sea, '/ys', 'hel2pix', 'dum.dum', fil_spec='*.pro'
INPUT:
	indir	- The top directory to search.  All directories under it will
		  be searched
	instr	- The string to search all files in the subdirectories for
OPTIONAL INPUT:
	outfil	- The name of the file to write the results to.  Default is
		  "SEA.TXT"
 CALLS: ***
	UNIQ [1], UNIQ [2], UNIQ [3], file_list [1], file_list [2], rd_tfile [1]
	rd_tfile [2]
OPTIONAL KEYWORD INPUT:
	fil_spec- The file specification to search for ('*' for example)
		  Default is "*.pro"
OPTIONAL KEYWORD INPUT/OUTPUT:
       sub_dirs- The list of subdirectories to search.  Can be used so
                 that the subdirectories do not have determined again if
                 calling SEA twice in a row
OPTIONAL KEYWORD OUTPUT:
	matches	- The names of the files which match
HISTORY:
	Written Nov-91 by M.Morrison
	20-Oct-92 (MDM) - Added document header
			- Added FIL_SPEC
	15-Mar-93 (MDM) - Adjusted the GREP command to use " "
        7-Jun-93 (MDM) - Added SUB_DIRS
			- Allowed INSTR to be an array
	18-Jul-93 (MDM) - Added matches output keyword
	23-Mar-95 (MDM) - Adjusted the GREP command to use ' '
	21-Jun-95 (MDM) - Modified to work when there are lots of files
			  in the directory (avoid "arg list too long" error)


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

   Purpose: emulate VMS search utility 

   Input Parameters:
      file -   file to search (can be string array also)
      string - string to search for

   Keyword Parameters:
      window - number of lines above/below matches to display 
      case_ignore - force search to be case insensitive

   Calling Sequence:
      search, file, string [, window=[above,below], /case_ignore]
      search, file, string, window=delta
      search, array, string

 CALLS: ***
	FILE_EXIST [2], data_chk [1], data_chk [2], file_exist [1], file_exist [3]
	prstr [1], prstr [2], rd_tfile [1], rd_tfile [2], uniqo [1], uniqo [2], wc_where [1]
	wc_where [2]
 CALLED BY:
	check_log [1], check_log [2], sfc_check
   History:
      15-Apr-1994 (SLF) Written (uses rd_tfile and wc_where)
      18-Apr-1994 (SLF) Minor change to delimit logic
      22-Apr-1994 (SLF) Allow string array, add FIRST and LAST keywords


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

   Purpose: Search data path list for input file

   Input: filename 

   Output: function returns file name with path or '' if not found

   Method: quick and dirty (calls data_paths) 

 CALLS: ***
	DATA_PATHS, browse_files
 CALLED BY:
	CkFurFiles
   History: slf, 10/91


search_files $SSW/yohkoh/gen/idl/to_be_deleted/search_files.pro
[Previous] [Next]
   Name: search_files

   Purpose:return path name of yohkoh reformatted data files

   Input Parameters:
      infiles - list of fileids to locate 

   Optional Keyword Parameters:
      map   - if set, forces common block update
      paths - string array of paths to include (def=data_paths output
	       plus current directory)

   Method: uses private common block to store online filepaths

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], SPLIT_FILES, UNIQ [1], UNIQ [2]
	UNIQ [3], concat_dir [4], curdir [1], curdir [2], data_paths2 [1], data_paths2 [2]
   Common Blocks: search_files_blk (private)

   Restrictions: 
      Slow on first call (map) - could use generic file read option
      directory updates are not so dynamic 

   History: slf, April 22, 1992


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

   Purpose: search observing log for matching records

   Input Parameters:
      time0 - start time for search (default=launch)
      time1 - stop time for search  (default=now)

   Keyword Parameters:
      ffi or sxtf - if set, sxt FFI search (default)
      pfi or sxtp - if set, sxt PFI search
      conf_file - name of SS configuration file
      listfile - if set, outputfile for text summary of matching index records
      outfile - file containing matching index structures
      
      index (output) - maching records

 CALLED BY:
	xso_search
   History:
      22-mar-1995 (SLF) - extension of mk_spd logic
      12-apr-1995 (SLF) - extend time buffer to assure stop time covered
			   add tag names and some text info to save file
      22-may-1995 (SLF) - default config file in HOME directory

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], MORE [1], MORE [2]
	anytim2ints [1], anytim2ints [2], concat_dir [4], data_chk [1], data_chk [2]
	file_append [1], file_append [2], file_exist [1], file_exist [3], get_info [1]
	get_info [2], get_info [3], get_info [4], get_logenv [1], get_logenv [2]
	get_user [1], get_user [2], get_utevent [1], get_utevent [2], get_yo_dates [1]
	get_yo_dates [2], get_yo_dates [3], int2secarr [1], int2secarr [2], mail [1]
	mail [2], prstr [1], prstr [2], rd_tfile [1], rd_tfile [2], savegen [1], savegen [2]
	sel_timrange [1], sel_timrange [2], str_concat [1], str_concat [2], sxt_where
	timegrid, ut_time [1], ut_time [2]
   Restrictions:
      only sxt for now 


SECTIME [1] $SSW/yohkoh/ucon/idl/nitta/ffidl_nn.pro
[Previous] [Next]
 NAME:
       SECTIME
 PURPOSE:
       Convert TIME in the unit of HHMMSS into TIME in the unit of sec.
 CATEGORY:
       Programming
 CALLING SEQUENCE:
       outtime = SECTIME(intime)
 INPUTS:
       intime = time in the unit of HHMMSS. HHMMSS means HH:MM:SS.
              String type data having 6 data length.
 OUTPUTS:
       outtime = time in the unit of sec.
              Long Integer type data.
   NOTE:
       notice that the type of inserted TIME(string*6) is also convertied
     into another type (long integer) in the outputted TIME.
 COMMON BLOCKS:
       None.
 SIDE EFFECTS:
       None.
 RESTRICTIONS:
       None.
 PROCEDURE:
       The time in the unit of HHMMSS(HH:MM:SS) is converted into the 
     time in the unit of sec.
 PROGRAMER:
       Toshifumi Shimizu
           Department of Astronomy, University of Tokyo, JAPAN
 HISTORY:
       Ver 1.0   7-JAN-1991  made
       Ver 2.0  16-MAY-1991  change FUNCTION


SECTIME [2] $SSW/yohkoh/ucon/idl/nitta/pfidl_nn.pro
[Previous] [Next]
 NAME:
       SECTIME
 PURPOSE:
       Convert TIME in the unit of HHMMSS into TIME in the unit of sec.
 CATEGORY:
       Programming
 CALLING SEQUENCE:
       outtime = SECTIME(intime)
 INPUTS:
       intime = time in the unit of HHMMSS. HHMMSS means HH:MM:SS.
              String type data having 6 data length.
 OUTPUTS:
       outtime = time in the unit of sec.
              Long Integer type data.
   NOTE:
       notice that the type of inserted TIME(string*6) is also convertied
     into another type (long integer) in the outputted TIME.
 COMMON BLOCKS:
       None.
 SIDE EFFECTS:
       None.
 RESTRICTIONS:
       None.
 PROCEDURE:
       The time in the unit of HHMMSS(HH:MM:SS) is converted into the 
     time in the unit of sec.
 PROGRAMER:
       Toshifumi Shimizu
           Department of Astronomy, University of Tokyo, JAPAN
 HISTORY:
       Ver 1.0   7-JAN-1991  made
       Ver 2.0  16-MAY-1991  change FUNCTION


SECTIME [3] $SSW/yohkoh/ucon/idl/shimizu/ffidl.pro
[Previous] [Next]
 NAME:
       SECTIME
 PURPOSE:
       Convert TIME in the unit of HHMMSS into TIME in the unit of sec.
 CATEGORY:
       Programming
 CALLING SEQUENCE:
       outtime = SECTIME(intime)
 INPUTS:
       intime = time in the unit of HHMMSS. HHMMSS means HH:MM:SS.
              String type data having 6 data length.
 OUTPUTS:
       outtime = time in the unit of sec.
              Long Integer type data.
   NOTE:
       notice that the type of inserted TIME(string*6) is also convertied
     into another type (long integer) in the outputted TIME.
 COMMON BLOCKS:
       None.
 SIDE EFFECTS:
       None.
 RESTRICTIONS:
       None.
 PROCEDURE:
       The time in the unit of HHMMSS(HH:MM:SS) is converted into the 
     time in the unit of sec.
 PROGRAMER:
       Toshifumi Shimizu
           Department of Astronomy, University of Tokyo, JAPAN
 HISTORY:
       Ver 1.0   7-JAN-1991  made
       Ver 2.0  16-MAY-1991  change FUNCTION


SECTIME [4] $SSW/yohkoh/ucon/idl/shimizu/pfidl.pro
[Previous] [Next]
 NAME:
       SECTIME
 PURPOSE:
       Convert TIME in the unit of HHMMSS into TIME in the unit of sec.
 CATEGORY:
       Programming
 CALLING SEQUENCE:
       outtime = SECTIME(intime)
 INPUTS:
       intime = time in the unit of HHMMSS. HHMMSS means HH:MM:SS.
              String type data having 6 data length.
 OUTPUTS:
       outtime = time in the unit of sec.
              Long Integer type data.
   NOTE:
       notice that the type of inserted TIME(string*6) is also convertied
     into another type (long integer) in the outputted TIME.
 COMMON BLOCKS:
       None.
 SIDE EFFECTS:
       None.
 RESTRICTIONS:
       None.
 PROCEDURE:
       The time in the unit of HHMMSS(HH:MM:SS) is converted into the 
     time in the unit of sec.
 PROGRAMER:
       Toshifumi Shimizu
           Department of Astronomy, University of Tokyo, JAPAN
 HISTORY:
       Ver 1.0   7-JAN-1991  made
       Ver 2.0  16-MAY-1991  change FUNCTION


sector_avg $SSW/yohkoh/sxt/idl/atest/sector_avg.pro
[Previous] [Next]
 NAME:
       sector_avg
 PURPOSE
	To compute the azimuthally-averaged radial intensity distribution from
	some origin -- either the center of the sun or an input location.
	Radial totals, not averaged over azimuth, can be returned also for
	use in SXT_TEEM which requires actual total DN if error bars are
	be put on the temperatures.
	   Signal averages or totals over specified sectors also an option.
 CALLING SEQUENCE
	sector_avg,image,index=index,origin=origin,xxx,sig,rr,fullsig,$
         xy=xy,new=new,fit_param=fit_param,yfit=yfit,$
         noplot=noplot,multiple=multiple,unc_data=unc_data,$
         unc_sig=unc_sig,unc_fullsig=unc_fullsig,skip=skip,$
         sector=sector,noqx=noqx,sectparam=sectparam,azipix=azipix
       sector_avg,image,index=index,xxx,sig
	sector_avg,image,origin=[361,400],xxx,sig, $
		fit_param=fit_param,yfit=yfit,multiple=2
	sector_avg,image,index=index,xxx,sig,rr,/new,/origin,/noplot
 INPUT
       image - Fully corrected image.
	Either:  index, origin or both.
 OUTPUT TO SCREEN
	If the keyword sectparam is not set then output of the following
	form is written to the screen:
		The slope of the fit is     -2.03562
		Fitted expression:   Signal =  6.6e+06*R^(-2.04)   per pixel.
 OPTIONAL OUTPUT
	xxx - linear array of R values for plotting
	sig - array of signal values, averaged over azimuth, function of R
		units are DN/pixel for pixel size in image
		Used for plotting signal vs. R
       rr - array of radii of all distances from origin
		units are pixels (pixel size of image)
       xy - array of pixels included in the analysis
	unc_sig - compression uncertainties on azimuthly averaged values
	fullsig - azimuthal totals, not averaged over azimuth, function of R
		for use with SXT_TEEM
	unc_fullsig - compression errors on azimuth totals
 OPTIONAL INPUT
	rr, return from first run and input for subsequent runs 
		to save time.
 OPTIONAL KEYWORD INPUT
	index - to permit getting suncenter from the data base
		and labelling of output figures
	origin - origin of coordinates for azimuth averaging, if this is
		 specified it takes priority over suncenter from index
		 but one or the other must be provided.

 CALLS: ***
	POLY_FIT, WDEF [1], WDEF [2], fmt_tim [1], fmt_tim [2], gt_corner, gt_filtb, gt_res
	ocontour [1], ocontour [2], ocontour [3], ocontour [4], ocontour [5], plusmark
	sector_bound, sfd_comp, tbeep [1], tbeep [2], tbeep [3], wdefroi [1], wdefroi [2]
	wdefroi [3], wdefroi [4], yesnox [1], yesnox [2]
	Note: 	origin = [x0,y0] chooses x0,y0 as origin of coordinates.
	      	/origin allows choosing origin by click on image.

	xy - array defining target area,
	     	default is to read from image with WDEFROI
       /new - set if rr array exists but you wish to recompute it
		forces recomputation of xy also.
	fit_param - set this to execute and plot a log10-log10 fit 
		to xxx vs. sig and, if you wish, return the parameters
               Set fit_param=1 to return the parameters.
	yfit - values of the fitted log10-log10 curve at xxx
	/noplot - causes program to skip plotting of raw data, saves time.
	multiple - Use for 2 or more disconnected regions (e.g., multiple=3)
	unc_data - array of uncertainties of values in image from SXT_PREP
	skip - array of indices to be excluded from analysis.  This is
		a good way to eliminate unwanted features that can be
		identified with a "where" analysis before using sector_avg.
	sector = [begin_angle,end_angle,angle_step]
		measured clockwise in degrees from CCD vertical
	/noqx - causes the program to complete without pauses and questions.
               and shows no data plots.
 OPTIONAL KEYWORD OUTPUT
	azipix =  number of pixels at each R position.
	    Needed for renormalizing emission measure after SXT_TEEM is run.
	sectparam = structure with angles, fitting parameters, and number
	    of valid pixels in each sector for sector analysis.  The parameter
	    sectparam.angle refers to the middle of the sector.
		** Structure <45f20088>, 4 tags, length=16, refs=2:
		   ANGLE           FLOAT           228.000
		   CONST           FLOAT           6.78359
		   SLOPE           FLOAT          -1.99499
		   NUMPIX          INT            146 
 PROGRAMS CALLED
	sfd_comp, cursor, plots, plusmark, gt_corner, wdefroi, where,
	findgen, rebin, reform, sqrt, wdef, xyouts, plot, fix, max,
	total, float, n_elements, indgen, gt_res, alog10, poly_fit, print
	sector_bound
 HISTORY
       LWA 26-June-94, wrote original program.
	LWA 2-Dec-94, added capability for non-suncenter origin.
	LWA 26-Jan-95, cleaned up header and fixed /new omission.
		Changed order of variables in call.
	LWA 29-Jan-95, added keyword for disconnected regions.
	LWA 16-Mar-95, replaced sxt_cen with -gt_corner(index,/from_sc)
	        and made index a keyword.
	LWA 23-Mar-95, Corrected to include negative values in averages.
		and added keyword /noplot.
	LWA 6-Apr-95, Added computation of uncertainties.  Eliminated "img".
	LWA 8-Apr-95, Added fullsig and unc_fullsig and changed "out" to "sig".
	LWA 1-Jun-95, Added skip keyword.
	LWA 14-Jun-95, Changed name to AZIMUTH_AVG.PRO
		Added sector averaging (What a mess!)
	LWA 5-Jul-95, Corrected header.
	LWA 28-nov-95, Added noqx keyword.
	LWA 29-Nov-95, Fixed array dimensions and fit_param for sectoring.
	LWA 30-Nov-95, Fixed rmax-rmin dimensioning problem.
	LWA 25-Oct=96, Fixed problem of missing nxy if no skip.
	LWA  6-Apr-01, Added sector parameter, sectparam, output.
	LWA  8-Apr-01, Added numpix to sectparam.
		       Added test for sectors with no data.
		       Incorporated keyword azipix, making AZIMUTH_AVG obsolete.
	LWA 23-May-01, Split if test on fitparam and nii to avoid error when
		       not fitting data.  Added needed fitparam test.
	LWA 25-May-01, Moved sectparam.numpix out of fitparam check.
	LWA 28-May-01, Updated header.


sector_bound $SSW/yohkoh/ucon/idl/acton/sector_bound.pro
[Previous] [Next]
 NAME:
	sector_bound
 PURPOSE
	  To return the vector of indices for a sector of angular
	width theta1-theta0, centered at x,y within a rectangular
	array of dimensions nx,ny.
	  If the sector includes one or more corners in the array 
	the vector includes the area out to the corners.
 CALLING SEQUENCE
	xy=sector_bound(theta0,theta1,x,y,nx,ny)
 INPUT
	Measuring CW from up (north on CCD)
	   theta0 - angle (degrees) defining small-angle boundary of sector
	   theta1 - angle (degrees) defining large-angle boundary of sector
	x, y, - coordinates of origin
	nx, ny - dimensions of rectangular array
 OUTPUT
	xy - vector of indices of pixels within sector
 RESTRICTIONS
       Do not use a theta range greater than 180 degrees.
 HISTORY
	LWA, 14-Jun-95, written for use in azimuth_avg.pro
	LWA, 28-Nov-95, corrected error in (case 3:) equation.
                       corrected error in (case 2:) equation.
	LWA, 12-Apr-01, corrected and clarified header.
 CALLED BY
	sector_avg, sxt_scatwings, xy_lwa


SEEIGN_CHECKER $SSW/yohkoh/ucon/idl/shimizu/seeing_checker.pro
[Previous] [Next]
 NAME:
	SEEIGN_CHECKER
 PURPOSE:
	Estimate seeing of ground-based data to pick up good seeing
	data.
 CALLING SEQUENCE:
	SEEING_CHECKER
 INPUTS:
	file - LaPalma file name, such as 
			"/data2/soup/le132f18w6563lcn####.rigd"
	nst - the first image number, which will be inserted in ####.
	nend - the last image number.
 OPTIONAL INPUTS:
	subarea - the area size for the seeing measure. The area is
	   centered in images. The defualt - 384.
 OUTPUTS:
	meanint - mean intensity
	seeing - Seeing measure
 CALLS: ***
	FNS, RD_LP, SEEING_CHECKER
 NOTE:
	results are saved in the image number position. For instanse,
	an image ####=0010 is stored in seeing(10), meanint(10), even if
	nst is not set to 1. 
 PROCEDURES:
	Calculate mean intensity and absolute mean differential intensity
	defined as follows:
	   meanint= total(subdata)/n_elements(subdata)
      	   diff= subdata(1:*,*)-subdata(0:subarea-2, *)
	   mean = total(abs(diff))/n_elements(diff)
	   seeing= mean / meanint
 HISTORY:
	18-June-94 T.Shimizu written with referrence of Dr.Shine's 
		ANA software. 


SEEIGN_CHECKER2 $SSW/yohkoh/ucon/idl/shimizu/seeing_checker2.pro
[Previous] [Next]
 NAME:
	SEEIGN_CHECKER2
 PURPOSE:
	Estimate seeing of ground-based data to pick up good seeing
	data.
 CALLING SEQUENCE:
	SEEING_CHECKER2, data, meanint, seeing
 INPUTS:
	data -  LaPalma image cube
 OPTIONAL INPUTS:
	subarea - the area size for the seeing measure. The area is
	   centered in images. The defualt - Full field.
 OUTPUTS:
	meanint - mean intensity
	seeing - Seeing measure
 PROCEDURES:
	Calculate mean intensity and absolute mean differential intensity
	defined as follows:
	   meanint= total(subdata)/n_elements(subdata)
      	   diff= subdata(1:*,*)-subdata(0:subarea-2, *)
	   mean = total(abs(diff))/n_elements(diff)
	   seeing= mean / meanint
 CALLS: ***
	SEEING_CHECKER2
 HISTORY:
	15-July-94 T.Shimizu written with referrence of Dr.Shine's 
		ANA software. 


SEL_AR $SSW/yohkoh/ucon/idl/metcalf/sel_ar.pro
[Previous] [Next]
NAME:
	SEL_AR
PURPOSE:
	Finds spr data for an active region, by "tracking" a position on the sun
       as it rotates and finding data close to the active region.  It will
       also work for sfr data, but FFI's are always selected so it isn't
       very useful for FFI's.
CATEGORY:
CALLING SEQUENCE:
      sel_ar, infil, roadmap, ss, lon=lon, lat=lat, date=date
INPUTS:
      lon = reference longitude of the active region, degrees, west positive
      lat = reference longitude of the active region, degrees, north positive
      date = reference date for the lon,lat coordinates, 
             e.g. '6-DEC-91 11:41:52'
OPTIONAL INPUT PARAMETERS:
      roadmap = If present, roadmap passed is used instead of reading it in.
                If it is not defined on input, the roadmap will be passed back
                in this variable.  If roadmap is set on input, infil must
                also be set.
      infil = If set to a string array on input, the file names in "files"
              will be searched.  Otherwise all the data in the current path
              will be checked(!).  On output, the files variable will be 
              replaced by the actual list of files searched.
      ss = If defined on input, ss is used for initial data selection.
KEYWORD PARAMETERS
      reset = Ignore files,roadmap if they are already defined (force data
              to be read in)
      arcmin = specifies how close the field-of-view center should
               be to the active region (in arc minutes), default is 0.  The 
               size of the image is added to the arcmin value, so the default
               of zero implies that the point being tracked must be just 
               inside the FOV.  Negative values will force the AR well 
               insided the FOV.
      cdir_only = if set, look only at the files in the current directory
OUTPUTS:
      ss = array of the image indices which are close to the AR
 CALLS: ***
	DATA_PATHS, DIFF_ROT [1], DIFF_ROT [2], Ex2Int [1], Ex2Int [2], HEL2ARCMIN [1]
	HEL2ARCMIN [2], Rd_Roadmap [2], anytim2ex [1], anytim2ex [2], file_list [1]
	file_list [2], gt_day [1], gt_day [2], gt_fov_center, gt_pix_size, gt_res
	gt_shape_cmd, gt_time [1], gt_time [2], rd_roadmap [1], where_arr [1]
	where_arr [2]
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
      FFI images are *always* selected.  Only PFI images are checked for a 
      position which matches the location of the active region.
PROCEDURE:
      The data are selected based upon their position (including differential
      rotation).
      No selection is done for different filters etc.  I assume this
      will come at some later step in the analysis process.
EXAMPLES:
       
     IDL> sel_ar,infil,roadmap,ss,lon=-2.,lat=19.,date='9-DEC-91 00:00:00'

MODIFICATION HISTORY:
      T. Metcalf  May 04, 1992
             TRM  Feb 27, 1993  Since gt_fov_center.pro was updated, this
                                routine also needed to be updated.  It now
                                works with the new gt_fov_center.


SEL_BSC $SSW/yohkoh/bcs/idl/bsc/sel_bsc.pro
[Previous] [Next]
 NAME:
       SEL_BSC
 PURPOSE:
       Select wavelength and flux arrays for given channels.

 CALLING SEQUENCE:
       SEL_BSC,BSC_INDEX,BSC_DATA,NINDEX,NDATA,WAVE,FLUX,EFLUX	; All Channels 
       SEL_BSC,BSC_INDEX,BSC_DATA,NINDEX,NDATA,WAVE,FLUX,EFLUX,CHAN=CHAN,SS=SS
       SEL_BSC,BSC_INDEX,BSC_DATA,NINDEX,NDATA,WAVE,FLUX,EFLUX,CHAN=CHAN,FIT=FIT
 INPUTS:
       BSC_INDEX    - BSC index structure
       BSC_DATA     - BSC data structure
 OUTPUTS:
       NINDEX	     - BSC index structure for selected channels
       NDATA        - BSC data structure for selected channels
       WAVE	     - Array of wavelengths
       FLUX	     - Array of fluxes (ph cm-1 s-1 Ang-1)
       EFLUX	     - Uncertainty on FLUX
 OPTIONAL KEYWORDS:
       CHAN (in)    - BCS channel (def is all)
       FIT (out)    - fitted synthetic spectrum (total spectrum)
       SFIT (out)   - secondary spectrum = (total - primary)
       FWAVE (out)  - computed wavelengths for fitted spectrum
       SS   (out)   - indicies matching selected data
       TSTART (in)  - start time to extract (UTPLOT format)
       TEND (in)    - end time to extract
       COUNTS (out) - total accumulated observed spectra (counts/bin)
       BIN (out)    - original detector bins
 CALLS: ***
	BSC_CHECK [1], BSC_CHECK [2], BSC_ERRCAL [1], BSC_ERRCAL [2], BSC_TIM2DSET
	BSC_VALID, CHKARG, DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4]
	GT_BSC_CHAN [1], GT_BSC_CHAN [2], GT_BSC_FLUX, GT_BSC_WAVE [1], GT_BSC_WAVE [2]
	chktag, delvarx [5]
 CALLED BY:
	BSC_RASTER, CV_BSC2BSD, GET_BSC, LC_BSC, PLOT_BSC [1], PLOT_BSC [2], WBSC [1]
	WBSC [2], WBSC_LTC_EV [1], WBSC_LTC_EV [2], bsc_spec_plot [1], bsc_spec_plot [2]
	cal_bsc, fit_bsc, fit_bsc_as, map_bsc
 HISTORY:
       11-sep-93, D. Zarro (ARC) and J. Lemen (LPARL), Written.
       Oct'93, Zarro (ARC), added TSTART and TEND keywords.
       8-Nov-93, Zarro (ARC), added SFIT keyword
       13-Dec-93, Zarro, changed TSTART, TEND arguments to keywords in 
                  BSC_TIM2DSET.
       20-Dec-93, Zarro, added check for ncomp_fit=2 before extracting SFIT
       9 -Apr-94, Zarro, added check for COUNTS field
      12 -May-94, Zarro, added BIN keyword to return original BIN arrays,
                         also fixed potential bugs in SS and NBIN usage.
       7,9-Jan-95, Zarro, found and fixed another potential bug in SS.


sel_dc_image [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sel_dc_image.pro
[Previous] [Next]
NAME:
	sel_dc_image
PURPOSE:
	Given an index or roadmap structure, match the closest dark 
	current image for that exposure
CALLING SEQUENCE:
	sel_dc_image, index(3), dset, imap
	sel_dc_image, roadmap, dset, imap

	sel_dc_image, xxx, dset, times=times, res=res, dpe=dpe
	sel_dc_image, xxx, dset, times='1-sep-92 1:00', res=0, dpe=15
INPUT:
	struct_in - An index or roadmap structure.  If the input
		    is an array, then data will be a matrix and it
		    is necessary to use the output variable "imap"
		    to match up which dark frame goes with which input
		    image.  This is done so that unnessary duplication
		    of the same image is not done.

		    If the image was taken when the CCD was warm, then
		    the index should be passed in so that the routine
		    can match the temperature also.
 CALLS: ***
	GET_INFO2, RD_XDA [1], RD_XDA [2], Rd_Roadmap [2], UNIQ [1], UNIQ [2], UNIQ [3]
	anytim2ints [1], anytim2ints [2], file_list [1], file_list [2], gt_corner, gt_dpe
	gt_pfi_ffi, gt_res, gt_shape, gt_temp_ccd, int2secarr [1], int2secarr [2]
	mk_dset_str [1], mk_dset_str [2], rd_roadmap [1], sel_timrange [1]
	sel_timrange [2], ssw_time_compare, tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	get_dc_image [2], get_dc_image [3], reget_dc_image
OPTIONAL KEYWORD INPUT:
	times	- MANUAL METHOD:  A list of input times (any of 3 standard
		  formats)
	res	- MANUAL METHOD: The resolution required (0=full res, 
		  1=half res, 2=quarter res)
	dpe	- MANUAL METHOD: The DPE level (exposure level)
	temp	- MANUAL METHOD: The CCD temperature in degrees.  If not
		  passed, it will use -21.0 C
	long	- If set, then match any DPEs OVER the minimum DPE value
		  for the input resolution (FR,HR,QR = 21, 23, 19)
		  (not the DPE value closest to it)
		 	TODO - this definition has changed
	short	- If set, then match any DPEs UNDER the maximum DPE value
		  for the input resolution (FR,HR,QR = 13, 13, 13)
		  (not the DPE value closest to it)
		 	TODO - this definition has changed
	mmdpe	- An array with min or maximum DPE value to search for.
		  Used in conjuction with the /LONG option
OUTPUT:
	file_use- The names of the SDC/SDW files that are to be used for
		  the selected dark frames (subset of "dc_infil")
	dset	- The MK_DSET_STR output listing the dataset and file
		  number of the unique dark images.
		  Use "imap" to figure which dark image to use for which
		  input image.
	imap	- A list of indicies telling which image in "data" to
		  use for each "struct_in" image.  The output is an
		  array the same length as "struct_in" with values that
		  go from 0 to the number of dark images minus one.
KEYWORD OUTPUT:
	match_qual - The quality of the match.  It is a structure with
		  the following fields.
			.dpe  = # of seconds in exposure away from the actual
				0 is perfect match, positive means DC
				is longer exposure than requested.
			.time = the number of days from the requested day.
			        positive is for DC images taken past
				the time of the input image
			.temp = the number of degress that the match is off
			.dpeval = the DPE value matched
METHOD:
	The program will try to make an exact match to the exposure
	level passed.  If it cannot match, it will take the next exposure
	larger which is available.  

	GET_DC_IMAGE can be called manually by passing "times", "res"
	and "dpe" using the keywords.  All three need to be passed, however
	it is possible to pass an array of times, but have res or dpe
	be a scalar.
HISTORY:
	Written 24-Aug-93 by M.Morrison (using GET_DC_IMAGE as starting point)
	Differences from GET_DC_IMAGE:
		* Combined GET_DC_WARM and GET_DC_IMAGE
		* Match on exposure duration in seconds, not DPE value
	25-Aug-93 (MDM) - Added "dc_filidx" to speed things up
	 1-Sep-93 (MDM) - Corrected a typo "dc_filidx2"
	16-Dec-93 (MDM) - Modified to break images into two categories
			  Those taken before 13-Nov-92 and those taken 
			  after.  Do not cross the line.
	26-Jan-94 (MDM) - Corrected error when trying to get SDW files and
			  they do not exist.
			- Modified the logic so that manual passing of the
			  temperature works properly
	31-Jan-94 (MDM) - Corrected 26-Jan-94 patch - there are cases when
			  the roadmap is passed in, which does not have the
			  temperature
       11-May-94 (SLF) - subscript protection for good(ss)
	15-Aug-94 (MDM) - Try to add some protection in the case when
			  the execution is interupted in the middle of
			  reading the SDC roadmaps
	29-Nov-94 (MDM) - Modified the logic so that the closest image
			  above and below the desired exposure duration
			  are used.  Previously, it used a short exposure
			  and a medium or long exposure no matter what the
			  input exposure duration was.
	30-Nov-94 (MDM) - Fairly large change to the technique used to find
			  a match.  It MUST be within +/- 30 days now, and 
			  it still minimizes the DPE error and temperature
			  error and finds the image closest in time with
			  those minimum error.	
	27-Feb-95 (MDM) - Modified to allow a large temperature error when
			  no SDW data is available.
	 1-Mar-95 (MDM) - Patched error which occured during warm CCD and
			  when /INTERPOLATE is used.
	15-May-95 (MDM) - Modified to be able to use PFI images as the
			  input (slight modification to the 288 line number
			  starting corner of FR images code).
       05-Feb-98 (TRM) - Modified definition of /short so that and equal
                         DPE does not match for the short case
          8-Feb-98 (SLF) - added a '/cd' to file_list call
                           (avoid no file found message when #files gets big
          5-Jan-99 (SLF) - fixed ancient y2k problem
         02-Dec-02 (TRM) - Change +/- 7 day search to +/- 10 day search
	30-Mar-04 (LWA) - Increased SDC max_temperr to 6 degrees for time prior
			to CCD cooling ('2-Oct-91 09:00').
			  Corrected error in 14-Nov-92 test logic.
			  Changed 2 intarr to lonarr to cope with SDC_06.


sel_dc_image [2] $SSW/yohkoh/sxt/idl/atest/sel_dc_image.pro
[Previous] [Next]
NAME:
	sel_dc_image
PURPOSE:
	Given an index or roadmap structure, match the closest dark 
	current image for that exposure
CALLING SEQUENCE:
	sel_dc_image, index(3), dset, imap
	sel_dc_image, roadmap, dset, imap

	sel_dc_image, xxx, dset, times=times, res=res, dpe=dpe
	sel_dc_image, xxx, dset, times='1-sep-92 1:00', res=0, dpe=15
INPUT:
	struct_in - An index or roadmap structure.  If the input
		    is an array, then data will be a matrix and it
		    is necessary to use the output variable "imap"
		    to match up which dark frame goes with which input
		    image.  This is done so that unnessary duplication
		    of the same image is not done.

		    If the image was taken when the CCD was warm, then
		    the index should be passed in so that the routine
		    can match the temperature also.
 CALLS: ***
	GET_INFO2, RD_XDA [1], RD_XDA [2], Rd_Roadmap [2], UNIQ [1], UNIQ [2], UNIQ [3]
	anytim2ints [1], anytim2ints [2], file_list [1], file_list [2], gt_corner, gt_dpe
	gt_pfi_ffi, gt_res, gt_shape, gt_temp_ccd, int2secarr [1], int2secarr [2]
	mk_dset_str [1], mk_dset_str [2], rd_roadmap [1], sel_timrange [1]
	sel_timrange [2], ssw_time_compare, tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	get_dc_image [2], get_dc_image [3], reget_dc_image
OPTIONAL KEYWORD INPUT:
	times	- MANUAL METHOD:  A list of input times (any of 3 standard
		  formats)
	res	- MANUAL METHOD: The resolution required (0=full res, 
		  1=half res, 2=quarter res)
	dpe	- MANUAL METHOD: The DPE level (exposure level)
	temp	- MANUAL METHOD: The CCD temperature in degrees.  If not
		  passed, it will use -21.0 C
	long	- If set, then match any DPEs OVER the minimum DPE value
		  for the input resolution (FR,HR,QR = 21, 23, 19)
		  (not the DPE value closest to it)
		 	TODO - this definition has changed
	short	- If set, then match any DPEs UNDER the maximum DPE value
		  for the input resolution (FR,HR,QR = 13, 13, 13)
		  (not the DPE value closest to it)
		 	TODO - this definition has changed
	mmdpe	- An array with min or maximum DPE value to search for.
		  Used in conjuction with the /LONG option
OUTPUT:
	file_use- The names of the SDC/SDW files that are to be used for
		  the selected dark frames (subset of "dc_infil")
	dset	- The MK_DSET_STR output listing the dataset and file
		  number of the unique dark images.
		  Use "imap" to figure which dark image to use for which
		  input image.
	imap	- A list of indicies telling which image in "data" to
		  use for each "struct_in" image.  The output is an
		  array the same length as "struct_in" with values that
		  go from 0 to the number of dark images minus one.
KEYWORD OUTPUT:
	match_qual - The quality of the match.  It is a structure with
		  the following fields.
			.dpe  = # of seconds in exposure away from the actual
				0 is perfect match, positive means DC
				is longer exposure than requested.
			.time = the number of days from the requested day.
			        positive is for DC images taken past
				the time of the input image
			.temp = the number of degress that the match is off
			.dpeval = the DPE value matched
METHOD:
	The program will try to make an exact match to the exposure
	level passed.  If it cannot match, it will take the next exposure
	larger which is available.  

	GET_DC_IMAGE can be called manually by passing "times", "res"
	and "dpe" using the keywords.  All three need to be passed, however
	it is possible to pass an array of times, but have res or dpe
	be a scalar.
HISTORY:
	Written 24-Aug-93 by M.Morrison (using GET_DC_IMAGE as starting point)
	Differences from GET_DC_IMAGE:
		* Combined GET_DC_WARM and GET_DC_IMAGE
		* Match on exposure duration in seconds, not DPE value
	25-Aug-93 (MDM) - Added "dc_filidx" to speed things up
	 1-Sep-93 (MDM) - Corrected a typo "dc_filidx2"
	16-Dec-93 (MDM) - Modified to break images into two categories
			  Those taken before 13-Nov-92 and those taken 
			  after.  Do not cross the line.
	26-Jan-94 (MDM) - Corrected error when trying to get SDW files and
			  they do not exist.
			- Modified the logic so that manual passing of the
			  temperature works properly
	31-Jan-94 (MDM) - Corrected 26-Jan-94 patch - there are cases when
			  the roadmap is passed in, which does not have the
			  temperature
       11-May-94 (SLF) - subscript protection for good(ss)
	15-Aug-94 (MDM) - Try to add some protection in the case when
			  the execution is interupted in the middle of
			  reading the SDC roadmaps
	29-Nov-94 (MDM) - Modified the logic so that the closest image
			  above and below the desired exposure duration
			  are used.  Previously, it used a short exposure
			  and a medium or long exposure no matter what the
			  input exposure duration was.
	30-Nov-94 (MDM) - Fairly large change to the technique used to find
			  a match.  It MUST be within +/- 30 days now, and 
			  it still minimizes the DPE error and temperature
			  error and finds the image closest in time with
			  those minimum error.	
	27-Feb-95 (MDM) - Modified to allow a large temperature error when
			  no SDW data is available.
	 1-Mar-95 (MDM) - Patched error which occured during warm CCD and
			  when /INTERPOLATE is used.
	15-May-95 (MDM) - Modified to be able to use PFI images as the
			  input (slight modification to the 288 line number
			  starting corner of FR images code).
       05-Feb-98 (TRM) - Modified definition of /short so that and equal
                         DPE does not match for the short case
          8-Feb-98 (SLF) - added a '/cd' to file_list call
                           (avoid no file found message when #files gets big
          5-Jan-99 (SLF) - fixed ancient y2k problem
         02-Dec-02 (TRM) - Change +/- 7 day search to +/- 10 day search


sel_dc_image [3] $SSW/yohkoh/sxt/idl/util/sel_dc_image.pro
[Previous] [Next]
NAME:
	sel_dc_image
PURPOSE:
	Given an index or roadmap structure, match the closest dark 
	current image for that exposure
CALLING SEQUENCE:
	sel_dc_image, index(3), dset, imap
	sel_dc_image, roadmap, dset, imap

	sel_dc_image, xxx, dset, times=times, res=res, dpe=dpe
	sel_dc_image, xxx, dset, times='1-sep-92 1:00', res=0, dpe=15
INPUT:
	struct_in - An index or roadmap structure.  If the input
		    is an array, then data will be a matrix and it
		    is necessary to use the output variable "imap"
		    to match up which dark frame goes with which input
		    image.  This is done so that unnessary duplication
		    of the same image is not done.

		    If the image was taken when the CCD was warm, then
		    the index should be passed in so that the routine
		    can match the temperature also.
 CALLS: ***
	GET_INFO2, RD_XDA [1], RD_XDA [2], Rd_Roadmap [2], UNIQ [1], UNIQ [2], UNIQ [3]
	anytim2ints [1], anytim2ints [2], file_list [1], file_list [2], gt_corner, gt_dpe
	gt_pfi_ffi, gt_res, gt_shape, gt_temp_ccd, int2secarr [1], int2secarr [2]
	mk_dset_str [1], mk_dset_str [2], rd_roadmap [1], sel_timrange [1]
	sel_timrange [2], ssw_time_compare, tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	get_dc_image [2], get_dc_image [3], reget_dc_image
OPTIONAL KEYWORD INPUT:
	times	- MANUAL METHOD:  A list of input times (any of 3 standard
		  formats)
	res	- MANUAL METHOD: The resolution required (0=full res, 
		  1=half res, 2=quarter res)
	dpe	- MANUAL METHOD: The DPE level (exposure level)
	temp	- MANUAL METHOD: The CCD temperature in degrees.  If not
		  passed, it will use -21.0 C
	long	- If set, then match any DPEs OVER the minimum DPE value
		  for the input resolution (FR,HR,QR = 21, 23, 19)
		  (not the DPE value closest to it)
		 	TODO - this definition has changed
	short	- If set, then match any DPEs UNDER the maximum DPE value
		  for the input resolution (FR,HR,QR = 13, 13, 13)
		  (not the DPE value closest to it)
		 	TODO - this definition has changed
	mmdpe	- An array with min or maximum DPE value to search for.
		  Used in conjuction with the /LONG option
OUTPUT:
	file_use- The names of the SDC/SDW files that are to be used for
		  the selected dark frames (subset of "dc_infil")
	dset	- The MK_DSET_STR output listing the dataset and file
		  number of the unique dark images.
		  Use "imap" to figure which dark image to use for which
		  input image.
	imap	- A list of indicies telling which image in "data" to
		  use for each "struct_in" image.  The output is an
		  array the same length as "struct_in" with values that
		  go from 0 to the number of dark images minus one.
KEYWORD OUTPUT:
	match_qual - The quality of the match.  It is a structure with
		  the following fields.
			.dpe  = # of seconds in exposure away from the actual
				0 is perfect match, positive means DC
				is longer exposure than requested.
			.time = the number of days from the requested day.
			        positive is for DC images taken past
				the time of the input image
			.temp = the number of degress that the match is off
			.dpeval = the DPE value matched
METHOD:
	The program will try to make an exact match to the exposure
	level passed.  If it cannot match, it will take the next exposure
	larger which is available.  

	GET_DC_IMAGE can be called manually by passing "times", "res"
	and "dpe" using the keywords.  All three need to be passed, however
	it is possible to pass an array of times, but have res or dpe
	be a scalar.
HISTORY:
	Written 24-Aug-93 by M.Morrison (using GET_DC_IMAGE as starting point)
	Differences from GET_DC_IMAGE:
		* Combined GET_DC_WARM and GET_DC_IMAGE
		* Match on exposure duration in seconds, not DPE value
	25-Aug-93 (MDM) - Added "dc_filidx" to speed things up
	 1-Sep-93 (MDM) - Corrected a typo "dc_filidx2"
	16-Dec-93 (MDM) - Modified to break images into two categories
			  Those taken before 13-Nov-92 and those taken 
			  after.  Do not cross the line.
	26-Jan-94 (MDM) - Corrected error when trying to get SDW files and
			  they do not exist.
			- Modified the logic so that manual passing of the
			  temperature works properly
	31-Jan-94 (MDM) - Corrected 26-Jan-94 patch - there are cases when
			  the roadmap is passed in, which does not have the
			  temperature
       11-May-94 (SLF) - subscript protection for good(ss)
	15-Aug-94 (MDM) - Try to add some protection in the case when
			  the execution is interupted in the middle of
			  reading the SDC roadmaps
	29-Nov-94 (MDM) - Modified the logic so that the closest image
			  above and below the desired exposure duration
			  are used.  Previously, it used a short exposure
			  and a medium or long exposure no matter what the
			  input exposure duration was.
	30-Nov-94 (MDM) - Fairly large change to the technique used to find
			  a match.  It MUST be within +/- 30 days now, and 
			  it still minimizes the DPE error and temperature
			  error and finds the image closest in time with
			  those minimum error.	
	27-Feb-95 (MDM) - Modified to allow a large temperature error when
			  no SDW data is available.
	 1-Mar-95 (MDM) - Patched error which occured during warm CCD and
			  when /INTERPOLATE is used.
	15-May-95 (MDM) - Modified to be able to use PFI images as the
			  input (slight modification to the 288 line number
			  starting corner of FR images code).


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

   Purpose: break selsis file names into components / information

   Input Parameters:
      filenames - selsis filenames (yymmddhhmmSWRO.[fts.Z])
		   S=source, W=wavelength, R=resolution, O=orientation

   Output Parameters:
      imgtimes -   image times in Yohkoh standard string
      source   -   Source character (or descriptive string if  /convert set)
      wavelength - Wavelength character (or descriptive string if /conver set)

   Keyword Parameters:
      convert - if set, convert characters to descriptive strings
      ynames (out) - converted Yohkoh filenames
		
 CALLS: ***
	fid2ex [1], fid2ex [2], fmt_tim [1], fmt_tim [2]
 CALLED BY:
	get_selsis
   History:
      2-Mar-95 (SLF)
      3-Mar-95 (SLF) - add ynames
      13-jan-99 (PGS) - modified to accept new four year file discriptors (y2k)


sel_img $SSW/yohkoh/ucon/idl/kawai/sel_img.pro
[Previous] [Next]
PROGRAM:
    sel_img
PURPOSE
    Select some images from DATA and display them in lines
    and rows.
    A sunspot contour is overplotted.
    For 1x1 OR data, each image is rebinned into 256x256 and
    displayed in 1024x768 window.
    For data of which FOV is larger than that, 96x96 part
    is cut from each image and rebinned into 384x384. Then
    they are displayed in 1152x768 window.
    Space Craft jittering is corrected.

CALLING SEQUENCE
    sel_img,data,index
INPUTS
    data, index = that of taken by YODAT.
                  DATA must be include sunspot data.

HISTORY
    2 Feb., 1993   Goro Kawai
 CALLS:


sel_leak_image [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sel_leak_image.pro
[Previous] [Next]
NAME:
	sel_leak_image
PURPOSE:
	Select the proper leak image required for correction
INPUT:
	item	- Index or roadmap
OUTPUT:
	leak_files- The names of the leak files
	dsets	- It is the same length as "item".  The value is -1 if 
		  no leak image is available.
 CALLED BY:
	get_leak_image [1], get_leak_image [2], get_leak_image [3], leak_sub [1]
	leak_sub [2], leak_sub [3], sxt_prep [1], sxt_prep [2], sxt_prep [3]
HISTORY:
	Written 27-Aug-93 by M.Morrison
	13-Sep-93 (MDM) - Replaced Al.1 Oct-92 image file sfc921127.0947;			  with sfc921125.1708 (actually the same image, 
			  the previous file had the wrong index/label).
	15-Sep-93 (MDM) - Modified the logic so that a ND leak image
			  is not used to correct an OPEN x-ray image.
			- Added 5 leak images which used ND filter
	19-Nov-93 (MDM) - Modification to not even bother checking for
			  SFC files if data is pre-Nov-92.
       10-Dec-94 (SLF) - major rewrite - add hook for pointing
			  (use match_index.pro for image selection)
                         (no explicit file names - check all matching SFC)
        3-Jan-94 (SLF) - pre-define output for pre-Nov-1992 data
       22-aug-95 (SLF) - check "leak era" and select appropriate image
	19-Apr-96 (GLS) - Corrected a bug in the assignment of indices to
			  DSETS from the values returned by MATCH_INDEX.
			- Corrected 'No leak image' warning code
       11-oct-96 (SLF) - add /ccdtemp switch to match_index call
       20-Jul-98 (SLF) - add /cd to file_list (avoid 'arg list too long')
        1-Feb-99 (SLF) - auto backup to previous era  (WARN)
       26-feb-99 (SLF) - remove hard coded leak era start (use get_yo_dates)
                         inhibit auto-era-backup logic 
        1-Mar-99 (SLF) - eliminate bogus 'no leak image' for files
                         spanning era 0 (none required) and era1 
        4-feb-04 (SLF) - remote CCD Temp tolerance requirement in call
                         to match_index

 CALLS: ***
	BOX_MESSAGE, RD_SDA [1], RD_SDA [2], RD_SDA [3], Rd_Roadmap [2], file_list [1]
	file_list [2], fmt_tim [1], fmt_tim [2], get_info [1], get_info [2], get_info [3]
	get_info [4], get_yo_dates [1], get_yo_dates [2], get_yo_dates [3]
	match_index [1], match_index [2], rd_roadmap [1], sel_timrange [1]
	sel_timrange [2], ssw_deltat, ut_time [1], ut_time [2]
   Common Blocks:
      sel_leak_image	 (files & roadmaps)
      sel_leak_image1   (index records)


sel_leak_image [2] $SSW/yohkoh/gen/galileo/idl/lmsal/sel_leak_image2.pro
[Previous] [Next]
NAME:
	sel_leak_image
PURPOSE:
	Select the proper leak image required for correction
INPUT:
	item	- Index or roadmap
OUTPUT:
	leak_files- The names of the leak files
	dsets	- It is the same length as "item".  The value is -1 if 
		  no leak image is available.
 CALLED BY:
	get_leak_image [1], get_leak_image [2], get_leak_image [3], leak_sub [1]
	leak_sub [2], leak_sub [3], sxt_prep [1], sxt_prep [2], sxt_prep [3]
HISTORY:
	Written 27-Aug-93 by M.Morrison
	13-Sep-93 (MDM) - Replaced Al.1 Oct-92 image file sfc921127.0947;			  with sfc921125.1708 (actually the same image, 
			  the previous file had the wrong index/label).
	15-Sep-93 (MDM) - Modified the logic so that a ND leak image
			  is not used to correct an OPEN x-ray image.
			- Added 5 leak images which used ND filter
	19-Nov-93 (MDM) - Modification to not even bother checking for
			  SFC files if data is pre-Nov-92.
       10-Dec-94 (SLF) - major rewrite - add hook for pointing
			  (use match_index.pro for image selection)
                         (no explicit file names - check all matching SFC)
        3-Jan-94 (SLF) - pre-define output for pre-Nov-1992 data
       22-aug-95 (SLF) - check "leak era" and select appropriate image
	19-Apr-96 (GLS) - Corrected a bug in the assignment of indices to
			  DSETS from the values returned by MATCH_INDEX.
			- Corrected 'No leak image' warning code
       11-oct-96 (SLF) - add /ccdtemp switch to match_index call
       20-Jul-98 (SLF) - add /cd to file_list (avoid 'arg list too long')
        1-Feb-99 (SLF) - auto backup to previous era  (WARN)
       26-feb-99 (SLF) - remove hard coded leak era start (use get_yo_dates)
                         inhibit auto-era-backup logic 
        1-Mar-99 (SLF) - eliminate bogus 'no leak image' for files
                         spanning era 0 (none required) and era1 

   Common Blocks:
      sel_leak_image	 (files & roadmaps)
      sel_leak_image1   (index records)


sel_leak_image [3] $SSW/yohkoh/sxt/idl/atest/sel_leak_image.pro
[Previous] [Next]
NAME:
	sel_leak_image
PURPOSE:
	Select the proper leak image required for correction
INPUT:
	item	- Index or roadmap
OUTPUT:
	leak_files- The names of the leak files
	dsets	- It is the same length as "item".  The value is -1 if 
		  no leak image is available.
 CALLED BY:
	get_leak_image [1], get_leak_image [2], get_leak_image [3], leak_sub [1]
	leak_sub [2], leak_sub [3], sxt_prep [1], sxt_prep [2], sxt_prep [3]
HISTORY:
	Written 27-Aug-93 by M.Morrison
	13-Sep-93 (MDM) - Replaced Al.1 Oct-92 image file sfc921127.0947;			  with sfc921125.1708 (actually the same image, 
			  the previous file had the wrong index/label).
	15-Sep-93 (MDM) - Modified the logic so that a ND leak image
			  is not used to correct an OPEN x-ray image.
			- Added 5 leak images which used ND filter
	19-Nov-93 (MDM) - Modification to not even bother checking for
			  SFC files if data is pre-Nov-92.
       10-Dec-94 (SLF) - major rewrite - add hook for pointing
			  (use match_index.pro for image selection)
                         (no explicit file names - check all matching SFC)
        3-Jan-94 (SLF) - pre-define output for pre-Nov-1992 data
       22-aug-95 (SLF) - check "leak era" and select appropriate image
	19-Apr-96 (GLS) - Corrected a bug in the assignment of indices to
			  DSETS from the values returned by MATCH_INDEX.
			- Corrected 'No leak image' warning code
       11-oct-96 (SLF) - add /ccdtemp switch to match_index call
       20-Jul-98 (SLF) - add /cd to file_list (avoid 'arg list too long')
        1-Feb-99 (SLF) - auto backup to previous era  (WARN)
       26-feb-99 (SLF) - remove hard coded leak era start (use get_yo_dates)
                         inhibit auto-era-backup logic 
        1-Mar-99 (SLF) - eliminate bogus 'no leak image' for files
                         spanning era 0 (none required) and era1 

 CALLS: ***
	BOX_MESSAGE, RD_SDA [1], RD_SDA [2], RD_SDA [3], Rd_Roadmap [2], file_list [1]
	file_list [2], fmt_tim [1], fmt_tim [2], get_info [1], get_info [2], get_info [3]
	get_info [4], get_yo_dates [1], get_yo_dates [2], get_yo_dates [3]
	match_index [1], match_index [2], rd_roadmap [1], sel_timrange [1]
	sel_timrange [2], ssw_deltat, ut_time [1], ut_time [2]
   Common Blocks:
      sel_leak_image	 (files & roadmaps)
      sel_leak_image1   (index records)


sel_leak_image [4] $SSW/yohkoh/sxt/idl/util/sel_leak_image.pro
[Previous] [Next]
NAME:
	sel_leak_image
PURPOSE:
	Select the proper leak image required for correction
INPUT:
	item	- Index or roadmap
OUTPUT:
	leak_files- The names of the leak files
	dsets	- It is the same length as "item".  The value is -1 if 
		  no leak image is available.
 CALLED BY:
	get_leak_image [1], get_leak_image [2], get_leak_image [3], leak_sub [1]
	leak_sub [2], leak_sub [3], sxt_prep [1], sxt_prep [2], sxt_prep [3]
HISTORY:
	Written 27-Aug-93 by M.Morrison
	13-Sep-93 (MDM) - Replaced Al.1 Oct-92 image file sfc921127.0947;			  with sfc921125.1708 (actually the same image, 
			  the previous file had the wrong index/label).
	15-Sep-93 (MDM) - Modified the logic so that a ND leak image
			  is not used to correct an OPEN x-ray image.
			- Added 5 leak images which used ND filter
	19-Nov-93 (MDM) - Modification to not even bother checking for
			  SFC files if data is pre-Nov-92.
       10-Dec-94 (SLF) - major rewrite - add hook for pointing
			  (use match_index.pro for image selection)
                         (no explicit file names - check all matching SFC)
        3-Jan-94 (SLF) - pre-define output for pre-Nov-1992 data
       22-aug-95 (SLF) - check "leak era" and select appropriate image
	19-Apr-96 (GLS) - Corrected a bug in the assignment of indices to
			  DSETS from the values returned by MATCH_INDEX.
			- Corrected 'No leak image' warning code
       11-oct-96 (SLF) - add /ccdtemp switch to match_index call

 CALLS: ***
	BOX_MESSAGE, RD_SDA [1], RD_SDA [2], RD_SDA [3], Rd_Roadmap [2], file_list [1]
	file_list [2], fmt_tim [1], fmt_tim [2], get_info [1], get_info [2], get_info [3]
	get_info [4], get_yo_dates [1], get_yo_dates [2], get_yo_dates [3]
	match_index [1], match_index [2], rd_roadmap [1], sel_timrange [1]
	sel_timrange [2], ssw_deltat, ut_time [1], ut_time [2]
   Common Blocks:
      sel_leak_image	 (files & roadmaps)
      sel_leak_image1   (index records)


Sel_QS $SSW/yohkoh/gen/idl/ref_access/sel_qs.pro
[Previous] [Next]
Name:
	Sel_QS
Purpose:
	Given a time, return the indicie for the QS that was valid
	for that time.
Input:
	struct	- The QS structure to find the valid time for
	intim   - A structure that has .TIME and .DAY fields
Output:
	Subscript of the QS record that should be used.  If there
	is no record with a valid time range, a -1 is returned.
 CALLED BY:
	ANAL_BCS_PHA, ANAL_STIMS
Example:
	ss = sel_qs(qs.instr, index(10).gen)
	ss = sel_qs(qs.instr, roadmap(1000))
	ss = sel_qs(qs.general1, roadmap)
History:
	Written Fall '91 by M.Morrison


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


       PURPOSE: To allow interactive selection of a rectangular region.


       METHOD: In input display the image (if not already displayed),
		display it, rebined by a integer factor if desired, and
		then call GET_BOXCORN. The units are in inout image pixels.
		If the image is passed in then a new window is opened and
		later closed.  

       CALLING SEQUENCE: xyvec=sel_region([image][,factor][,/close][,/table])


       PARAMETERS:	image	image you want to select region from.
			factor  a multiplication factor for display, INT.

       KEYWORDS:  	close	close the display window when finished. This only
				works you passed in the image.
			table	query for color table change 

	CALLS: ***
	GET_BOXCORN, XLOADCT [1], XLOADCT [2], XLOADCT [3], draw_boxcorn [1]
	draw_boxcorn [2], new_win, yesnox [1], yesnox [2]
       HISTORY: Drafted by A.Mcallister, mar-18-93.


SELECT_24HR $SSW/yohkoh/ucon/idl/bentley/select_24hr.pro
[Previous] [Next]
 NAME:
	SELECT_24HR
 PURPOSE:
	Uses cursors to select an interval on the 24hr/4 panel plot
 CALLING SEQUENCE:  
	SELECT_24HR,range
 INPUTS:

 OUTPUTS:
	range	7*2 element time array contains start and stop times
		this is compatible with RUN_MKBSD
 OPTIONAL OUTPUTS:

 CALLS: ***
	CURSOR_4X6HR, Int2Ex [1], Int2Ex [2], fid2ex [1], fid2ex [2], fmt_tim [1]
	fmt_tim [2], wfile
 RESTRICTIONS:

 PROCEDURE:

 MODIFICATION HISTORY:
	RDB	06-Aug-93


SELECT_24HR_PLOT $SSW/yohkoh/ucon/idl/bentley/select_24hr_plot.pro
[Previous] [Next]
 NAME:
	SELECT_24HR_PLOT
 PURPOSE:
	Uses cursors to select an interval on the 24hr/4 panel plot
 CALLING SEQUENCE:  
	.run SELECT_24HR_PLOT
 INPUTS:

 OUTPUTS:
	itime	7*2 element time array contains start and stop times
		this is compatible with RUN_MKBSD
 OPTIONAL OUTPUTS:

 RESTRICTIONS:

 PROCEDURE:

 MODIFICATION HISTORY:
	RDB	16-Jun-92


SELECT_BDA $SSW/yohkoh/bcs/idl/bda/select_bda.pro
[Previous] [Next]
 NAME:
	SELECT_BDA
 PURPOSE:
	Plots light curve of Ca XIX and allows user to select data set
	using the cursors. SS vector is created for use with TEST_RD
 CALLING SEQUENCE:  
	IDL> .run select_bda
 INPUT:

 OUTPUT:

 OPTIONAL OUTPUT:

 HISTORY
	RDB	Oct 1991	Written, with enhancements
	RDB	16-Feb-1992	Updated for multiple files
	rdb	26-Feb-1992	Some tidying; added YOHKOH_EVENTS stuff
				Reads selected data if required
	rdb	20-Mar-92	Null out PLOTR array (to stop confusion 
				if set in TEST_RD)
	rdb	17-Jul-92	Changed DSET_ARR to DSET_STR


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

       PURPOSE:  To select a point from a displayed image, and mark the
		  location if requested

	METHOD: This will mark a series of points and return their coordinates.
		Using the left button simply marks the points, using the middle
		button marks and saves the point, and the right button exits. 		 		 

       CALLING SEQUENCE: selpnt,x,y,/quiet,/mark

       PARAMETERS:	xy		return the point locations (can be
					a vector)

	KEYWORDS:	quiet		when set don't print mouse intructions
			mark		when set mark the location	

 CALLED BY:
	dejitter
       HISTORY: Drafted AMcA, Nov. 1994.
		 Use DUM variable to buffer against XY being already 
		 defined, AMcA, 11-17-94.
		 Corrected the background testing for image boundaries, AMcA, Mar. 1995.
		 


selsis_copy [1] $SSW/yohkoh/gen/idl/atest/selsis_copy.pro
[Previous] [Next]
   Name: selsis_copy

   Purpose: copy (via ftp) daily selsis activity, event  files 
   	     for specified date (most recent by default)

   Input Parameters:
      idate - date (UT) to copy

   Keyword Parameters:
      recopy - if set, force recopy of existing files
               (default is no recopy)

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], anytim2ex [1]
	anytim2ex [2], anytim2ints [1], anytim2ints [2], concat_dir [4], ex2fid [1]
	ex2fid [2], file_exist [1], file_exist [3], ftp_copy [1], ftp_copy [2]
	get_logenv [1], get_logenv [2], gt_day [1], gt_day [2], str_replace [1]
	str_replace [2], timegrid, ut_time [1], ut_time [2]
 CALLED BY:
	selsis_week
   History: mdm, 1992
       18-sep-92 (SLF) - added xray plot and environmental path references
	14-May-93 (MDM) - Changed to use $ydb_raw and $ys
       26-May-93 (MDM) - Changed to use /ys/site/script instead of /ys/gen/script
	19-Aug-93 (MDM) - Removed /SELF switch from mail command
	30-Aug-93 (MDM) - Had Regions file copy when /XRONLY switch is set (need
			  to get it earlier)
       22-Aug-93 (SLF) - use [max91] for regions also (problem with SESC)
	 3-Jan-94 (MDM) - Modified mailing list
       10-apr-95 (SLF) - use SELSIS_FTP_NODE environmental - cleanup/file_append
       12-apr-95 (SLF) - major rewrite to use ftp_copy (for selsis reorganization)
       28-apr-95 (SLF) - add RECOPY keyword and function
        5-oct-95 (SLF) - removed X-Ray plot references (now averging 3 sec data)
        2-dec-96 (SLF) - SEL event file format/name change updates
       13-Jan-2000 (SLF) - Y2K filename fix (use time2file)
        5-May-2002 (SLF) - use YYYY_events instead of events 
                           (appears to be updated first at SEC)
       13-nov-2002 (SLF) - major rewrite to use Mirror;
                           (and transportable)


selsis_copy [2] $SSW/yohkoh/gen/idl/gbo/selsis_copy.pro
[Previous] [Next]
   Name: selsis_copy

   Purpose: copy (via ftp) daily selsis activity, event  files 
   	     for specified date (most recent by default)

   Input Parameters:
      idate - date (UT) to copy

   Keyword Parameters:
      recopy - if set, force recopy of existing files
               (default is no recopy)

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], anytim2ex [1]
	anytim2ex [2], anytim2ints [1], anytim2ints [2], concat_dir [4], ex2fid [1]
	ex2fid [2], file_exist [1], file_exist [3], ftp_copy [1], ftp_copy [2]
	get_logenv [1], get_logenv [2], gt_day [1], gt_day [2], str_replace [1]
	str_replace [2], timegrid, ut_time [1], ut_time [2]
 CALLED BY:
	selsis_week
   History: mdm, 1992
       18-sep-92 (SLF) - added xray plot and environmental path references
	14-May-93 (MDM) - Changed to use $ydb_raw and $ys
       26-May-93 (MDM) - Changed to use /ys/site/script instead of /ys/gen/script
	19-Aug-93 (MDM) - Removed /SELF switch from mail command
	30-Aug-93 (MDM) - Had Regions file copy when /XRONLY switch is set (need
			  to get it earlier)
       22-Aug-93 (SLF) - use [max91] for regions also (problem with SESC)
	 3-Jan-94 (MDM) - Modified mailing list
       10-apr-95 (SLF) - use SELSIS_FTP_NODE environmental - cleanup/file_append
       12-apr-95 (SLF) - major rewrite to use ftp_copy (for selsis reorganization)
       28-apr-95 (SLF) - add RECOPY keyword and function
        5-oct-95 (SLF) - removed X-Ray plot references (now averging 3 sec data)
        2-dec-96 (SLF) - SEL event file format/name change updates


selsis_week $SSW/yohkoh/gen/idl/gbo/selsis_week.pro
[Previous] [Next]
   Name: selsis_week

   Purpose: copy up to a week of selsis data and generate/regenerate ydb files

   Input Parameters
      week - week (string in format YY_WW) (default is this week)

 CALLS: ***
	anytim2weekid [1], anytim2weekid [2], int2secarr [1], int2secarr [2]
	pr_week2tim [1], pr_week2tim [2], selsis_copy [1], selsis_copy [2]
	str_replace [1], str_replace [2], timegrid, ut_time [1], ut_time [2]
   History:
      27-apr-95 (SLF) - simplify catchup
      31-may-95 (SLF) - strip 'a' from weekid name (was getting duplicated)


selsisi2fits $SSW/yohkoh/gen/idl/gbo/selsisi2fits.pro
[Previous] [Next]
NAME:
	selsisi2fits
PURPOSE:
	Take a SELSIS file and write a FITS file output
INPUT:
	infil	- a list of files in SELSIS format
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], FIND_GBO_DIR
	concat_dir [4], file_exist [1], file_exist [3], rd_selsisi, wrt_fits [1]
	wrt_fits [2]
OPTIONAL KEYWORD INPUT:
	delete	- if set, delete the SELSIS format file after
		  the FITS file is created
	auto_dir- if set, call FIND_GBO_DIR to figure out which
		  output directory to use
HISTORY:
	Written 16-Jul-92 by M.Morrison
	13-Oct-92 (MDM) - Modified to check if the call to "rd_selsisi"
			  was successful.
	27-Jan-93 (MDM) - Added /AUTO_DIR option, and using FIND_GBO_DIR
			- Also change protection to 666
       19-Aug-93 (MDM) - Removed /self switch from Mail call
	 3-Jan-93 (MDM) - Removed mail message on "non-copies"


selsisi_copy $SSW/yohkoh/gen/idl/gbo/selsisi_copy.pro
[Previous] [Next]

   Name: selsisi_copy
   
   Purpose: copy selsis image files

       14-May-93 (MDM) - Changed to use $ydb_raw and $ys
       26-May-93 (MDM0 - Changed to use /ys/site/script instead of /ys/gen/script
       19-Aug-93 (MDM) - Removed /self switch from Mail call
	 3-Jan-94 (MDM) - Modified the mailing list
	29-Apr-94 (SLF) - Major Rewrite 
			     change logic (allow PARTIAL success to continue)
                            look for compressed versions if failures
                            streamline using new routines
        3-May-94 (SLF) - retry on failure for '_Z' extension, use updated
                         ftp_copy.pro for all transfers, allow imgfil passed
       16-May-94 (SLF) - directory error bug fix (message called with array)
       19-May-94 (SLF) - mail message update
       23-May-94 (SLF) - fix incorrect variable name
       30-Aug-94 (SLF) - add fl_suntoday call (collage image)

 CALLS:


seq_2fl $SSW/yohkoh/ucon/idl/mctiernan/seq_2fl.pro
[Previous] [Next]
 NAME:
	seq_2fl
 PURPOSE:
	To get two sets of matched subscripts for temperature measurments
       Do Not try to used this on data that has already been SXT_PREPPED.
 CALLING SEQUENCE:
	seq_2fl,index,fb1,fb2,subs1,subs2
 INPUT:
	index= info. structure for SXT data from test_rd
	fb1,fb2= filter numbers for the two filters,
	fb=1 for open, 2 for al1400, 3 for DAG, 4 for Be100, 5 for Al12, 
	and 6 for mg3mu. 
 OUTPUT:
	subs1,subs2= subscripts of the two sets of images, which
	have the proper filters, and are in the same sequence loops.
 CALLS: ***
	gt_dp_mode [1], gt_dp_mode [2], gt_expdur [1], gt_expdur [2], gt_filtb
 CALLED BY:
	sxt_fl_analxpro, sxt_tfl, sxt_tflx, sxtbox_teem
 HISTORY:
	Written Sept. '92 by J.McTiernan
       Some error checking, jmm, 2/15/95


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

   Purpose: return data set array for given sxt sequence serial number

   Input Parameters:
      	rmap = sxt roadmap or sxt index record
   	which = desired data set - the interpretation is:
	   	relative data set if absolute not set
		absoulute data set if absolute keyword is set
	absolute = if set, then returned data set corresponds to the
	    	 absolute serial number - otherwise, returned data set
	 	 vector corresponds to relative serial number 
   Output:
	function return value is requested data set vector
		a return value of -1 indicates requested data set is
		out of range 
	range (optional key word) 2 element vector containing first and
		last serial numbers - absolute or relative depending upon the
	   	state of the absolute keyword
	 

 CALLS:
 CALLED BY
	save_data [2], sda_look [1]


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

 PURPOSE: To reset the background in optical images, or get a background 
          bitmask. Also return a mask of prominance features.

 METHOD: Uses DSK_LOCB to find the radii, tests the corner for the 
         current background value (returned from DSK_LOCB) and adjusts
	  all pixels that above the limb. Keywords allow you to return a 
	  mask for above limb features, and exclude "features" well over 
         the limb. 


 CALLING SEQUENCE:  

	out=set_back(image[,trgt=target][,back=background][,bakmsk=mask]
			                [,prom=prom][,margin=margin])

 PARAMETERS:	image   the input GBO image, also the output.
		out	the same image with a reset backgorund.

 KEYWORDS:	back    option to pass in the background value
			the default is the minimum value in image.
		trgt    option to pass in the centroid & radius if
			it is already known, in pixels.
		bakmsk  option to return a mask of (0 & 1) indicating 
			the background pixels.
		prom    bits for all bright pixels over the limb.
		margin  option to zero prom for more than a set number 
			of pixels above the limb. 

 RETURN TYPE: Same as the input.

 CALLS: ***
	TARGET [1], cut_lev, r_coord, target [2]
 CALLED BY:
	rm_darklimb, rt_hdha, rt_mag, sxt_mk3 mk3 index data [1]
	sxt_mk3 mk3 index data [2], wl_process
 HISTORY: Drafted dec-92 by A. McAllister.
 	   Added margin keyword, feb-93 AMcA.
	   Added prom keyword, redefined bakmsk keyword, mar-93 AMcA.
	   Trapped all the WHERE index statments, jan-94 AMcA.


set_datatype $SSW/yohkoh/ucon/idl/linford/set_datatype.pro
[Previous] [Next]
	NAME: set_datatype
	PURPOSE: convert input data "dat" to specified data-type.
	CALL SEQUENCE:
		new_data = set_datatype( data_type, data)
	where:
		data_type 	is the requested returned data-type
		data		is the input data

	INPUT:
		data_type	requested returned data-type
		data		input data
	Returned:
		new_data	input data type casted to the requested
				data-type
				returns a 0 if unable to cast input data.
	NOTE: when casting from byte to string, small byte values will
		be converted to ASCII control chars. If this is not
		the desired result, first convert byte to int then to
		string.
	History: written 11-April-94, gal.


SET_IMGVAL $SSW/yohkoh/ucon/idl/sakao/set_imgval.pro
[Previous] [Next]
 NAME:
	SET_IMGVAL
 PURPOSE:
	The same function as the SCALE option of RFITS. I did nothing other 
	than copying the necessary part from RFITS !
 CALLING SEQUENCE:
	imgval = SET_IMGVAL(data, head)
 INPUT:
	data	- Image array read by RFITS WITHOUT the SCALE option.
	head	- FITS header read by RFITS.
 OUTPUT:
	imgval	- Image array with scaled values.
 SIDE EFFECT:
	none
 CATEGORY:
	Yohkoh HXT data analysis.
 HISTORY:
	version 1.0	98.07.01 (Wed)	T.Sakao written.


SET_MWLT $SSW/yohkoh/ucon/idl/wuelser/set_mwlt.pro
[Previous] [Next]
NAME:
       SET_MWLT
PURPOSE:
       Interactively define reference points in an image and a (full-sun)
       reference image.  These points can be used to calculate a linear
       transform which maps image a onto the (full-sun) reference image imb.

       This special version of SETPTS is used to co-align active region
       data with a full-sun image.  First, both images are desplayed at full
       size, and the user is asked to click the region of interest in the
       full sun image.  Then a partial image is used to enter the reference
       points.
       After the points have been entered, image ima is transformed and
       displayed with contours on top of image imb.
CATEGORY:
       Image processing.
CALLING SEQUENCE:
       set_mwlt,p,ima,imr
INPUTS:
       ima = image to be transformed.
       imr = (full-sun) reference image.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
       subsize = integer.  Pixelsize of subimage to be used as reference.
                 Default = 100, corresponds to about 4 arcmin in new MWLT.
       plotonly = flag. If this keyword parameter is present, no new points
                  are added to p, but the result of the linear transform is
                  displayed.
       noscale = flag.  If present, the image is displayed unscaled.
       append = flag.  If present, new points are appended to p if p exists
                and contains points.  The default is to discard old points.
       key = transformation type.  See "transtype" keyword in CALTRANS for
             details.  Default is a general linear transform.
OUTPUTS:
       p = array(2,2,*). p(0,0,*) and p(1,0,*) are the x and y coordinates
           of the points in the reference image imb. p(0,1,*) and p(1,1,*)
           are the x and y cordinates of the same points in the image ima.
OPTIONAL (KEYWORD) OUTPUT PARAMETERS:
       trima = transformed version of ima
 CALLS: ***
	SETPTS [1], SETPTS [2]
COMMON BLOCKS:
       None.
SIDE EFFECTS:
       The program creates a new graphics window.
       After entering the procedure, follow the instructions printed
       on the terminal.
RESTRICTIONS:
       The image has to be 2-dimensional.
       The program uses device coordinates.
MODIFICATION HISTORY:
       JPW, 25-mar-94  from setpts and setzoom
       JPW, 22-nov-94  put "key" back in, minor modif.


set_new_db $SSW/yohkoh/sxt/idl/util/set_new_db.pro
[Previous] [Next]
NAME:
	set_new_db
PURPOSE:
	To redirect to a new dark or leak image data base
SAMPLE CALLING SEQUENCE:
	set_nev_db, newdir
	set_new_db, '/0p/acton/new_db', /dark
	set_new_db, '/0p/acton/new_db', /leak
	set_new_db, /reset, /dark
	set_new_db, /reset, /leak
INPUT:
	newdir	- The directory where the new database file will
		  reside
 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], delvarx [5]
 CALLED BY:
	sxt_prep [1], sxt_prep [2], sxt_prep [3]
OPTIONAL KEYWORD INPUT:
	reset	- Go back to using the old standard directory
METHOD:
	1. Create a file with the dark and leak images you wish
	   to use.  The prefix for the file MUST BE:
		sdc	- for dark images
		sfc	- for leak images
	   * There can be multiple files.  **ALL** files with that prefix
	     in that new directory are checked for the best match
	   * NONE of the standard dark or leak images are checked if
	     you use this new option (ie: you must have ALL of the dark
	     images you want in your off-line dark/leak image file).
	     Extract images from the standard SDC set and put them into
	     your off-line set if you need them
	2. Redirect the environment variables to point to your offline
	   area by calling SET_NEW_DB.  The routine deletes the common
	   block saved info so that it is re-built on the next DARK
	   or LEAK call.  This takes many seconds for the DARK calls
	   so swapping back and forth between official and off-line
	   databases will be very slow.
	3. Run SXT_PREP and/or LEAK_SUB and/or DARK_SUB
	4. To return to using the original official database, use the
	   /RESET option on the SET_NEW_DB command.  This assumes that
	   you had not done a SETENV outside of this routine.
EXAMPLE:
	The following is an example of how to use PFIs for the source
	dark frames.  CAUTION: If the ROI location on the CCD changes,
	the DARK_SUB routine will probably not choose the optimal
	pointing dark frame (it chooses the closest in TIME)
		infil = /yd5/flares/spr930625.0131
		rd_roadmap, infil, rmap
		ss = where(gt_expmode(rmap) eq 1)
		rd_xda, infil, ss, ii, dd
		--- Note: You can average the dark images before saving if desired
		sav_sda, '/yd3/morrison/newdb/sdc_test2', ii, dd
		set_new_db, '/yd3/morrison/newdb'
		ss = where((gt_dp_mode(rmap) eq 13) and (gt_filtb(rmap) eq 2))
		rd_xda, infil, ss, index, data
		sxt_prep, index, data, index2, data2
HISTORY:
	Written 15-May-95 by M.Morrison


SET_PAPER $SSW/yohkoh/ucon/idl/sakao/set_paper.pro
[Previous] [Next]
 NAME:
	SET_PAPER
 PURPOSE:
	To setup PostScript output format. 
 CALLING SEQUENCE:
	SET_PAPER
	SET_PAPER, /landscape, /encapsulated
	SET_PAPER, /square
	SET_PAPER, /helvetica 
 INPUT:
	none
 CALLED BY:
	GOES_TODAY
 OPTIONAL KEYWORD INPUT:
	landscape	- If set, then the output is in landscape format. 
	default		- If set, then the output plot has the default size. 
	encapsulated	- If set, then an encapsulated output is created. 
	filename	- Specifies output filename. Default = 'idl.ps'.
	color		- If set, then the output is a color PostScript file. 
	square		- If set, then the output graph has an equal length 
			  for the X/Y axes. Note that this option is yet 
			  valid only for a portrait output. 
	courier		- Same as the one for DEVICE procedure. 
	helvetica	- 		"
	times		- 		"
	symbol		-		"
	italic		-		"
 OUTPUT:
	none
 NOTE:

            yoffset       |
     |--------------------|
                          |      
     |-----------------|  |      |
     |   Landscape     |  |      | Y
     |                 |  |      |
 --  |-----------------|  |  <---> X
  | xoffset               |
 -------------------------|

 SIDE EFFECT:
	A PostScript output file is created. 
 HISTORY:
	version 1.0	92.08.12 (Wed)	T.Sakao written.
	version 1.1	93.08.23 (Mon)
		Option /portrait is specified if /landscape option is absent. 
	version 1.2	94.06.24 (Thu)
		Option /default is added.
	version 1.3	96.02.13 (Tue)
		Option encapsulated added. 
		Added documentation. 
	version 1.4	96.02.27 (Tue)
		Option color added. 
	version 1.5	96.06.14 (Fri)
		Option filename added. 
	version 1.6	96.10.29 (Tue)
		Option square added.
	version 1.8	97.02.05 (Wed)
		Options courier, helvetica, times, symbol, and italic added. 
		Note that these options may not yet work. They are just 
		temporary. 
	version 1.9	97.11.01 (Sat)
		Print size in calling a Lanscape output was changed. 
		'NOTE' description added.
	version 2.0	98.02.17 (Tue)
		Y-offset value for making a square output was added. This is 
		for printing the output at the right position even on a U.S.- 
		sized paper. (Modified at GSFC.)


SET_PS $SSW/yohkoh/ucon/idl/kano/set_ps.pro
[Previous] [Next]
NAME:
       SET_PS
pro set_ps,noPSfont=noPSfont,cm=cm $
	,land=land,wland=wland,sland=sland $
	,tall=tall,wtall=wtall,stall=stall $
	,close=close,filename=filename,color=color,lcolor=lcolor,check=check $
	,noname=noname,noprint=noprint,title=title,t_size=t_size


PURPOSE:
 	Set up PostScript device

CATEGORY:

CALLING SEQUENCE:
	To open a PS file,
		SET_PS  [, /land, filename='idl2.ps', cm=cm]
	and then to close the PS file
		SET_PS, /close [, filename='idl2.ps']
INPUTS:
	None.
KEYWORD PARAMETERS:
       land :	landscape       (24.13 x 17.78cm)
       wland:	wider landscape (28    x 19   cm)
       sland:	square landscape(17.5  x 17.5 cm)
       tall :	tall portrait   (17    x 20   cm)
       wtall:	taller portrait (19    x 28   cm)
       stall:	square portrait (17.5  x 17.5 cm)
	  default paper size is (17.78 x 12.7 cm).

    filename:	output filename (default='~/idl.ps')
       close:	close PostScript device and return to X-window

       color:	set up Color PostScript device
      lcolor:	the default color of lines (default=0 in PS-device)
    noPSfont:	use the IDL fonts (default= using PS fonts)
       check:	display the device parameters !d at the begining
		and display the PostScript file by "gs" at the end
      noname:	if not, user name and system time are printed 
		at the lower-left corner on the last page.
       title:	print title at the upper-right and lower-right.
		It must be a scalar or a 2-element vector.
      t_size:	set up the size of title characters
OUTPUT KEYWORD:
       cm   :	pixels/cm (1000 in PS, 40 in X)
 CALLS: ***
	get_user [1], get_user [2]
MODIFICATION HISTORY:
	21-Mar-95	R.Kano	entried into local software library
	11-May-96	R.Kano	add the users signiture and date
	21-Feb-97	R.Kano	add an optional output 'cm'
	10-Mar-97	R.Kano	not to use 'lprint'
	18-Apr-97	R.Kano	add the square window 'sland' & 'stall'
	28-May-97	R.Kano	add an optional input 'title' & 't_size'
REFERENCE: none


set_xform [1] $SSW/yohkoh/ucon/idl/leka/set_xform.pro
[Previous] [Next]

PRO xform, xi,yi,zi, xo,yo,zo, TRANSFORM=t, HELP=help

 Apply transformation set up by function set_xform.
 Keyword TRANSFORM supplies the transformation matrix, e.g.
   TRANSFORM=xf.helio2image.
 See set_xform for full documentation on the coordinate systems.
 Helio2image = heliographic to image-plane.
 Image2helio = image-plane to heliographic.
 These can be applied to coordinates, magnetic fields, velocities, ...
 Zimage2helio = image-plane xi,yi to heliographic xh,yh, with the point
 referred to by xi,yi understood to lie on the photosphere i.e. zh=0.
 The suppressed zi is nonzero. This transformation matrix is 2x2, whereas
 the others are 3x3.

 The following forms are accepted if TRANSFORM is helio2image or image2helio:
 xform,xyz		; replace the vector xyz=FLTARR(...,3)
			; by the transformed vector.
 xform,xyzi,xyzo	; transform the vector xyz=FLTARR(...,3) and return
			; the result in xyzo=FLTARR(...,3).
 xform,x,y,z		; replace the components x,y,z, which can be of arb.
			; dimensions, by the transformed components.
 xform,xi,yi,zi,xo,yo,zo ; transform the components xi,yi,zi, which can be
			; of arb. dimensions, and return the resulting
			; components in xo,yo,zo.

 The following forms are accepted if TRANSFORM is a zimage2helio matrix:
 xform,xy
 xform,xyi,xyo
 xform,x,y
 xform.xi,yi,xo,yo
 These are analogous to above, but the vectors are FLTARR(...,2).
 CALLS:
 CALLED BY
	get_helio_dist


set_xform [2] $SSW/yohkoh/ucon/idl/leka/set_xform.pro
[Previous] [Next]

FUNCTION set_xform, b0,p,bc,lc, HELP=help

 Calculate and store transformation between image-plane and heliographic
 coordinates and various other useful info. Tranformations are linear,
 assuming a tangent plane on the photosphere at the reference point.
 Thus the reference point should be the center of the FOV.

 INPUT:
	b0	solar sub-Earth latitude (radians)
	p	solar p-angle (radians)
	bc	latitude of reference point on photosphere (radians)
	lc	cmd of reference point on photosphere (radians)
 OUTPUT:
	xf	a structure containing the information --

 transformations --
 xf.helio2image	; Heliographic xh,yh,zh -> image-plane xi,yi,zi.
			; FLTARR(3,3).
 xf.image2helio	; Image-plane xi,yi,zi -> heliographic xh,yh,zh.
			; FLTARR(3,3).
 xf.zimage2helio	; Image-plane xi,yi -> heliographic xh,yh.
			; ASSUMING (the unobserved) zi is such that zh=0 i.e.
			; the observed image lies in the photospheric plane.
			; FLTARR(2,2).
 *NOTE*NOTE**NOTE*	These arrays are stored transposed so that "normal"
 *NOTE*NOTE**NOTE*	matrix arithmetic works as expected, e.g.
 *NOTE*NOTE**NOTE*		B_i = xf.helio2image # B_h
 *NOTE*NOTE**NOTE*	"PRINT,xf.helio2image" will print it transposed too.

 ; useful things to know --
 xf.b0			; Solar latitude of sub-Earth point (radians).
 xf.p			; Solar p-angle (radians).
 xf.bc			; Latitude of center of FOV (radians).
 xf.lc			; Cmd of center of FOV (radians).
 xf.DirCos		; Direction cosines of LOS relative to helio xh,yh,zh
 			; coordinate system in radians (FLTARR(3)).
 xf.mu			; Cos(angle from disk centre) in radians.
 xf.SolRad		; Solar radius in Mm (megametres).
 xf.Mm2arcsec		; Mm on photosphere -> arcsec at Sun.
 xf.Mm2radian		; Mm on photosphere -> radians of CMD or latitude.
 xf.arcsec2Mm		; Arcsec at Sun -> Mm on photosphere.
 xf.radian2Mm		; Radians of CMD or latitude -> Mm on photosphere.

 DEFINITION OF COORDINATE SYSTEMS:
 xh,yh,zh	Heliographic coordinates. zh is normal to the photosphere
 		(actually the tangent plane).  xh in Westerly (+ve CMD)
 		direction, yh in Northerly (+ve latitude) direction.
 xi,yi,zi	Position in image plane.  xi is terrestrial West, yi is
		terrestrial North.  zi is distance towards observer from
		the image plane, where the origin (xi=0,yi=0,zi=0) of
		the image plane touches the photosphere.
		Could be generalized for images not oriented to terrestrial
		North/West.

 It is not really necessary to store the 3 transformations in xf.
 helio2image and image2helio are inverses of each other; since the
 transformations are unitary? orthogonal? or something one is just
 the transpose of the other. Also, zimage2helio can be bypassed by
 computing the zi needed to make zh=0, given xi, yi, and image2helio,
 then using these xi,yi,zi to compute xh,yh,zh given image2helio.
 However, they are stored for generality.
 Clearly there is duplication among the constants too, specifically
 radian2Mm == SolRad == 1/Mm2radian. and arcsec2Mm = 1/Mm2arcsec.

 USAGE EXAMPLES:

 ; Get heliographic coordinates of observation points (pixels) on photosphere
 ; in Mm given pixel positions in arcsec.
 xyzh=FLTARR(Nx,Ny,3) & FOR i=0,Nx-1 DO FOR j=0,Ny-1 DO $
	xyzh(i,j,0:1) =  xf.arcsec2Mm * xf.zimage2helio # [xi(i,j),yi(i,j)]

 ; Compute noise on Bx assuming 15G error in LOS field and 150G error
 ; in transverse field.
 dBx = SQRT( xf.dircos(0)^2*15.0^2 + (1-xf.dircos(0)^2)*150.0^2 )

 ; Get area of pixel projected on photosphere in Mm^2, given pixel
 ; dimension pxl in arcsec.
 area = (pxl*xf.arcsec2Mm)^2/xf.mu
 CALLS:
 CALLED BY
	get_helio_dist


SET_XHR $SSW/yohkoh/ucon/idl/bentley/set_xhr.pro
[Previous] [Next]
 NAME:
	SET_XHR
 PURPOSE:
	Returns time limits of plots using PLOTR array derived from 
	PLOT_LCUR call in TEST_RD.
 CALLING SEQUENCE:  
	set_xhr,roadmap,plotr [,x_hr_range=x_hr_range][,tarr=tarr]
 INPUTS:
	roadmap		structure containing roadmap of data in file
	plotr		subscripts in roadmap of last plot in PLOT_LCUR
 OUTPUTS:

 OPTIONAL OUTPUTS:
	x_hr_range	If keyword present, array returned
			Limits are rounded to nearest 0.1 hrs.
	tarr		If preset, the times are returned as a 7*2 
			integer time array in external format
 CALLS: ***
	Int2Ex [1], Int2Ex [2]
 RESTRICTIONS:

 PROCEDURE:

 MODIFICATION HISTORY:
	RDB	21-Mar-92
	RDB	25-Mar-92	Added TARR keyword


SETPTS [2] $SSW/yohkoh/gen/idl/gbo/setpts.pro
[Previous] [Next]
NAME:
       SETPTS
PURPOSE:
       Interactively define reference points in two images.
       These points can be used to calculate a linear transform which maps
       image ima onto the comparison image imb.
       After the points have been entered, image ima is transformed and
       displayed with contours on top of image imb.
CATEGORY:
       Image processing.
CALLING SEQUENCE:
       setpts, p, ima, imr
INPUTS:
       ima = image to be transformed.
       imr = reference image.
             Usually, the lower resolution image is selected to be image ima.
OPTIONAL (KEYWORD) INPUT PARAMETERS:
       plotonly = flag. If this keyword parameter is present, no new points
                  are added to p, but the result of the linear transform is
                  displayed.
       noscale = flag.  If present, the images are displayed unscaled.
       append = flag.  If present, new points are appended to p if p exists
                and contains points.  The default is to discard old points.
       trima = transformed image ima.
       key = transformation type.  See "transtype" keyword in CALTRANS for
             details.  Default is a general linear transform.
OUTPUTS:
       p = array(2,2,*). p(0,0,*) and p(1,0,*) are the x and y coordinates
           of the points in the reference image imb. p(0,1,*) and p(1,1,*)
           are the x and y cordinates of the same points in the image ima.
OPTIONAL (KEYWORD) OUTPUT PARAMETERS:
       trima = transformed version of ima
 CALLS: ***
	CALTRANS, CONGRID [1], CONGRID [2], CONGRID [3]
 CALLED BY:
	SET_MWLT, setpts_roi
COMMON BLOCKS:
       None.
SIDE EFFECTS:
       The program creates a new graphics window.
       After entering the procedure, follow the instructions printed
       on the terminal.
RESTRICTIONS:
       The images have to be 2-dimensional. If one of the images is bigger
       than 512x512 pixels, only a part of the image can be displayed, and
       used to set points.
MODIFICATION HISTORY:
       JPW, Nov, 1989.
       JPW, Aug, 1992  most changes from version 1.1 (GLS) adopted
       JPW, Sep, 1992  added the noscale and append flags.
       JPW, Jun, 1994  points plotted also with /plotonly option
                       added key option
       JPW, Nov, 1994  fixed some minor glitches


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

   Purpose: check SFC directory for new entries - send mail if any found
   
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], FILE_EXIST [2], SFC_REPORT, break_file [4], concat_dir [4]
	file_append [1], file_append [2], file_exist [1], file_exist [3], file_list [1]
	file_list [2], get_logenv [1], get_logenv [2], mail [1], mail [2], rd_tfile [1]
	rd_tfile [2], rem_elem [1], rem_elem [2], search [1], search [2], strsplit
   Restrictions:
      UNIX only


sfc_de_spiker $SSW/yohkoh/ucon/idl/acton/sfc_de_spiker.pro
[Previous] [Next]
 NAME: 
   sfc_de_spiker
 PURPOSE: 
   Default mode return images with spikes and dark holes removed via 
   median filter.  
 CALLING SEQUENCE:
   clean_img = sfc_de_spiker(image, threshold, [indices=indices, width=width,
			average=average, pos=pos, neg=neg])
 INPUTS:
   image	- image array to clean (may be 2-d or 3-d)
   threshold 	- sets the threshold level for which all
		  spikes are removed.  Suggest using a value
		  of 10.  Really bright or dark spikes can be
		  removed with a higher value such as 20+.
 CALLS: ***
	IMAGE_FILTERER, spikes [1], spikes [2]
 CALLED BY:
	sfc_prep [1], sfc_prep [2]
 OPTIONAL KEYWORD INPUT:
   width	- set the width of the median filter (3 is default)
   average	- use average filter instead of median.
   pos		- remove spikes only.
   neg		- remove holes only. Note: threhold must be less than 0.

 RETURNED:
   cleaned image with the same size and data-type as input image
 OPTIONAL KEYWORD OUTPUT:
   indices	- list of indices to the located spikes and dark holes.
 PROCEDURE:
   This routine calls the idl function SPIKES.  
   The spikes and dark holes are identified via the following method:

     spike_indices = where(abs(image-median(image,width)) gt threshold)

     If neg is used than:
     spike_indices = where((image-median(image,width)) lt threshold)

 MODIFICATION HISTORY: 
   12-Jan-94, GAL, Written (replaced LWA's spikes_off routine)
   16-17 Mar-94, GAL, added code to handle decompressed images.
	added keywords to use upgraded version of spikes.
   11-April-94, gal, modified to preserve input data-type
   14-Apr-94, gal, modified to only sfd compress/decomp filter 
		spike/hole data for non-byte input.  The comp/decomp
		introduces about a 1% error to the filtered spike/hole
		data.
   20-Apr-94, gal, modified to only use sfd compression for finding
		spikes/holes in non-byte type data via spikes rountine.  
		The filter values used for replacement are not compressed 
		and are always generated via filter function.
   11-Dec-94, LWA, made from de-spiker by removing image compression.
   11-nov-96, SLF, changed call to <filter> to <image_filterer>


sfc_prep [1] $SSW/yohkoh/sxt/idl/atest/sfc_prep.pro
[Previous] [Next]
 NAME:
	sfc_prep
 PURPOSE
	To prepare a smoothed SFC image for straylight correction.
 CALLING SEQUENCE
	sfc_image = sfc_prep(sft_index,sft_data,image)
 INPUT
	sft_index   -index structure for selected SFT image
	sft_data    -selected SFT image
 OUTPUT
	Smoothed SFC image (floating point).
 OPTIONAL OUTPUT
	image	    - dark corrected input image
       index_out   - index of the dark corrected image
 Keyword Parameters:
   nogrill - switch, if set, do not apply Al.1 grill correction

 PROCEDURE
	1.  Dark_sub with /dc_intepolate
	2.  Smooth with SFC_DE_SPIKER (median filter)
	3.  Choose width for boxcar-average smoothing
	4.  Boxcar-average smooth with BIG_SMOOTH
 RESTRICTIONS
	Can only process one image at a time
	Slow -- takes about 1 minutes to process one image on MIPS machine.
	Calls LWA/ucon programs SFC_DE_SPIKER and BIG_SMOOTH.
 HISTORY
	LWA, 11-Dec-94  Written
	LWA, 18-Dec-94  Took out one despike and added variable
		smoothing width -- based on tests with Al.1
		and added image keyword
	LWA, 20-Dec-94, Added test for ND filter for smoothing.
	SLF, 18-nov-95, SLF, Add Al.1 grill correction per LWA
       NN,   7-Aug-97, Added index_out from dark_sub
       SLF, 18-Feb-98, Merged ORBIT_CORRECT SDC with NN changes
       SLF,  3-Dec-98, Use time dependent (entrance filter era)
                       dependent GRILL correction, add /TESTING
       SLF,  5-Jan-2000 - add NOGRILL keyword and function
 CALLS:
 CALLED BY
	mk_sfc [1], mk_sfc [2], sft2sfc


sfc_prep [2] $SSW/yohkoh/sxt/idl/util/sfc_prep.pro
[Previous] [Next]
 NAME:
	sfc_prep
 PURPOSE
	To prepare a smoothed SFC image for straylight correction.
 CALLING SEQUENCE
	sfc_image = sfc_prep(sft_index,sft_data,image)
 INPUT
	sft_index   -index structure for selected SFT image
	sft_data    -selected SFT image
 OUTPUT
	Smoothed SFC image (floating point).
 OPTIONAL OUTPUT
	image	    - dark corrected input image
       index_out   - index of the dark corrected image
 PROCEDURE
	1.  Dark_sub with /dc_intepolate
	2.  Smooth with SFC_DE_SPIKER (median filter)
	3.  Choose width for boxcar-average smoothing
	4.  Boxcar-average smooth with BIG_SMOOTH
 RESTRICTIONS
	Can only process one image at a time
	Slow -- takes about 1 minutes to process one image on MIPS machine.
	Calls LWA/ucon programs SFC_DE_SPIKER and BIG_SMOOTH.
 HISTORY
	LWA, 11-Dec-94  Written
	LWA, 18-Dec-94  Took out one despike and added variable
		smoothing width -- based on tests with Al.1
		and added image keyword
	LWA, 20-Dec-94, Added test for ND filter for smoothing.
	SLF, 18-nov-95, SLF, Add Al.1 grill correction per LWA
       NN,   7-Aug-97, Added index_out from dark_sub
       SLF, 18-Feb-98, Merged ORBIT_CORRECT SDC with NN changes
       SLF,  3-Dec-98, Use time dependent (entrance filter era)
                       dependent GRILL correction, add /TESTING
 CALLS:
 CALLED BY
	mk_sfc [1], mk_sfc [2], sft2sfc


SFD_CDS $SSW/yohkoh/ucon/idl/sxt_co/sfd_cds.pro
[Previous] [Next]
 NAME:
     SFD_CDS
 PURPOSE:
     overlay CDS or TRACE field of view on the most recent SFD
 CATEGORY: 
 CALLING SEQUENCE:
     sfd_cds, cds_cen, cds_fov
     sfd_cds, [0,0], [240,240] would be a standard CDS FOV at disk center
     sfd_cds, [-600,600], [314,314] puts an SXT 2x2 OR near the NE limb
     sfd_cds, cds_cen, cds_fov, /notv
     sfd_cds, trace_cen, /trace  ;puts 8.5x8.5 arcmin box at position
					given by trace_cen
 INPUTS:
     CDS parameters (see 
       http://sohodb.nascom.nasa.gov/synoptic/.targets/soho_today.html )
     
     CDS_CEN is x- and y-displacement of center of box from disk
	center, in arcseconds.
     CDS_FOV is [width,height] of box, in arcseconds.

     Defaults to Sun center and an SXT 2x2 FOV.

 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     NOTV, when set, lets you put another box on the same image
 OUTPUTS:
 CALLS: ***
	conv_a2p [1], conv_a2p [2], draw_boxcorn [1], draw_boxcorn [2], gt_pix_size
	gt_res, lastsfd [1], lastsfd [2]
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     24-Apr-97, HSH, written 
     01-jun-98, DMcK, corrected FOV by factor of 2
     06-oct-98, DMcK, added /trace switch for default TRACE FOV.
			Fixed too-small size of default SXT FOV.
			Enhanced previously obscure documentation.


sfd_comp $SSW/yohkoh/sxt/idl/util/sfd_comp.pro
[Previous] [Next]
	NAME: sfd_comp

	PURPOSE: Compress data using the "SFD" compression algorithm

	CALLING SEQUENCE:
		cdata = sfd_comp(data)
		cdata = sfd_comp(data, index=index)

	INPUT:
		data 	data to be compressed.
       OPTIONAL INPUT KEYWORD:
		index	The SXT index structure.
			If present, convert to DN/sec/HR pixel
	RETURNED/OUTPUT:
		compressed data

 CALLS: ***
	data_chk [1], data_chk [2], gt_expdur [1], gt_expdur [2], gt_res
 CALLED BY:
	RD_AR, azi_calc, azimuth_avg, de_spiker [1], de_spiker [2], mk_spd, mk_strip_file
	radial_avg, scat_avg, sector_avg, spikes_off, sxt_comp_sharp, sxt_composite [1]
	sxt_composite [2], sxt_composite [3], sxt_dstreek
	HISTORY:
		written 9-Dec-93 by M.Morrison
	24-jun-94, SLF+JRL, Added index=index keyword


sfd_decomp $SSW/yohkoh/sxt/idl/util/sfd_decomp.pro
[Previous] [Next]
							22-Oct-92
	NAME: sfd_decomp

	PURPOSE: Decompress sfd data.

	CALLING SEQUENCE:
		un_data = sfd_decomp(data)

	INPUT:
		data 	sfd data to be decompressed.

	RETURNED/OUTPUT:
		decompressed sfd data

 CALLED BY:
	FIRST_LIGHT [1], FIRST_LIGHT [2], LASTSFD_DIFF, RD_AR, RECONCILE_SFD_INFIL
	SFD_PHOT, agl2cut, mk_sl [1], mk_sl [2], mk_strip_file, rd_sxtgoes, sxl_analysis
	sxt_dstreek, sxt_prep [1], sxt_prep [2], sxt_prep [3], unsharp_mask
	HISTORY:
		written 22-Oct-92, gal


SFD_DIFF $SSW/yohkoh/ucon/idl/hudson/sfd_diff.pro
[Previous] [Next]
 NAME:
     SFD_DIFF
 PURPOSE:
     difference two SFR images
 CATEGORY:
     Yohkoh
 CALLING SEQUENCE:
     sfd_diff,index,data,i1,i2,img
 INPUTS:
     index and data from yodat
     selected pair of indices
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
     prepped and differenced images, [64,64,3]
 CALLS: ***
	POLY_FIT, sxt_prep [1], sxt_prep [2], sxt_prep [3]
 RESTRICTIONS:
 MODIFICATION HISTORY:
     HSH written 19-jun-94


SFD_PHOT $SSW/yohkoh/ucon/idl/hudson/sfd_phot.pro
[Previous] [Next]
 NAME:
       SFD_PHOT
 PURPOSE:
       restore SFD data cubes to 64x64xn for looking at global things
       registers images
 CALLING SEQUENCE
	sfd_phot, infil, rm, data_out, t1 = t1, t2 = t2, dag=dag, al=al
 INPUTS
	infil for SFD files
 OUTPUT:
       rm is a roadmap structure
       data is a 64x64 data cube in DN/sec
 KEYWORDS:
       dag selects dagwood data only
       al selects al data only
       t1 the start time (defaults to beginning of infil)
       t2 the end time (defaults to end of infil)
 CATEGORY:
       Yohkoh stuff
 ROUTINES USED:
       SFD_DECOMP, SXT_CEN, FMT_TIM, RD_XDA, GT_FILTB
 CALLS: ***
	FMT_TIMER [1], FMT_TIMER [2], RD_XDA [1], RD_XDA [2], fmt_tim [1], fmt_tim [2]
	gt_filtb, sfd_decomp, sxt_cen [1], sxt_cen [2], tim2dset [1], tim2dset [2]
 HISTORY: 
       HSH, 8 May 1994 (written)
       HSH, 15 May 1994, added time ranges, filter keywords, and
         registration using GET_SUNCENTER
       HSH, 18 May 1994, revise GET_SUNCENTER call
       HSH, 19 June 1994, fixed alignment bug and installed SXT_CEN


SFD_TEK $SSW/yohkoh/ucon/idl/hudson/sfd_tek.pro
[Previous] [Next]
 NAME:
    SFD_TEK
 PURPOSE:
    contour plot of last SFD image for Tek viewing
 CATEGORY:
 CALLING SEQUENCE:
    sfd_tek, index, data
    sfd_tek, index, data, levels=levels, /step
 INPUTS:
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED
    lastsfd, get_info
 OUTPUTS:
 CALLS: ***
	DAG_INDEX, PAUSE [1], fmt_tim [1], fmt_tim [2], get_info [1], get_info [2]
	get_info [3], get_info [4], gt_filtb, lastsfd [1], lastsfd [2], pause [2]
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
    15-Apr-96, HSH, written
    21-Apr-96, HSH added a couple of things
    25-Aug-96, HSH fixed a couple of things
    12-Apr-97, HSH added /dag


SFR_TOTALIZER $SSW/yohkoh/ucon/idl/hudson/sfr_totalizer.pro
[Previous] [Next]
 NAME:
	SFR_TOTALIZER
 PURPOSE:
 	Extract SFR totals and compare with GOES data
 CATEGORY:
	Yohkoh
 CALLING SEQUENCE:
	main program. Get infil first with YODAT or equivalent, but
	  just read the roadmap, not the data (-888 in YODAT)
 INPUTS:
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
	creatse SFR_FLUXES, SFR_TIMES
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
	HSH, written 5-feb-93


sft2sfc $SSW/yohkoh/sxt/idl/atest/sft2sfc.pro
[Previous] [Next]
   Name: sft2sfc

   Purpose: convert one or more SFT files to SFC files (via sfc_prep)

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], RD_SDA [1], RD_SDA [2], RD_SDA [3]
	Rd_Roadmap [2], anytim2ex [1], anytim2ex [2], concat_dir [4], ex2fid [1]
	ex2fid [2], file_list [1], file_list [2], fmt_tim [1], fmt_tim [2], get_logenv [1]
	get_logenv [2], gt_filta, gt_filtb, prstr [1], prstr [2], rd_roadmap [1]
	sav_sda [1], sav_sda [2], sav_sda [3], sfc_prep [1], sfc_prep [2], tbeep [1]
	tbeep [2], tbeep [3], tim2dset [1], tim2dset [2]
   History:
      15-mar-1995 (SLF)
       7-Aug-97  :  NN, change the index to be saved - should reflect
            the new version of sfc_prep, which keeps the index from dark_sub


sft_files $SSW/yohkoh/sxt/idl/util/sft_files.pro
[Previous] [Next]
 NAME:
	sft_files
 PURPOSE:
	Return a list of sft (SXT terminator) file names
 CALLING SEQUENCE:
	fn = sft_files() 		; Lastest file
	fn = sft_files('1-jan')		; File for 1-jan of this year
	fn = sft_files('30-oct-91', '2-nov-91')
 INPUT:
	st_date	- The UT date to search for.  If no date is entered,
		  the current date is used.  The year is not
		  required, but if entered should be of the
		  form 1-Oct-91 style.  The date should be
		  entered in string style with date first.
 OPTIONAL INPUT:
	en_date	- The ending date to list data for.  If no date is passed,
		  it only searches for "st_date"
 CALLS: ***
	ADDTIME [1], ADDTIME [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	concat_dir [4], tim2weekid
 CALLED BY:
	pr_sxt_term
 OPTIONAL KEYWORD INPUT:
	None.
 OUTPUT:
	Vector string of file names
 PROCEDURE:
 	sft_files searches the sft files on $DIR_GEN_SFT directory.
	The latest version of the file is returned.
 HISTORY:
	12-Oct-94, J. R. Lemen, Written.


SHIFT_HXT2P $SSW/yohkoh/ucon/idl/sakao/shift_hxt2p.pro
[Previous] [Next]
 NAME:
	SHIFT_HXT2P
 PURPOSE:
       To obtain an HXT image which can readily be overlain to the 
	corresponding SXT PFI image.
 CALLING SEQUENCE:
	new_hxt = SHIFT_HXT2P(hxt_image, xy0, sxt_index)
 INPUT:
	hxt_image	- HXT image ('pixel size' = 2.47")
	xy0		- Center position of HXT image synthesis FOV in units 
			  of HXT pitch (=126"). East and north positive. 
			  xy0(0) = E/W value
			  xy0(1) = N/S value
			  This can either be a HXT header structure variable 
			  or a 2-D array.
	sxt_index	- SXT index. Alternatively, this can be a 2-D array.
 OUTPUT:
	new_hxt		- Shifted HXT image which can be overlain to the 
			  corresponding SXT PFI.
 OPTIONAL KEYWORD OUTPUT:
	value		- Amount of shift in SXT pixel units necessary for 
			  overlaying the HXT image to the SXR image. West and 
			  North positive.
 CALLS: ***
	CONV_HXT2P [1], CONV_HXT2P [2], DATATYPE [1], DATATYPE [2], DATATYPE [3], FSHIFT
	gt_center
 HISTORY:
	written by T.Sakao, 26 December, 1993. 
	version 1.1	97.11.19 (Wed)	Program renamed from SHIFT_HXT to 
					SHIFT_HXT2P.


SHIFT_O2P $SSW/yohkoh/ucon/idl/sakao/shift_o2p.pro
[Previous] [Next]
 NAME:
	SHIFT_O2P
 PURPOSE:
	To shift an SXT optical (NarrowBand) image so that it could be 
	directly overlain to the corresponding soft X-ray image.
	Difference in boresights between soft X-ray and visible light optics 
	is corrected.
 CALLING SEQUENCE:
	new_opt = SHIFT_O2P(opt_image)
 INPUT:
	opt_image	- SXT optical telescope (NarrowBand) image in full 
			  resolution SXT pixels.
 OUTPUT:
	new_opt		- Shifted optical telescope image that can be overlain
			  onto the corresponding soft X-ray image. 
 OPTIONAL KEYWORD OUTPUT:
	value		- Amount of shift in full resolution SXT pixel units 
			  necessary for overlaying the OPT image to the SXR 
			  image. West and North positive.
 SIDE EFFECT:
	none
 CATEGORY:
	Yohkoh HXT data analysis.
 CALLS: ***
	FSHIFT, GT_SXT_AXIS
 HISTORY:
	version 1.0	95.06.15 (Thu)	T.Sakao written.
		1.1	97.11.19 (Wed)	Program simplified by use of FSHIFT 
					function.
		1.2	97.12.11 (Thu)	Program modified so that it can handle 
					image size other than 64x64.


shift_res [1] $SSW/yohkoh/gen/galileo/idl/lmsal/shift_res.pro
[Previous] [Next]
	NAME:	shift_res
	PURPOSE:
		To switch coordinates between resolutions.
	CALLING SEQUENCE:
		nu_coord=shift_res(old_coord,/xy,/fh)
	INPUT:
		old_coord, array of coordinates you wish to change
	OUTPUT:
		array of coordinates in the desired resolution
	KEYWORD INPUT:
		/xx	Only x coordinates.
		/yy	Only y coordinates.
		/xy	[x,y] array, change both coordinates
		/fh	FR --> HR
		/fq	FR --> QR
		/hq	HR --> QR
		/hf	HR --> FR
		/qf	QR --> FR
		/qh	QR --> HR
 CALLED BY:
	sxt_xsaa
	HISTORY:
		LWA  2/13/95  Ref: Last page of YAG.
		LWA  1/04/04  Updated with all conversions.


shift_res [2] $SSW/yohkoh/ucon/idl/acton/shift_res.pro
[Previous] [Next]
	NAME:	shift_res
	PURPOSE:
		To switch coordinates between resolutions.
	CALLING SEQUENCE:
		nu_coord=shift_res(old_coord,/xy,/fh)
	INPUT:
		old_coord, array of coordinates you wish to change
	OUTPUT:
		array of coordinates in the desired resolution
	KEYWORD INPUT:
		/xx	Only x coordinates.
		/yy	Only y coordinates.
		/xy	[x,y] array, change both coordinates
		/fh	FR --> HR
		/fq	FR --> QR
		/hq	HR --> QR
		/hf	HR --> FR
		/qf	QR --> FR
		/qh	QR --> HR
 CALLED BY:
	sxt_xsaa
	HISTORY:
		LWA  2/13/95  Ref: Last page of YAG.


SHIFTER_DM $SSW/yohkoh/ucon/idl/hudson/shifter_dm.pro
[Previous] [Next]
 NAME:
	SHIFTER_DM
 PURPOSE:
	shift images by a fractional amount, using interpolation
 CATEGORY:
 CALLING SEQUENCE:
	img_out = shifter_dm(img_in, dd)
 INPUTS:
	img_in a data cube of arbitrary dimensions
	dd an array of displacements (2xn), where n images
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
	img_out the new data cube (float) shifted according to dd
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
	D. Mickey, written < 1-nov-93
	HSH, documented 1-nov-93


sho $SSW/yohkoh/ucon/idl/acton/sho.pro
[Previous] [Next]
NAME:
	sho
PURPOSE:
	To print the average DN level of a box to be marked by the
	user.  It can also display the total and/or raw values.
CALLING SEQUENCE:
	sho,data [,side,nomark=nomark,raw=raw,total=total,bin=bin,color=color]
	sho, data
	sho, data, 10
	sho, data, 20, /nomark, /raw, bin=4, /total
INPUT:
	data	- 2-D data image array
	Mouse clicks:
	  - Left button gives a square box centered on click.
	  - Middle button used to mark opposite corners of rectangle.
	  - Right button exits the program.
OPTIONAL INPUT:
	side	- Number of pixels on a side (if not passed, the
		  default is 9
	nomark	- If present, the location on the image which 
		  is selected is NOT marked (default is to mark it)
	raw	- If present, print out the raw data values also
	total   - If present, print out the total in the box also
	bin	- The rebin factor used to display the image
	color	- Color to be used to mark box (default = 255)
 CALLS: ***
	draw_boxcorn [1], draw_boxcorn [2]
HISTORY:
	Written 20-Nov-91 by M.Morrison
       Modified by LWA, most recently 15-Oct-92
	Total keyword added 23-Oct-92
	Changed x0, y0 to give the size box specified by "side",
	   fixed "Region marked is:" output,
	   updated header, and added color keyword.  LWA  21-Jul-94
	Corrected error so would work on not-square images.  LWA 15-Sep-95


sho_max $SSW/yohkoh/ucon/idl/sxt_co/sho_max.pro
[Previous] [Next]
NAME:
	sho_max 
PURPOSE:
	To print the maximum DN level of a box to be marked by the
	user.  It can also display the total and/or raw values.
CALLING SEQUENCE:
	sho_max,data [,side,nomark=nomark,raw=raw,total=total,bin=bin,color=color]
	sho_max, data
	sho_max, data, 10
	sho_max, data, 20, /nomark, /raw, bin=4, /total
INPUT:
	data	- 2-D data image array
	Mouse clicks:
	  - Left button gives a square box centered on click.
	  - Middle button used to mark opposite corners of rectangle.
	  - Right button exits the program.
OPTIONAL INPUT:
	side	- Number of pixels on a side (if not passed, the
		  default is 9
	nomark	- If present, the location on the image which 
		  is selected is NOT marked (default is to mark it)
	raw	- If present, print out the raw data values also
	total   - If present, print out the total in the box also
	bin	- The rebin factor used to display the image
	color	- Color to be used to mark box (default = 255)
 CALLS: ***
	draw_boxcorn [1], draw_boxcorn [2], sxt_decomp [1], sxt_decomp [2]
 CALLED BY:
	DPE_GUESS
HISTORY:
	Written 20-Nov-91 by M.Morrison as program SHO 
       Modified by LWA, most recently 15-Oct-92
	Total keyword added 23-Oct-92
	Changed x0, y0 to give the size box specified by "side",
	   fixed "Region marked is:" output,
	   updated header, and added color keyword.  LWA  21-Jul-94
	Corrected error so would work on not-square images.  LWA 15-Sep-95
	Adapted to show maximum in sxt_decomp of region, 
          renamed SHO_MAX.  DMcK 11-may-98


show main program $SSW/yohkoh/ucon/idl/naoj_nkr/show.pro
[Previous] [Next]

 NAME       : show (main program)
 PURPOSE    :
	display NAOJ catalog data in /solar directory
 CATEGORY :
	idl/lib/nkr
 CALLING SEQUENCE :
	.run show
 INPUTS :
 OPTIONAL INPUT PARAMETERS : 
	none
 KEYWORD PARAMETERS :
 OUTPUTS :
	none
 COMMON BLOCKS : 	none
 SIDE EFFECTS : 	none
 RESTRICTIONS :	none
 PROCEDURE :
 MODIFICATION HISTORY :
	K.I. '92/05/11
	K.I. '92/05/11		minor change 
	K.I. '92/06/30		include okayama
	K.I. '93/01/22		pix1=pix_size('ft1')
	K.I. '93/04/10		lsmenu( nnmax=310)
	K.I. '93/05/22		lsmenu( nnmax=310)
	K.I. '93/11/20		lsmenu( nnmax=nnmax) for monochro
	T.S. '93/12/21		OAO magnetogram by magplot


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

   Purpose: show timing relationships between KSC contacts and Yohkoh ephemeris
            (also illustrate get_utevent, evt_grid, timegrid)

   Input Parameters:
      startt - starttime (or only time)

   Optional Keyword Parameters:
      visible -  only display visible passes (default is all / visible highlighted)
      nofem   -  if set, omit Yohkoh ephemeris
      summary - if set, show the whole week (implies=>/visible,/nofem,/jst)
      sxttable - if set, show table loads in selected time frame
      select - menu selection of a particular pass or pass range for display
      
   Calling Sequence:
      show_contacts , starttime [,stoptime]
      show_contacts, /visible			- only show visible
      show_contacts, /select			- menu select pass(es) 
      show_contacts,/sxttable,/nofem		- sxt table loads / no ephemeris 

   Calling Examples:
      show_contacts			; show todays contacts
      show_contacts,/local		; same w local labels (default=UT)
      show_contacts, '1-oct'		; show 1 day relationships
      show_contacts, '1-oct','4-oct'	; breaks into 4x24 hour 
      show_contacts,/summary		; show the whole week
      show_contacts,/summary,'future date' ; show next week, if availble

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], WDEF [1], WDEF [2]
	anytim2ints [1], anytim2ints [2], anytim2weekid [1], anytim2weekid [2]
	concat_dir [4], evt_grid, fem_grid [1], fem_grid [2], get_logenv [1]
	get_logenv [2], get_utevent [1], get_utevent [2], get_visible, gt_day [1]
	gt_day [2], gt_time [1], gt_time [2], int2secarr [1], int2secarr [2]
	linecolors [1], linecolors [2], next_window [1], next_window [2], prstr [1]
	prstr [2], sel_timrange [1], sel_timrange [2], stag_lab [1], stag_lab [2]
	str2cols [1], str2cols [2], strjustify, sxt_plan, tbeep [1], tbeep [2], tbeep [3]
	tim2dow, tim2dset [1], tim2dset [2], tim2pass, timegrid, ut_time [1], ut_time [2]
	wmenu_sel [1], wmenu_sel [2], zbuff2file [1], zbuff2file [2]
   History:
      7-Oct-94 (SLF) 
      3-apr-1995 (SLF) - add visible info if available and local time 
      7-apr-1995 (SLF) - update get_visible call / add PassNumbers
      9-apr-1995 (SLF) - add VISIBLE and NOFEM keywords
     10-apr-1995 (SLF) - add SUMMARY keyword and dow annotations
     12-apr-1995 (SLF) - problem with local time, allow /summary mode
                         to work with dates from 'next' week
     28-sep-1995 (SLF) - allow Zbuffer


show_hxafid $SSW/yohkoh/ucon/idl/wuelser/show_hxafid.pro
[Previous] [Next]
 NAME:
        show_hxafid
 PURPOSE:
        Overplots the areas of SXT suncenter locations where one of
        the limbs would be hidden by an HXA fiducial mark.
        Uses date to account for slowly varying hxa - sxt alignment
        parameters, solar radius variations, and hxa degradation.
        Does not correct for orbital variations.
 CATEGORY:
 CALLING SEQUENCE:
        plot,[0,0],xr=[0,1024],yr=[0,1024],xsty=1,ysty=1,/nodata
        show_hxafid
 INPUTS:
        date = in any format.  Optional.  Default: current date.
 KEYWORDS (INPUT):
        /overplot = reuse the same graphics window (for "contour")
        /fill = fill out the fiducial mark zones (for "contour")
        color = color of contour or fill.
        xrange = range of sxt x-coord. to be shown (not compat. with /overp)
        yrange = range of sxt y-coord. to be shown (not compat. with /overp)
 OUTPUTS:
 KEYWORDS (OUTPUT):
        map = intarr(1024,1024).  Map of hidden limbs (vis = 0, hidden = 1)
 CALLS: ***
	ATT_STRUCT [1], ATT_STRUCT [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	FIX_OLD_ATT [1], FIX_OLD_ATT [2], FIX_OLD_ATT [3], FORZONES [1], FORZONES [2]
	HXA_PARMS [1], HXA_PARMS [2], HXA_PARMS [3], INTERPOL, SXT2HXAXY, anytim2ints [1]
	anytim2ints [2], concat_dir [4], get_rb0p [1], get_rb0p [2], int2secarr [1]
	int2secarr [2], restgen [1], restgen [2]
 CALLED BY:
	TERM_FIDS
 COMMON BLOCKS:
        None.
 SIDE EFFECTS:
        Overplots the current graph with polyfill.
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
        JPW, 24-sep-98


show_obs $SSW/yohkoh/sxt/idl/util/show_obs.pro
[Previous] [Next]

 Name: show_obs

 Purpose: show image start times by sequence#

 Input Parameters:
    structure - roadmap or sxt.index with tag=seq_num

 CALLED BY:
	sda_look [1]
 History: slf, 6/91


show_obs2 $SSW/yohkoh/sxt/idl/util/show_obs2.pro
[Previous] [Next]
NAME:
	show_obs2
PURPOSE:
	To plot when images are taken for each of the particular
	observing regions.  Also mark where the sequence table or
	entry table changed.  An option exists to select images with
	the cursor (select time range).
CALLING SEQUENCE:
	show_obs2, roadmap
	show_obs2, roadmap, sel
	show_obs2, sxtp, sel, ss	;observing log vector
INPUT:
	Structure- Roadmap or observing log entry.  Index structures
		   cannot be passed at this time.
OPTIONAL OUTPUT:
	selimg	- If present, the user is prompted to mark a
		  starting and ending time of interest.  The value
                 returned is an array of the same length as
                 the input array with the selected datasets
                 having a "1".  The way to use this value is
                 something like the following:
                       ss = where(selimg)
                       ss = where(selimg and (roadmap.percentd eq 255))
       ss      - Return the list of indicies that were selected.
                 This should be used only if you do not want to
                 do other searches using the "where" function.
 CALLS: ***
	GET_BOXCORN, UNIQ [1], UNIQ [2], UNIQ [3], UTPLOT [1], UTPLOT [2], UTPLOT [3]
	UTPLOT [4], UTPLOT [5], UTPLOT [6], draw_boxcorn [1], draw_boxcorn [2]
	fmt_tim [1], fmt_tim [2], gt_dp_mode [1], gt_dp_mode [2], gt_dp_rate [1]
	gt_dp_rate [2], gt_seq_num, gt_seq_tab, int2secarr [1], int2secarr [2]
HISTORY:
	Written 7-Nov-91 by M.Morrison (using S.Freeland routine as a start)
       12-Nov-91 (MDM) - Added "ss" parameter option
	16-Nov-91 (MDM) - Changed to use UTPLOT instead of plot
	20-Nov-91 (MDM) - Changed DP_MODE and DP_PLOT symbol from histogram
			  (psym=10) to usersym (simple horizontal line) because
			  histogram mode fools the user into thinking that data
			  exists where it does not


show_obs3 $SSW/yohkoh/sxt/idl/util/show_obs3.pro
[Previous] [Next]
NAME:
	show_obs3
PURPOSE:
	To plot when images are taken for each of the particular
	observing regions.  Also mark where the sequence table or
	entry table changed.  An option exists to select images with
	the cursor (select time range).
CALLING SEQUENCE:
	show_obs3, roadmap
	show_obs3, roadmap, sel
	show_obs3, sxtp, sel, ss	;observing log vector
INPUT:
	Structure- Roadmap or observing log entry.  Index structures
		   cannot be passed at this time.
OPTIONAL OUTPUT:
	selimg	- If present, the user is prompted to mark a
		  starting and ending time of interest.  The value
                 returned is an array of the same length as
                 the input array with the selected datasets
                 having a "1".  The way to use this value is
                 something like the following:
                       ss = where(selimg)
                       ss = where(selimg and (roadmap.percentd eq 255))
       ss      - Return the list of indicies that were selected.
                 This should be used only if you do not want to
                 do other searches using the "where" function.
 CALLS: ***
	GET_BOXCORN, UNIQ [1], UNIQ [2], UNIQ [3], UTPLOT [1], UTPLOT [2], UTPLOT [3]
	UTPLOT [4], UTPLOT [5], UTPLOT [6], anytim2weeks [1], anytim2weeks [2]
	draw_boxcorn [1], draw_boxcorn [2], fmt_tim [1], fmt_tim [2], gt_dp_mode [1]
	gt_dp_mode [2], gt_dp_rate [1], gt_dp_rate [2], gt_seq_num, gt_seq_tab
	int2secarr [1], int2secarr [2], rd_fem
HISTORY:
	Written 7-Nov-91 by M.Morrison (using S.Freeland routine as a start)
       12-Nov-91 (MDM) - Added "ss" parameter option
	16-Nov-91 (MDM) - Changed to use UTPLOT instead of plot
	20-Nov-91 (MDM) - Changed DP_MODE and DP_PLOT symbol from histogram
			  (psym=10) to usersym (simple horizontal line) because
			  histogram mode fools the user into thinking that data
			  exists where it does not
	11-Dec-91 (MDM) - Took "show_obs2" and made "show_obs3" which also
			  plotted the s/c day times and SAA times.
	18-Feb-92 (MDM) - Changed RD_TRN to use RD_FEM - allowed show_obs3 to
			  be used with 1992 data.
	 3-Mar-92 (MDM) - Added the times of KSC station contacts to be plotted
	17-Aug-01 (LWA) - Changed loop variables to longword type.


show_obs4 $SSW/yohkoh/sxt/idl/util/show_obs4.pro
[Previous] [Next]
NAME:
	show_obs4
PURPOSE:
	To plot when images are taken for each of the particular
	observing regions.  Also mark where the sequence table or
	entry table changed.  An option exists to select images with
	the cursor (select time range).
CALLING SEQUENCE:
	show_obs4, roadmap
	show_obs4, roadmap, sel
	show_obs4, sxtp, sel, ss	;observing log vector
INPUT:
	Structure- Roadmap, index, or observing log entry.  
OPTIONAL OUTPUT:
	selimg	- If present, the user is prompted to mark a
		  starting and ending time of interest.  The value
                 returned is an array of the same length as
                 the input array with the selected datasets
                 having a "1".  The way to use this value is
                 something like the following:
                       ss = where(selimg)
                       ss = where(selimg and (roadmap.percentd eq 255))
       ss      - Return the list of indicies that were selected.
                 This should be used only if you do not want to
                 do other searches using the "where" function.
 CALLS: ***
	LPRINT, UNIQ [1], UNIQ [2], UNIQ [3], UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4]
	UTPLOT [5], UTPLOT [6], anytim2weeks [1], anytim2weeks [2], draw_boxcorn [1]
	draw_boxcorn [2], fmt_tim [1], fmt_tim [2], gt_dp_mode [1], gt_dp_mode [2]
	gt_dp_rate [1], gt_dp_rate [2], gt_seq_num, gt_seq_tab, int2secarr [1]
	int2secarr [2], plot_lcur [1], plot_lcur [2], rd_fem
HISTORY:
	Written 7-Nov-91 by M.Morrison (using S.Freeland routine as a start)
       12-Nov-91 (MDM) - Added "ss" parameter option
	16-Nov-91 (MDM) - Changed to use UTPLOT instead of plot
	20-Nov-91 (MDM) - Changed DP_MODE and DP_PLOT symbol from histogram
			  (psym=10) to usersym (simple horizontal line) because
			  histogram mode fools the user into thinking that data
			  exists where it does not
	11-Dec-91 (MDM) - Took "show_obs2" and made "show_obs3" which also
			  plotted the s/c day times and SAA times.
	18-Feb-92 (MDM) - Changed RD_TRN to use RD_FEM - allowed show_obs3 to
			  be used with 1992 data.
	 3-Mar-92 (MDM) - Added the times of KSC station contacts to be plotted
			  ************ Expanded to SHOW_OBS4 *****************
	 2-May-92 (MDM) - Added ability to zoom in on a time span
	 5-May-92 (MDM) - Adjusted code to be able to use "BOX_CURSOR" within
			  PLOT_LCUR more easily.


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

   Purpose: event driver for xshow_pix

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], EVENT_NAME, GET_WUVALUE
	GET_WVALUE, WDEF [1], WDEF [2], XLOADCT [1], XLOADCT [2], XLOADCT [3], XMOVIE [1]
	XMOVIE [2], break_file [4], data_chk [1], data_chk [2], get_info [1], get_info [2]
	get_info [3], get_info [4], get_logenv [1], get_logenv [2], mapx [1], mapx [2]
	restgen [1], restgen [2], ut_time [1], ut_time [2], wc_where [1], wc_where [2]
 CALLED BY:
	show_pix [1], show_pix [2]
   History:
      20-Dec-1993 (SLF) (guts of show_pix.pro, 10-Nov)
      22-Dec-1993 (SLF) window creation logic (IDL feature workaround)
	1-Feb-1994 (SLF) allow empty directories
      18-Jul-1994 (SLF) if new data disply, show current UT Time 
      22-Jul-1994 (SLF) add common block (externalize after exit)
       7-Sep-1994 (SLF) Prepend (not append) UT TIME for new_data subdirectory
      16-feb-1994 (SLF) enable hardcopy option
       2-apr-1995 (slf) movie option
      10-apr-1995 (SLF) problem with pre-existing window display


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

   Purpose: read/return showpix file info (without running show_pix)

   Input Parameters:
      NONE

   Output Parameters:
      image - sp image
      text  - sp text

   Keyword Parameters:
      select - if set, show menu
      _extra - show_pix subdirectory or ALL (default = new_data)
 CALLS:


sigma_klip [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sigma_klip.pro
[Previous] [Next]
 NAME:
	sigma_klip
 PURPOSE:
	Computes the mean and standard deviation of pixels in a box centered at 
	each pixel of the image, but excluding the center pixel. If the center 
	pixel value exceeds some # of standard deviations from the mean, it is 
	replaced by the mean in box. Note option to process pixels on the edges.
 CALLING SEQUENCE:
	out = sigma_klip(image,width,N_sigma=(#),/monitor)
 INPUTS:
	image = 2-D image (matrix)
 CALLS: ***
	big_smooth [1], big_smooth [2]
 CALLED BY:
	sxt_clean [1], sxt_clean [2]
 OPTIONAL KEYWORD INPUT:
	width = width of square filter box, in # pixels (default = 3)
	N_sigma = # standard deviations to define outliers, floating point,
			default = 3. For gaussian statistics:
			N_sigma = 1 smooths 35% of pixels, 2 = 5%, 3 = 1%.
      /MONITOR prints information about % pixels replaced.
 OPTIONAL KEYWORD OUTPUTS:
	N_CHANGE = # of pixels changed (replaced with neighborhood mean).
	VARIANCE = image of pixel neighborhood variances * (N_sigma)^2,
	DEVIATION = image of pixel deviations from neighborhood means, squared.
 PROGRAMS CALLED:
	big_smooth
 PROCEDURE:
	Compute mean over moving box-cars using smooth, subtract center values,
	compute variance using smooth on deviations from mean,
	check where pixel deviation from mean is within variance of box,
	replace those pixels in smoothed image (mean) with orignal values,
	return the resulting partial mean image.
 MODIFICATION HISTORY:
	10/20/96 [LWA] made from sigma_filter.pro because of edge problems.


sigma_klip [2] $SSW/yohkoh/ucon/idl/acton/sigma_klip.pro
[Previous] [Next]
 NAME:
	sigma_klip
 PURPOSE:
	Computes the mean and standard deviation of pixels in a box centered at 
	each pixel of the image, but excluding the center pixel. If the center 
	pixel value exceeds some # of standard deviations from the mean, it is 
	replaced by the mean in box. Note option to process pixels on the edges.
 CALLING SEQUENCE:
	out = sigma_klip(image,width,N_sigma=(#),/monitor)
 INPUTS:
	image = 2-D image (matrix)
 CALLS: ***
	big_smooth [1], big_smooth [2]
 CALLED BY:
	sxt_clean [1], sxt_clean [2]
 OPTIONAL KEYWORD INPUT:
	width = width of square filter box, in # pixels (default = 3)
	N_sigma = # standard deviations to define outliers, floating point,
			default = 3. For gaussian statistics:
			N_sigma = 1 smooths 35% of pixels, 2 = 5%, 3 = 1%.
      /MONITOR prints information about % pixels replaced.
 OPTIONAL KEYWORD OUTPUTS:
	N_CHANGE = # of pixels changed (replaced with neighborhood mean).
	VARIANCE = image of pixel neighborhood variances * (N_sigma)^2,
	DEVIATION = image of pixel deviations from neighborhood means, squared.
 PROGRAMS CALLED:
	big_smooth
 PROCEDURE:
	Compute mean over moving box-cars using smooth, subtract center values,
	compute variance using smooth on deviations from mean,
	check where pixel deviation from mean is within variance of box,
	replace those pixels in smoothed image (mean) with orignal values,
	return the resulting partial mean image.
 MODIFICATION HISTORY:
	10/20/96 [LWA] made from sigma_filter.pro because of edge problems.


simp_rule $SSW/yohkoh/ucon/idl/mctiernan/simp_rule.pro
[Previous] [Next]
 NAME:
       simp_rule
 PURPOSE:
       Simpson's rule integration of a function
 CALLING SEQUENCE:
       f=simp_rule(x,y,dx)
 INPUT:
       x = array containing the independent variable,
           must be at least 3 elements, Preferably,
           N_ELEMENTS(x) should be odd.
       y = dependent variable, y=f(x), or a scalar
           y can be a 2d array of (n_elements(x), n_other)
       dx = x(i+1)-x(i), of course, dx must be a constant,
           If not input, dx = x(1)-x(0) is used.
 OUTPUT:
       f = the integral of y*dx
 CALLED BY:
	av_chflux, dem_models, fx_95_o, fx_96_o, fx_97_o, fx_98_o, fx_99_o
 HISTORY:
       4-nov-93 by JMM
       24-oct-95, added 2-d y, jmm


SIMPLE_TV2 $SSW/yohkoh/ucon/idl/hudson/simple_tv2.pro
[Previous] [Next]
 NAME:
     SIMPLE_TV2
 PURPOSE:
     put an image into encapsulated PS for inclusion in a LaTeX file.
       The figure insertion command in LaTeX will have an argument that
       determines its size in the .ps file, and this should ideally 
       match the xsize parameter here (default 5 inches).
 CATEGORY:
 CALLING SEQUENCE:
     simple_tv2, image, r, g, b, xsize = xsize
     simple_tv2, image, r, g, b, xsize = xsize, /revcolor
 INPUTS:
     image, a byte-scaled image
     r,g,b, the color table desired
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     xsize. By default it's 5.0 inches
     revcolor
 ROUTINES CALLED
     TV2, of course, YESNOX
 OUTPUTS:
     if the plot goes to a PostScript file, its name will be "idl.eps"
       and it will appear in the current directory
 CALLS: ***
	LOADCT, OVER, input [1], input [2], tv2 [1], tv2 [2], yesnox [1], yesnox [2]
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
     For reasons not known, you should use flareN for reverse B&W
 MODIFICATION HISTORY:
     HSH, written 22-Aug-96
     JRL, fixed   23-Aug-96
     HSH, documented 24-Aug-96


sld_sls_vstrips $SSW/yohkoh/ucon/idl/acton/sld_sls_vstrips.pro
[Previous] [Next]
NAME:
       sld_sls_vstrips
PURPOSE:
       To plot the SXT dark current signal or stray light signal
	after the Nov-92 entrance filter failure.
CALLING SEQUENCE:
       sld_sls_vstrips,index_d,sld
	sld_sls_vstrips,index-s,sls
METHOD:
       Dark frame images are taken with the Be x-ray analysis filter.
       After 17-Nov-92 entrance filter failure, it was noticed that thedark
       current signal increase dramatically.  This routine monitorsthat
       increase (which decreased after a few months).

       A full frame image is taken and broken up into 51 verticalstrips
       (20 columns per strip for FR, 10 for HR, and 5 for QR).  Thevalues
       plotted in the first plot are strip 5 and strip 0.  Strip 5 isthe area
       where the increase in the dark signal was seen.  Strip 0 is offthe
       area where the sun hits the CCD and is a reference area.
       The QR images are converted to the equivalent signal for a HRimage.
               Open /Al.1  Half Dark C  13    78.0  512x512
               Open /AlMg  Qrtr Dark C  13    78.0  256x256
 CALLS: ***
	PAUSE [1], UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6]
	pause [2], plottime [1], plottime [2]
HISTORY:
       Written Winter, 1992 by M.Morrison
       22-May-93 (MDM) - Added header information
       16-Aug-93 (LWA) adapted from PLOT_SLD to plot single strips.
	2-Sep-93 (LWA) changed to display either SLD or SLS data.


sld_vstrips $SSW/yohkoh/ucon/idl/acton/sld_vstrips.pro
[Previous] [Next]
NAME:
       sld_vstrips
PURPOSE:
       To plot the SXT dark current signal after the Nov-92 entrancefilter
       failure.
CALLING SEQUENCE:
       sld_vstrips,index_d,sld
METHOD:
       Dark frame images are taken with the Be x-ray analysis filter.
       After 17-Nov-92 entrance filter failure, it was noticed that thedark
       current signal increase dramatically.  This routine monitorsthat
       increase (which decreased after a few months).

       A full frame image is taken and broken up into 51 verticalstrips
       (20 columns per strip for FR, 10 for HR, and 5 for QR).  Thevalues
       plotted in the first plot are strip 5 and strip 0.  Strip 5 isthe area
       where the increase in the dark signal was seen.  Strip 0 is offthe
       area where the sun hits the CCD and is a reference area.
       The QR images are converted to the equivalent signal for a HRimage.
               Open /Al.1  Half Dark C  13    78.0  512x512
               Open /AlMg  Qrtr Dark C  13    78.0  256x256
 CALLS: ***
	PAUSE [1], UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6]
	pause [2], plottime [1], plottime [2]
HISTORY:
       Written Winter, 1992 by M.Morrison
       22-May-93 (MDM) - Added header information
       16-Aug-93 (LWA) adapted from PLOT_SLD to plot single strips.


sleazy_rot $SSW/yohkoh/ucon/idl/nitta/sleazy_rot.pro
[Previous] [Next]
 NAME: sleazy_rot
 CALLING SEQUENCE:
	img_rot = sleazy_rot(item1, img, time_in, time_out [,roll=roll])
 INPUT PARAMETERS: 	
	item1	Either an SXT index record or a vector with
		the following elements
		  item1(0) = xcen in pixels from lower left
		  item1(1) = ycen in pixels from lower left
		  item1(2) = disk radius in pixels
	img
       time_in         time associated with img
       time_out	time to rotate to
 OPTIONAL KEYWORD INPUTS:
	roll	Explicit roll value (default is 0 except for SXT)
 CALLS:


SLICE $SSW/yohkoh/ucon/idl/shimizu/slice.pro
[Previous] [Next]
 NAME:
	SLICE
 PURPOSE:
	Make Space-Time Slice Data.

 CATEGORY:
       Image processing.

 CALLING SEQUENCE:
       Result = SLICE(Image, XX, YY)

 INPUTS:
       Image:  The data array representing the image.  This array can be
               of any type except complex. Cubic (2d space - time data).
       Xy_from: [x, y] address of one end of the profile line. int(2)
       Xy_to:  [x, y] address of other end of the profile line. int(2)

 KEYWORD PARAMETERS:
     NONMARK:  Set this keyword to inhibit marking the image with the
               profile line.
     WIDTH:    the width of the profile line. If set, the avarage values
               of the specified width are returned. If not set, width=1
	MAX:	Set this keyword to obtain the maximum values of the
		specified width.

 OUTPUTS:
 	SLICE returns a floating-point 2-d data which is the space (Y-
	direction) - time (X-direction). The space information is the 
	values of the images along the profile line indicated by Xy_from
	and Xy_to.
 OPTIONAL OUTPUTS:
       XX:     After picking the end points, XX contains the X coordinates
               of the points along the selected profile.

       YY:     After picking the end points, YY contains the Y coordinates
               of the points along the selected profile.

 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:

 PROCEDURE:
	PROFILE2 is used to obtain the values of the images along the 
	profile line.

 HISTORY:
	18 Nov 1994 TShimizu  written 


SLOFO SLOw FOurier $SSW/yohkoh/ucon/idl/hudson/slofo.pro
[Previous] [Next]
 NAME:
	SLOFO (= SLOw FOurier)
 PURPOSE:
	does power spectra the hard way, good for unevenly sampled data
 CALLING SEQUENCE:
	slofo,seconds,timeseries,power,freq,freqrange,deltaf,/noverbose,/nonorm
 INPUTS:
	seconds: data times in seconds
	timeseries: the time-series data 
	freqrange: optional frequency range ([f_min,f_max]) in Hz 
       deltaf: optional spacing of estimates in frequency in Hz 
       /noverbose defeats the messages
       /nonorm defeats normalization to the mean (i.e. leaves dimensions in)
 OUTPUTS:
       power = power estimates (/Hz)
       freq = at what frequencies estimated (Hz)
 CALLS: ***
	POLY_FIT, SLOFO, STDEV
 HISTORY:
	written by HSH, Jul. 23, 1992
	optional frequency grid added Jul. 25 (HSH)
	/noverbose, /nonorm keywords Aug. 21 (HSH)


SLOPE_TEMP $SSW/yohkoh/ucon/idl/hudson/slope_temp.pro
[Previous] [Next]
 NAME:
      SLOPE_TEMP.PRO
 PURPOSE:
      evaluate radial gradients of coronal models
        in terms of scale_height temperatures
 CATEGORY:
      Yohkoh
 CALLING SEQUENCE:
      slope_temp, model, heights, fluxes, temp, te, em
 INPUTS:
      none
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
      none
 ROUTINES CALLED
      WITH_INT
 OUTPUTS:
      heights, fluxes, scale-height temp, te, em
 CALLS: ***
	SXT_TEEM [1], SXT_TEEM [2], WITH_INT
 RESTRICTIONS:
 MODIFICATION HISTORY:
      HSH written 4 April 1994


smooth_spec $SSW/yohkoh/ucon/idl/sterling/smooth_spec.pro
[Previous] [Next]
 NAME:
       smooth_spec
 PURPOSE:
	Smooths the counts and flux using idl routine.
	(replacing bsc_data structure).


 CALLING SEQUENCE:
    	smooth_spec,bsc_index,bsc_data,smooth_data,smoothing  
 INPUTS:
       bsc_index
	bsc_data
	smoothing	Number of array points to smooth over.
 KEYWORDS:
       none

 USAGE:

 PROCEDURES:

 OUTPUTS:
       smooth_data      = structure corresponding to bsc_data, but has 
			 smoothed counts and flux values.

 HISTORY:
       12-Dec-95, Written. A. Sterling
	14-Oct-96, Changed to handle single spectrum arrays.  A. Sterling. 


SMUDGE_SPECTRA $SSW/yohkoh/bcs/idl/util/smudge_spectra.pro
[Previous] [Next]
 NAME:
       SMUDGE_SPECTRA
 PURPOSE:
       plot a smudge of the BCS spectra against time
       using colour table 5
 CALLING SEQUENCE:  
       smudge_spectra,dpsectra
 INPUTS:
       dspectra        decompressed BCS spectra array
 OUTPUTS:

 OPTIONAL OUTPUTS:

 CALLS: ***
	LOADCT
 CALLED BY:
	BCS_SPMOVIE [1], BCS_SPMOVIE [2]
 RESTRICTIONS:

 PROCEDURE:

 MODIFICATION HISTORY:
       RDB  Oct 1991
       RDB  13-Dec-94  Replaced call to SUM with TOTAL


SOHO_COORDS $SSW/yohkoh/ucon/idl/hudson/soho_coords.pro
[Previous] [Next]
 NAME:
     SOHO_COORDS
 PURPOSE:
     convert SOHO angular offsets into approximate Yohkoh pointing
       coordinates
 CATEGORY:
     soho_coords, coords
 CALLING SEQUENCE:
 INPUTS:
     coords, a two-element vector [arc sec w, arc sec n] wrt Sun center
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
 CALLS: ***
	conv_a2p [1], conv_a2p [2], lastsfd [1], lastsfd [2]
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     JPW and HSH, written 3-oct-96


sol_rot [1] $SSW/yohkoh/gen/idl/gbo/sol_rot.pro
[Previous] [Next]
 NAME: sol_rot


 PURPOSE: To take pixels in a 2D image map them onto a sphere, rotate the  
  	   sphere map the pixels back to the plane. For use in extrapolating 
	   GBO data backward or forward in time.                              

 METHOD: Take the pixel coordinates of the on disk points, map them 
	  to heliocentric coordinates, add the appropriate differential 
	  rotation, and map them back. 
	  All pixels that have rotated behind the limb are marked by [-1,-1]
	  entries. For now just take longitude to +/- 90.

 CALLING SEQUENCE:
			out=gbo_rot_t(xx,yy,trgt,date,delt[,roll=roll])

 PARAMETERS: 	
		pixx 	vector with the x pixel coordinates.
		pixy	vector with the y pixel coordinates.
		trgt	a three vector, with the centroid and radius in the 
			same size pixels as the image.
		date 	the time of the image, in standard 7 part form, 
			[DD-MMM-YY HH:MM:SS].
		delt	the rotation time, in decimal days.
		out     the return is a 2xn matrix with the new x & y pixel 
			coordinates. 

 KEYWORDS:	roll 	optional roll correction. For SXT images you can
			use 1.0.
		stretch optional return. factor measuring the longitudinal 
			contraction/expansion of each pixel.


 RETURN TYPE:
 
 CALLS: ***
	DIFF_ROT [1], DIFF_ROT [2], conv_h2p [1], conv_h2p [2], conv_p2h [1], conv_p2h [2]
 CALLED BY:
	gbo_pfi, gbo_rot_t, rect_rot
 HISTORY: Drafted by A.McAllister, Feb. 1993.
	   Reworked for new conversion routines, Jun. 1993.
	   16-Oct-93 (MDM) - Modified call to CONV_P2H and H2P to use the
			     keyword input "roll" instead of "tilt"
	   Corrected output assignment indexing???, AHM, Dec 1, 93.


sol_rot [2] $SSW/yohkoh/ucon/idl/slater/dry_rot.pro
[Previous] [Next]
 NAME: sol_rot
 CALLING SEQUENCE:
	img_rot = dry_rot(item1, img, time_out [,roll=roll])
 INPUT PARAMETERS: 	
	item1	Either an SXT index record or a vector with
		the following elements
		  item1(0) = xcen in pixels from lower left
		  item1(1) = ycen in pixels from lower left
		  item1(2) = disk radius in pixels
		  item1(3) = time of input image (img)
	img
       time_out	time to rotate to
 OPTIONAL KEYWORD INPUTS:
	roll	Explicit roll value (default is 0 except for SXT)
 CALLS:
 CALLED BY
	gbo_pfi, gbo_rot_t, rect_rot


sonyloop [1] $SSW/yohkoh/gen/idl/atest/sonyloop.pro
[Previous] [Next]
 Name:
   sonyloop

 Purpose:
   Play a range of frames on the Sony LVR-5000A laser videodisk
   recorder/player an arbitrary number of times

 Calling sequence:
   sonyloop, f0
   sonyloop, f0, f1, sec_per_frame=sec_per_frame, reps=reps,
	      reverse=reverse, w1=w1, device=device

 CALLED BY:
	mk_vcr, vblink, video_blink [1], video_blink [2], video_menu
 Examples:
   sonyloop, 5000		; Position to frame 5000
   sonyloop, 5000, 5200	; Play from 5000 to 5200 at normal speed
   sonyloop, 5000, 5200, sec=2	; Play a factor of 2 slower
   sonyloop, 5200, 5000	; Play backwards
   sonyloop, 5000, 5200, /rev	; Play forward and backwards
   sonyloop, 5000, 5200, w1=4	; Position to 5000 and pause 4sec, then play
   sonyloop, 5000, 5200, w2=4	; Pause 4sec after playing
				; If /rev switch is set, w2 wait is applied
				;- before the reverse play starts.

 Input:
   f0, f1 = start and end frames of sequence to play

 Optional Input Keywords:
   sec_per_frame = dwell at each frame in units of 1/30 sec
		    1:255 are acceptable.
		    -1 corresponds to 1/5 speed  (slow forward/reverse)
		    -2 corresponds to 3x normal  (fast forward/reverse)
		    -3 corresponds to normal
   reps = number of playback repeats at each playback speed
   reverse = 0 to jump from last to first frame
           = 1 to reverse play from last frame to first frame
   w1 = wait interval after initial display before sequence begins
   w2 = wait after the sequence ends
   device = 0 for sony 3000		(/dev/tty08)
   device = 1 for sony 5000 (default)	(/dev/tty09)

 CALLS: ***
	command_laser, command_tty2, get_sony_cmd, tbeep [1], tbeep [2], tbeep [3]
 Restrictions:
   1. Must be used on isass3 only (physical port is on isass3)
   2. Assumes lun=1 for I/O.
   3. Reverse step (4d) and reverse slow (4c) gives normal play speeds.
		Timing calculation, therefore, is sometimes off.

 Method:

 Modification History:
   Written,  24-feb-92 - gls
   Modified, 27-aug-92, JRL:  Fixed the delay times, some of the logic.
	18-Jun-93 (MDM) - Removed print statments
			- Made default W1 wait 0 seconds
   GLS - 26-apr-94 - Replaced 'printf' with calls to command_tty2
		      which calls a modified version of call_tty
		      - this was necessary after Ultrix upgrade
   28-jan-95, JRL, Added beep keyword.  Changed to call get_sony_cmd
    2-Feb-95, JRL, Modified to be consistent with new get_sony_cmd
    2-Mar-95, LS,  modified the ports for the DEC alpha and terminal server
   30-May-96, GAL, Found the working version of this routine in Greg's 
		personal area, without documentation for the changes.
		It looks like Greg's newer version uses command_laser 
		instead of command_tty2 in most of the commands to the
		sony.


sonyloop [2] $SSW/yohkoh/gen/idl/movie/sonyloop.pro
[Previous] [Next]
 Name:
   sonyloop

 Purpose:
   Play a range of frames on the Sony LVR-5000A laser videodisk
   recorder/player an arbitrary number of times

 Calling sequence:
   sonyloop, f0
   sonyloop, f0, f1, sec_per_frame=sec_per_frame, reps=reps,
	      reverse=reverse, w1=w1, device=device

 CALLED BY:
	mk_vcr, vblink, video_blink [1], video_blink [2], video_menu
 Examples:
   sonyloop, 5000		; Position to frame 5000
   sonyloop, 5000, 5200	; Play from 5000 to 5200 at normal speed
   sonyloop, 5000, 5200, sec=2	; Play a factor of 2 slower
   sonyloop, 5200, 5000	; Play backwards
   sonyloop, 5000, 5200, /rev	; Play forward and backwards
   sonyloop, 5000, 5200, w1=4	; Position to 5000 and pause 4sec, then play
   sonyloop, 5000, 5200, w2=4	; Pause 4sec after playing
				; If /rev switch is set, w2 wait is applied
				;- before the reverse play starts.

 Input:
   f0, f1 = start and end frames of sequence to play

 Optional Input Keywords:
   sec_per_frame = dwell at each frame in units of 1/30 sec
		    1:255 are acceptable.
		    -1 corresponds to 1/5 speed  (slow forward/reverse)
		    -2 corresponds to 3x normal  (fast forward/reverse)
		    -3 corresponds to normal
   reps = number of playback repeats at each playback speed
   reverse = 0 to jump from last to first frame
           = 1 to reverse play from last frame to first frame
   w1 = wait interval after initial display before sequence begins
   w2 = wait after the sequence ends
   device = 0 for sony 3000		(/dev/tty08)
   device = 1 for sony 5000 (default)	(/dev/tty09)

 CALLS: ***
	command_laser, command_tty2, get_sony_cmd, tbeep [1], tbeep [2], tbeep [3]
 Restrictions:
   1. Must be used on isass3 only (physical port is on isass3)
   2. Assumes lun=1 for I/O.
   3. Reverse step (4d) and reverse slow (4c) gives normal play speeds.
		Timing calculation, therefore, is sometimes off.

 Method:

 Modification History:
   Written,  24-feb-92 - gls
   Modified, 27-aug-92, JRL:  Fixed the delay times, some of the logic.
	18-Jun-93 (MDM) - Removed print statments
			- Made default W1 wait 0 seconds
   GLS - 26-apr-94 - Replaced 'printf' with calls to command_tty2
		      which calls a modified version of call_tty
		      - this was necessary after Ultrix upgrade
   28-jan-95, JRL, Added beep keyword.  Changed to call get_sony_cmd
    2-Feb-95, JRL, Modified to be consistent with new get_sony_cmd
    2-Mar-95, LS,  modified the ports for the DEC alpha and terminal server
   30-May-96, GAL, Found the working version of this routine in Greg's 
		personal area, without documentation for the changes.
		It looks like Greg's newer version uses command_laser 
		instead of command_tty2 in most of the commands to the
		sony.


sonyloop2 $SSW/yohkoh/ucon/idl/slater/sonyloop2.pro
[Previous] [Next]
 Name:
   sonyloop2

 Purpose:
   Play a range of frames on the Sony LVR-5000A laser videodisk
   recorder/player an arbitrary number of times

 Calling sequence:
   sonyloop2, f0
   sonyloop2, f0, f1, sec_per_frame=sec_per_frame, reps=reps,
	      reverse=reverse, w1=w1, device=device

 Examples:
   sonyloop2, 5000		; Position to frame 5000
   sonyloop2, 5000, 5200	; Play from 5000 to 5200 at normal speed
   sonyloop2, 5000, 5200, sec=2	; Play a factor of 2 slower
   sonyloop2, 5200, 5000	; Play backwards
   sonyloop2, 5000, 5200, /rev	; Play forward and backwards
   sonyloop2, 5000, 5200, w1=4	; Position to 5000 and pause 4sec, then play
   sonyloop2, 5000, 5200, w2=4	; Pause 4sec after playing
				; If /rev switch is set, w2 wait is applied
				;- before the reverse play starts.

 Input:
   f0, f1 = start and end frames of sequence to play

 Optional Input Keywords:
   sec_per_frame = dwell at each frame in units of 1/30 sec
		    1:255 are acceptable.
		    -1 corresponds to 1/5 speed  (slow forward/reverse)
		    -2 corresponds to 3x normal  (fast forward/reverse)
		    -3 corresponds to normal
   reps = number of playback repeats at each playback speed
   reverse = 0 to jump from last to first frame
           = 1 to reverse play from last frame to first frame
   w1 = wait interval after initial display before sequence begins
   w2 = wait after the sequence ends
   device = 0 for recorder/player	(/dev/tty00)
   device = 1 for player		(/dev/tty01)

 CALLS: ***
	command_tty2
 Restrictions:
   1. Must be used on isass3 only (physical port is on isass3)
   2. Assumes lun=1 for I/O.
   3. Reverse step (4d) and reverse slow (4c) gives normal play speeds.
		Timing calculation, therefore, is sometimes off.

 Method:

 Modification History:
   Written,  24-feb-92 - gls
   Modified, 27-aug-92, JRL:  Fixed the delay times, some of the logic.
	18-Jun-93 (MDM) - Removed print statments
			- Made default W1 wait 0 seconds


soon2fits $SSW/yohkoh/gen/idl/gbo/soon2fits.pro
[Previous] [Next]
NAME:
	soon2fits
PURPOSE:
	Take a SOON tape and extract certain images into FITS files.
SAMPLE CALLING SEQUENCE:
	soon2fits, 1
	soon2fits, 1, [4,5,6]
	soon2fits, tape_files, image_list, dev=dev
OPTIONAL INPUT:
	tape_files - The tape file numbers to extract.  If omitted, it
		     will read all files.  Start counting at 1.
	image_list - The images to extract for that tape file.  If omitted,
		     it will extract all images.  First image is 1.
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], GSN_INFO, anytim2ex [1]
	anytim2ex [2], concat_dir [4], def_tapd [1], def_tapd [2], def_tapd [3]
	ex2fid [1], ex2fid [2], mtcmd [1], mtcmd [2], wrt_fits [1], wrt_fits [2]
OPTIONAL KEYWORD INPUT:
	dev	- The device number.  If not defined, it uses dev=0
	offline	- Eject the tape after reading
	eject	- Eject the tape after reading
	outdir	- The output directory.  The default is the directory
		  which you are running from.
METHOD:
	For every TAPE file, there is a 240 (or 120) byte file in front
	and in back of the tape file.  So it is:
		Junk File1 Junk Junk File2 Junk Junk File3
	Those "junk" files are the VMS FILES11 beginning of file and
	end of file headers.
HISTORY:
	Written 28-Jul-93 by M.Morrison
	 3-Aug-94 (MDM) - Added /EJECT
			- Corrected some logic (allowed backward positioning 
			  to work properly)
			- Sorted the "tapefiles" list to do them in order


soon_sea [2] $SSW/yohkoh/gen/idl/gbo/soon_sea.pro
[Previous] [Next]
NAME:
	soon_sea
PURPOSE:
	TO allow access to the SOON catalog
CALLING SEQUENCE:
	.run soon_sea
HISTORY:
	Written 5-Aug-94 by M.Morrison
	23-Sep-94 (MDM) - Changed start/stop time format statement
			- Change "LI" option to allow user to select
			  which tape files to list
			- Added "SI" option to do per image listing of
			  search results.
	19-Apr-95 (MDM) - Adjusted to work to search for full disk
			  images without specifying a region
			- Corrected some catalog selection problems
			  (it wasn't parsing the times properly)
	25-Apr-95 (MDM) - Corrected error where full disk searches
			  were not being reset.


soon_search [3] $SSW/yohkoh/gen/idl/gbo/soon_search.pro
[Previous] [Next]
NAME:
	soon_search

PURPOSE:
	search the SOON catalog 

CALLING EXAMPLES:
       soon_search, starttime, endtime ,/full_disk [,/mail, address='emailadd']
       soon_search, starttime, endtime ,helio='N12W12',ref_date='9-Jul-94'
       soon_search, starttime, endtime ,helio='N12W12',ref_date='9-Jul-94', $
				gif_file="gifname"

 CALLS: ***
	ARR2STR [1], Arr2Str [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	FILE_SELTIME, anytim2ints [1], anytim2ints [2], concat_dir [4], data_chk [1]
	data_chk [2], file_append [1], file_append [2], get_host [1], get_host [2]
	get_user [1], get_user [2], gt_day [1], gt_day [2], in_fov, mail [1], mail [2]
	plot_gsn, pr_gsn [1], pr_gsn [2], rd_gsn, rd_tfile [1], rd_tfile [2], strspecial [1]
	strspecial [2], tbeep [1], tbeep [2], tbeep [3], tim2match [1], tim2match [2]
	tim2match [3]
 CALLED BY:
	soon_search_www
HISTORY:
       23-may-1995 (SLF) - Paramaterized MDM soon_sea (main program)
       14-jul-1995 (SLF) - add gif_file keyword (passed to plot_gsn)
       21-jul-1995 (SLF) - add image_list keyword and function
       24-apr-1996 (SLF) - work around bug in file_seltime
       26-apr-1996 (SLF) - add AR keyword and function
        6-Jun-1996 (SLF) - expand AR search (allow SN..., etc)


SORT_FILES $SSW/yohkoh/ucon/idl/bentley/sort_files.pro
[Previous] [Next]
 NAME:
       SORT_FILES
 PURPOSE:
       Finds and sorts Yohkoh files (by time order) that may be stored out 
       of order.
 CATEGORY:
 CALLING SEQUENCE:
       files = sort_files(fstring)
 INPUTS:
       fstring         string to use for search
 OPTIONAL INPUT PARAMETERS:
 KEYWORD PARAMETERS:
 OUTPUTS:
       files           string array conatining sorted files (includes
                       directory information)
 OPTIONAL OUTPUT PARAMETERS:
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DATA_PATHS, break_file [4], concat_dir [4]
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
       Searches using data_paths unless directory already specified
 MODIFICATION HISTORY:
       RDB  26-JAN-94  Written


soup_info $SSW/yohkoh/gen/idl/gbo/soup_info.pro
[Previous] [Next]
NAME:
	soup_info
PURPOSE:
	To create a summary text line of the information in the SOUP header
SAMPLE CALLING SEQUENCE:
	print, soup_info(header)
	info_array = soup_info(head)
INPUT:
	header	- The SOUP header structure
OUTPUT:
	returns a string array with the descriptor
 CALLS: ***
	fmt_tim [1], fmt_tim [2], moreidl [1], moreidl [2]
HISTORY:
	Written 16-Apr-93 by M.Morrison


soup_obs2 $SSW/yohkoh/gen/idl/gbo/soup_obs2.pro
[Previous] [Next]
NAME:
	soup_obs2
PURPOSE:
	To plot when images are taken for each of the particular
	wavelength/offset.
CALLING SEQUENCE:
	soup_obs2, head
	soup_obs2, head, sel, ss
	soup_obs2, head, roadmap=roadmap
INPUT:
	header	- The header structure
OPTIONAL OUTPUT:
	selimg	- If present, the user is prompted to mark a
		  starting and ending time of interest.  The value
                 returned is an array of the same length as
                 the input array with the selected datasets
                 having a "1".  The way to use this value is
                 something like the following:
                       ss = where(selimg)
                       ss = where(selimg and (roadmap.percentd eq 255))
       ss      - Return the list of indicies that were selected.
                 This should be used only if you do not want to
                 do other searches using the "where" function.
 CALLS: ***
	LPRINT, UNIQ [1], UNIQ [2], UNIQ [3], UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4]
	UTPLOT [5], UTPLOT [6], draw_boxcorn [1], draw_boxcorn [2], int2secarr [1]
	int2secarr [2], plot_lcur [1], plot_lcur [2]
HISTORY:
	Written 16-Apr-93 by M.Morrison (using SOUP_OBS as a start)


soupdat $SSW/yohkoh/gen/idl/gbo/soupdat.pro
[Previous] [Next]
NAME:
	soupdat
PURPOSE:
	To act like the program YODAT for accessing SOUP data
HISTORY:
	Written 8-Mar-93 by M.Morrison
	16-Apr-93 (MDM) - Added SOUP_OBS2


SP_COMMON $SSW/yohkoh/ucon/idl/zarro/sp_common.pro
[Previous] [Next]
 Project     : SOHO - CDS

 Name        : SP_COMMON

 Purpose     : Contains common blocks used by SCANPATH.

 Explanation : This is not a procedure as such, but contains the common blocks
		used by SCANPATH and associated routines.

 Common      : Contains the common blocks SCANPATH, LIB_STUFF and PROCB.

 Category    : Documentation, Online_help.

 Prev. Hist. : See SCANPATH.

 Written     : D. Zarro, GSFC/SDAC, 1993.

 Modified    : Version 1, William Thompson, GSFC, 23 April 1993.
			Renamed to SP_COMMON for DOS compatibility, and
			incorporated into CDS library.
               Version 2, Dominic Zarro, GSFC, 1 August 1994.
                       Added additional common block (DEVICE) and
                       extended common block SCANPATH to accomodate
                       the new independent procedure widget base
               Version 2.1, Dominic Zarro, GSFC, 3 September 1994.
                       Added SEARCH common block
 Version     : Version 2.1, 1 August 1993.


sparse [2] $SSW/yohkoh/gen/galileo/idl/lmsal/sparse.pro
[Previous] [Next]
   Name: sparse

   Purpose: treat sparse matrices as stream for memory conservation

	     For example, for large array which is mostly zeros, store
	     only the non-zero values.

   Input Paramters:
      input - if structure, convert sparse structure to array
	       if array,   , convert array to sparse structure
      index - (optional) only convert specified index (must be scalar)

   Input Keyword Parameters:
      lowcut  - low value cutoff  (currently,only used with data->structure) 
      highcut - high value cutoff (currently,only used with data->structure) 
   
   Calling Sequence:
       structure=sparse(data [,lowcut=lowcut,highcut=highcut])
	structure=sparse(data)	; sparse data array in, sparse structure out
	structure=sparse(data,low=1)	; Save values where data ge 1
	
	data=sparse(structure)  ; sparse structure in, sparse data array out
	data=sparse(structure,index) ; 3D arrays only, only specified 2D out  
				     ; Index is the index of the 3rd dimension.

 CALLED BY:
	SXT_PREP0, ffi_prep, sxt_satpix [1], sxt_satpix [2]
   History:
      slf - 24-feb-1993 -- Minor mods by JRL

 CALLS: ***
	FMT_TAG [1], FMT_TAG [2], MAKE_STR [1], MAKE_STR [2]
   Restrictions:
      proto - needs some more type/data size checking


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

   Purpose: treat sparse matrices as stream for memory conservation

	     For example, for large array which is mostly zeros, store
	     only the non-zero values.

   Input Paramters:
      input - if structure, convert sparse structure to array
	       if array,   , convert array to sparse structure
      index - (optional) only convert specified index (must be scalar)

   Input Keyword Parameters:
      lowcut  - low value cutoff  (currently,only used with data->structure) 
      highcut - high value cutoff (currently,only used with data->structure) 
   
   Calling Sequence:
       structure=sparse(data [,lowcut=lowcut,highcut=highcut])
	structure=sparse(data)	; sparse data array in, sparse structure out
	structure=sparse(data,low=1)	; Save values where data ge 1
	
	data=sparse(structure)  ; sparse structure in, sparse data array out
	data=sparse(structure,index) ; 3D arrays only, only specified 2D out  
				     ; Index is the index of the 3rd dimension.

 CALLED BY:
	SXT_PREP0, ffi_prep, sxt_satpix [1], sxt_satpix [2]
   History:
      slf - 24-feb-1993 -- Minor mods by JRL

 CALLS: ***
	FMT_TAG [1], FMT_TAG [2], MAKE_STR [1], MAKE_STR [2]
   Restrictions:
      proto - needs some more type/data size checking


SPARTAN_PLANNER $SSW/yohkoh/ucon/idl/hudson/spartan_planner.pro
[Previous] [Next]
 NAME:
     SPARTAN_PLANNER
 PURPOSE:
     Sketch out the Spartan/Yohkoh time line for observations. Very
       ad hoc, must edit for every little change
 CATEGORY:
     Yohkoh
 CALLING SEQUENCE:
     spartan_planner, deltat
 INPUTS:
     deltat is the delay in hours from 13-Sep 19:45 UT for observation start
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     /early starts the plot early for the benefit of chief observers
 OUTPUTS:
 CALLS: ***
	FMT_TIMER [1], FMT_TIMER [2], OUTPLOT [1], OUTPLOT [2], OUTPLOT [3], UTPLOT [1]
	UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5]
 COMMON BLOCKS:
 SIDE EFFECTS:
     makes a plot in your current window
 RESTRICTIONS:
 MODIFICATION HISTORY:
     HSH, written 8-sep-94
     HSH, added parameter for Shuttle slippage 10-sep-94
     HSH, added the most recent times 12-sep-94


spatial_dem $SSW/yohkoh/ucon/idl/mctiernan/spatial_dem.pro
[Previous] [Next]
 NAME:
      spatial_dem
 PURPOSE:
      Creates a 'spatial DEM' for an SXT image, or set of images.
      This sums up all of the em's in individual temperature bins.
 CALLING SEQUENCE:
      dem47 = spatial_dem(te0, em0, t6_arr, t6_edges=t6_edges, n_t6bins=n_t6bins, $
              t6_binsize = t6_binsize, t6_max = t6_max, t6_min = t6_min)
 INPUT:
      te0 = Log(T), can be any array
      em0 = Log(EM), must be the same size as te0
 OUTPUT:
      dem47 = the DEM the emisison measure in each temperature bin
      t6_arr= the temperature array that the dem is defined on, the
              midpoints of the temperature bins.
 KEYWORDS:
      t6_edges= The bin edges for the T bins (OUTPUT)
      n_t6bins= the number of bins, if passed in, then there will
                be this many bins, either between the values of
                t6_max and t6_min, or if t6_binsize is passed in,
                then from t6_min to n_t6bins*t6_binsize
      t6_binsize= The binsize for the T bins, the default is 1.0
      t6_max= The max. temperature for the T bins, the default is the
              bin edge above the max. of te0
      t6_min = The min. temperature FOR the T bins, the default is the
               minimum value of te0
 CALLED BY:
	multi_spatial_dem
 HISTORY:
      26-jan-96, jmm


spc_struct V09 $SSW/yohkoh/bcs/idl/bsd/spc_struct.pro
[Previous] [Next]
	NAME:
		spc_struct  V0.9
	PURPOSE:
		Define structures for reading/writing SPC files

	CALLING SEQUENCE:
		SPC_struct
 CALLS: ***
	SPC_STRUCT
	HISTORY:
		wrote for spc files by atp 6/7/92 (july)
		cleanup/rationalisation of version numbers atp 7/7/92

       notes: 
		** in the descriptor field of an entry will 
                indicate that this entry is not in the file.


SPEX_ENV [5] $SSW/yohkoh/ucon/idl/schwartz/spex_env.pro
[Previous] [Next]
 PROJECT: SDAC

 NAME: SPEX_ENV
	
 PURPOSE: install the SPEX environmentals and path locally, 
	Two software directories needed are installed at the top of the path.	
 CALLING SEQUENCE:
	Spex_env [,old_path=old_path]

 CALLS: ***
	ARR2STR [1], Arr2Str [2], CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], FCHECK, STR_SEP, concat_dir [4]
 MODIFICATION HISTORY:
	ras, 21-apr-94
	RAS, 14-OCT-94	
	ras, 13-jan-96, installation at ISAS
	RAS, 15-jan-96, support ISAS and SSL from same script
	RAS, 16-May-1997, change SSL paths.  Soon to be obsolete, use SSW site setups!


spfdgrs $SSW/yohkoh/ucon/idl/sato/spfdgrs.pro
[Previous] [Next]
  NAME:
       spfdgrs.pro
  PURPOSE:
       Spawn spfdgrs program.
       See Yohkoh WBS manual.
  OPTIONAL INPUT:
       disp - if set, write the fitting results on terminal.
  HISTORY:
       Written 7-Jan-94 by T.Hiraoka,K.Morimoto


spfdhxs $SSW/yohkoh/ucon/idl/sato/spfdhxs.pro
[Previous] [Next]
  NAME:
       spfdhxs.pro
  PURPOSE:
       Spawn spfdhxs program.
       See Yohkoh WBS manual.
  OPTIONAL INPUT:
       disp - if set, write the fitting results on terminal.
  HISTORY:
       Written 7-Jan-94 by J.Sato,K.Morimoto


SPFDPLOT_GRS $SSW/yohkoh/ucon/idl/hiraoka/spfdplot_grs.pro
[Previous] [Next]

 NAME:
       SPFDPLOT_GRS
 PURPOSE:
       To plot grs spectrum data for spfd.
 CALLING SEQUENCE:
       spfdplot_grs,spfd
       spfdplot_grs,spfd,/datasp
       spfdplot_grs,spfd,/model
       spfdplot_grs,spfd,/residual
       spfdplot_grs,spfd,/chimap
       spfdplot_grs,spfd,comp=0
 INPUTS:
       spfd   - SPFD_GRS structure. After the run of read_spfdgrs and
                the extract of spfd.
 OPTIONAL INPUTS:
       ( If no optional input, the data spectrum, the model spectrum
         and the residuals divided by sigma are plotted. )
       datasp - If set, only the data spectrum is plotted.
       model  - If set, only the model spectrum is plotted.
       residual - If set, only the residuals divided by sigma are plotted.
       chimap - If set, only the chi-square contour map is plotted.
       comp   - Number attached spectral component. If present, 
                only one spectal component is plotted.
       notitle - If set, no title is plotted.
       cm2    - If set, a unit of flux is counts/cm**2/sec/keV. If not set,
                a unit of flux is counts/sec/keV.
       photon - If set, a unit of flux is photon/cm**2/sec/keV.
       yrange - If present, the data points below (above) yrange(0)
                (yrange(1)) are plotted at the yrange(0) (yrange(1)).
 PROCEDURE:
       Photon flux is calculated from [count flux]x[conversion factor].
       The conversion factor is the ratio of photon to count given
       by fitting model spectrum.
 CALLS: ***
	ERRPLOT [1], ERRPLOT [2], FCHECK, GET_KBRD2
 RESTRICTIONS:
       One of five optional inputs,'datasp','model,'residual','comp'
       and 'chimap' can be set.
 HISTORY:
       Written 14-dec-93 by T.Hiraoka ( Rikkyo Univ.)


SPFDPLOT_HXS $SSW/yohkoh/ucon/idl/hiraoka/spfdplot_hxs.pro
[Previous] [Next]

 NAME:
       SPFDPLOT_HXS
 PURPOSE:
       To plot hxs spectrum data for spfd.
 CALLING SEQUENCE:
       spfdplot_hxs,spfd
       spfdplot_hxs,spfd,/datasp
       spfdplot_hxs,spfd,/model
       spfdplot_hxs,spfd,/residual
       spfdplot_hxs,spfd,/chimap
       spfdplot_hxs,spfd,comp=0
 INPUTS:
       spfd   - SPFD_HXS structure. After the run of read_spfdhxs and
                the extract of spfd.
 OPTIONAL INPUTS:
       ( If no optional input, the data spectrum, the model spectrum
         and the residual divided by sigma are plotted. )
       datasp - If set, only the data spectrum is plotted.
       model  - If set, only the model spectrum is plotted.
       residual - If set, only the residuals divided by sigma are plotted.
       chimap - If set, only the chi-square contour map is plotted.
       comp   - Number attached spectral component. If present, 
                only one spectal component is plotted.
       notitle - If set, no title is plotted.
       cm2    - If set, a unit of flux is counts/cm**2/sec/keV. If not set,
                a unit of flux is counts/sec/keV.
       photon - If set, a unit of flux is photon/cm**2/sec/keV.
       yrange - If present, the data points below (above) yrange(0)
                (yrange(1)) are plotted at the yrange(0) (yrange(1)).
 PROCEDURE:
       Photon flux is calculated from [count flux]x[conversion factor].
       The conversion factor is the ratio of photon to count given
       by fitting model spectrum.
 CALLS: ***
	ERRPLOT [1], ERRPLOT [2], FCHECK, GET_KBRD2
 RESTRICTIONS:
       One of five optional inputs,'datasp','model,'residual','comp'
       and 'chimap' can be set.
 HISTORY:
       Written 14-dec-93 by T.Hiraoka ( Rikkyo Univ.)
       Updated 20-dec-93 by T.Hiraoka ; added photon option.


sphere_dist $SSW/yohkoh/ucon/idl/hudson/sphere_dist.pro
[Previous] [Next]
 NAME:
    sphere_dist
 PURPOSE:
    angular separation on shpere
 CATEGORY:
 CALLING SEQUENCE:
    distance = sphere_dist(alpha1, delta1, alpha2, delta2)
 INPUTS:
    alpha, delta the longitude and colatitude in degrees
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED
 OUTPUTS:
    angle from 1 to 2 in degrees
 CALLED BY:
	BURSTER_POSITION
 COMMON BLOCKS:
 SIDE EFFECTS:
    seems to have errors of .03 degrees sometimes!
 RESTRICTIONS:
 MODIFICATION HISTORY:
    HSH 12-Mar-96


spike_1d_id $SSW/yohkoh/ucon/idl/acton/spike_1d_id.pro
[Previous] [Next]
       NAME: spike_1d_id

       PURPOSE: To locate single element spikes in 1-D arrays.

       METHOD: Default uses a boxcar smoothing filter as a 
		reference, takes the difference and compares it with the
		cutoff value. The returned variable is a vector of pointers 
		to spikes (both - and +) in the input variable.
		  [Unless "pos" or "neg" are set.]
	    -- For many applications it is best to use ALOG(ARRAY)
	       so that the search is done as a change in a
	       multiplicative factor rather than an additive term.

       CALLING SEQUENCE:
		out = spike_1d_id(array,cutoff,[remove=remove,width=width])

       PARAMETERS: 	array 		input array
			cutoff		comparison cutoff

	KEYWORDS:	remove		when set return corrected 
					array
			width		boxcar filter size (default
					is 5).
			pos		remove only + spikes
			neg		remove only - spikes

       HISTORY: LWA, 3/12/94 from spike_id.pro
		Made the test absolute to catch both - and + spikes. 3/15/94.
		Added pos & neg keywords.  3/17/94  LWA


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

       PURPOSE: To locate single pixel spikes, like Cosmic Rays,
		 in 2-D images.

       METHOD: Default uses a three point median  filter as a 
		reference, takes the difference and compares it with the
		cutoff value. The returned variable is a vector of pointers 
		to spikes in the input variable.  Default mode is to remove
		holes and spikes.  Average filter is also available.

       CALLING SEQUENCE:  spikes=(img,cutoff,[remove=remove,width=width,
				average=average, pos=pos, neg=neg])


       PARAMETERS: 	img		input image 
			cutoff		comparison cutoff 

	KEYWORDS:	/remove		when set return corrected 
					image
			width		median filter size (default
					is 3).
			/average	use an average filter instead
					of median.
			/pos		remove only spikes (or bright val)
			/neg		remove only holes (or dark values)
 CALLED BY:
	NAME [3], de_spiker [1], de_spiker [2], despike, sfc_de_spiker, wl_process
					Note: spikes will use -1 * abs(cutoff)
			NOTE:  Default is to remove pos and neg.

	CALLS: ***
	coord_v2l
       HISTORY: Drafted by A.McAllister, following a B.Labonte
		 algorythm, 10-jun-93.
		 Added code to handle borders, and keyword to
		 return corrected image, 2-jul-93.
		 trap for no spikes, 9-aug-93.
		 added control to filter size (default is the orginal
		 value of 3), also added absolute value on difference
		 12-Jan-94, gal
		 17-Mar-94, gal, added average filter, options for removal
		 of only pos or neg; keeping the default mode as removing
		 both pos and neg.
	12-dec-94, JRL, Changed code to make /pos and /neg options work.
		        Improved the interpretation of input keywords.
			Fixed the /remove option (now consistent with de_spiker).


spikes_off $SSW/yohkoh/ucon/idl/acton/spikes_off.pro
[Previous] [Next]
 NAME:
  spikes_off

 PURPOSE:
  Remove spikes and streaks (e.g., SAA, dark spikes) in a data array.

 CALLING SEQUENCE:
  spikes_off,data,level,out [,ups,downs,neg=neg,both=both,width=width]
  spikes_off,data,25,clean_array -- removes positive spikes only
  spikes_off,data,7,clean_array,/neg -- removes negative spikes only
  spikes_off,data,10,clean_array,ups,downs,/both -- removes 
     both + and - spikes and returns spike ID array of both types

 INPUTS:
  data = image or image cube of any type
  level = amplitude of spike to be removed
	(try 10 to start and move up or down by experiment)

 OPTIONAL INPUT KEYWORDS:
  neg, set this keyword to remove negative spikes from 
	dark frame subtraction, etc.
  both, set this keyword to remove both + and - spikes to
       amplitude set by level.
  width, width of smoothing in call to median, default = 3

 OUTPUTS:
  clean_array = the data array cleaned of spikes.
  ups = the ID array of the location of positive spikes
  downs = the ID array of the location of negative spikes

 ADVICE
  I have found that it is sometimes necessary to put the data through the
  	program 2 or 3 times to achieve maximum cleaning.
  For single SXT images, level = 7 is a reasonable value.
  For composite images with their greater dynamic range try 25.
  A good check on whether real data are being affected is to do the
	following test:
		test = original_image - clean_image
		tvscl,test
	If the pattern of pixels in the test image does not reflect any of
	the structure of the solar image it is safe to assume the cleaning 
	is OK.
  It is also useful to ask for the ups and downs in the call and do
               test = bytarr(xs,ys) where xs and ys are the dimensions
			of one of the images in your array.
               test(downs) = 1
               test(ups)   = 2
               tvscl, test
  This shows which pixels were modified in the last image processed

 CALLS: ***
	sfd_comp, spike_id
 CALLED BY:
	WL_CUBE_II, mk_sun_mosaic
 MODIFICATION HISTORY:
   September-93, L. Acton, driver for SPIKES.PRO.
   October-93, LWA, added keyword "both"
   March-94, LWA, added feature to do spike ID on SFD_COMPRESSED image
	if a non_byte image is passed in.  Also had to create
	spike_id.pro and call it in order to keep the ups/downs/both 
	feature of my program.  Changed the program to a procedure
	and added the ability to return the spike ID arrays.
   3/9/94 put "NO SPIKES" messages outside of loop.  LWA


SPLINE_LC $SSW/yohkoh/ucon/idl/shimizu/spline_lc.pro
[Previous] [Next]
 NAME: 
      SPLINE_LC
 PROCEDURE:
      Fit SPLINE curve on the SXT light curve.
 INPUTS:
      lc - values of intensity. one dimension.
      index - sxt index corresponding to "lc"
 OPTINAL INPUTS:
      maxdn - Maximum increased intensity (DN/sec).
      maxtm - Time at the maximum intensity (DD-MMM-YY  HHMMSS, string)
      backdn - Background intensity (DN/sec).
      backtm - Time at the background data (DD-MMM-YY  HHMMSS, string)
      lifetime - calcurated LIFETIME (min.).
 OUTPUTS:
      result - result of SPLINE cureve,
      x - vector of abcissae value(unit is min.), coresponding to
    result.
 CALLS: ***
	Int2Ex [1], Int2Ex [2], PLOT_VLINE, SPLINE_PLOT, fmt_tim [1], fmt_tim [2]
	gt_day [1], gt_day [2], gt_time [1], gt_time [2]
 SIDE EFFECTS:
      Plot "lc" vs time using UTPLOT. Then overlay the
    SPLINE cureve on "lc" plot.
 RESTRICTION:
      Spline curve is calculated every 6 sec.
 HISTORY:
      19 Sep, 92  written by T.Shimizu
      10 June,93  Add the options "maxdn", "maxtm", "backtm" and "lifetime"
      13 June,93  Revise due to Bags.
                  Add the option "backdn".


SPLINE_PLOT $SSW/yohkoh/ucon/idl/shimizu/spline_plot.pro
[Previous] [Next]
 NAME: 
      SPLINE_PLOT
 CALLED BY:
	SPLINE_LC
 PROCEDURE:
      Fit SPLINE curve on the SXT light curve.
 INPUTS:
      lc - values of intensity. one dimension.
      index - sxt index corresponding to "lc"
 OPTINAL INPUTS:
   %NO YET   timestep - Change the step value for SPLINE curve fitting. 
                Default value is every 6 sec.
 OUTPUTS:
      result - result of SPLINE curve,
      x - vector of abcissae value(unit is min.), coresponding to
    result.
 CALLS: ***
	OUTPLOT [1], OUTPLOT [2], OUTPLOT [3], SPLINE, UTPLOT [1], UTPLOT [2], UTPLOT [3]
	UTPLOT [4], UTPLOT [5], UTPLOT [6], gt_day [1], gt_day [2], gt_time [1], gt_time [2]
 SIDE EFFECTS:
      Plot "lc" vs time using UTPLOT. Then overlay the
    SPLINE cureve on "lc" plot.
 RESTRICTION:
      Spline curve is calculated every 6 sec.
 HISTORY:
      19 Sep, 92  written by T.Shimizu
	6 Nov, 94  to allow to plot over 2 days.


Split_w_h $SSW/yohkoh/gen/idl/dbase/split_w_h.pro
[Previous] [Next]
	NAME:
		Split_w_h
	PURPOSE:
		Split w_h logical record into two logical records:
		hxt and wbs.
	CALLING SEQUENCE:
		Split_w_h, w_h, [HXT=hxt, WBS=wbs]
	INPUT:
		w_h	logical record vector for hxt and wbs.
	OUTPUT/Keyword:
		hxt	logical record vector for hxt
		wbs	logical record vector for wbs
 CALLED BY:
	RdObsDat
	HISTORY:
		written 19-Aug-91, by GAL


SPLITSTR $SSW/yohkoh/ucon/idl/metcalf/splitstr.pro
[Previous] [Next]
NAME:
     SPLITSTR
PURPOSE:
     Split a string into an array at specified character boundary
CATEGORY:
CALLING SEQUENCE:
     array = splitstr(string,character)
INPUTS:
     string = string to be split
     character = character to split string on
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
OUTPUTS:
     array = string array
 CALLED BY:
	Check the ATT database vs the SXC limb fit database to look for bad
	HXT_AUTOIMG, SXT_BAKEOUT_IN, makestr
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
     character must be a single character string, e.g. ' ' or 'a'
PROCEDURE:
EXAMPLES:
     array = splitstr('Hi There',' ')
     array(0) is 'Hi'
     array(1) is 'There'
MODIFICATION HISTORY:
     T. Metcalf 1994-11-10
     1995-03-15 Increased speed by a factor 3!


SPOTTER $SSW/yohkoh/ucon/idl/hudson/spotter.pro
[Previous] [Next]
 NAME:
       SPOTTER 
 PURPOSE:
 	Interactively define a sunspot, and then compute its centroid
	  location. This is done sequentially for each image in a data
         cube. The intended use is for measuring relative proper motions
         of sunspots within a given sunspot group. Decompression needs
         to have been done. 
 CALLING SEQUENCE:
       spotter, img, index, xx, yy, boxes
 INPUT PARAMETERS:
       Image array, integer format.
 OUTPUT PARAMETERS:
       Centroid coordinates xx,yy in the pixel definition of the images.
       Box definitions in original pixels.
 WARNINGS:
	Expect subjectivity!
	Rotation correction isn't very good - need to use HEL2PIX.
 KEYWORDS:
 SPECIAL TRICKS:
	To define the centroid, the mean of the peripheral pixels
 	  of the selected box is used as a photometric reference, 
	  i.e. as the background level.
 CALLS: ***
	CENTROIDW [1], CENTROIDW [2], GET_BOXCORN, HXA_SUNCENTER, draw_boxcorn [1]
	draw_boxcorn [2]
 HISTORY:
	HSH, written Dec. 24, 1992


SPPLOT_GRS $SSW/yohkoh/ucon/idl/hiraoka/spplot_grs.pro
[Previous] [Next]

 NAME:
       SPPLOT_GRS
 PURPOSE:
       To plot the spectrum of WBS grs_phl.
 CALLING SEQUENCE:
       spplot_grs,flph,bgph
       spplot_grs,flph
         ( If you do not extract the background data, no background-
           subtracted data are plotted. )
 INPUTS:
       flph - WBS_GRSPHL structure. ( flare data )
       bgph - WBS_GRSPHL structure. ( background data )
         ( after the run of out_grsphl1 or out_grsphl2 and the extract of
           'flph','bgph'. )
 OPTIONAL INPUTS:
       cm2  - If set, the unit of flux is counts/cm**2/sec/keV.
              Usually, counts/sec/keV.
       notitle - If set, no title is plotted.
         ( title, xtitle, ytitle, etc.. )
       noerr - If set, error bars are not plotted.
       yrange - If present, the data points below (above) yrange(0)
                (yrange(1)) are plotted at the yrange(0) (yrange(1)).
 CALLS: ***
	ERRPLOT [1], ERRPLOT [2], FCHECK, GET_KBRD2
 CALLED BY:
	TEST_OUTG
 HISTORY:
       Written 10-dec-93 by T.Hiraoka ( Rikkyo Univ.)


SPPLOT_HXS $SSW/yohkoh/ucon/idl/hiraoka/spplot_hxs.pro
[Previous] [Next]

 NAME:
       SPPLOT_HXS
 PURPOSE:
       To plot the spectrum of WBS hxs_ph.
 CALLING SEQUENCE:
       spplot_hxs,flph,bgph
       spplot_hxs,flph
         ( If you do not extract the background data, no background-
           subtracted data are plotted. )
 INPUTS:
       flph - WBS_HXSPH structure. ( flare data )
       bgph - WBS_HXSPH structure. ( background data )
         ( after the run of out_hxsph and the extract of 'flph','bgph'. )
 OPTIONAL INPUTS:
       cm2  - If set, the unit of flux is counts/cm**2/sec/keV.
              Usually, counts/sec/keV.
       notitle - If set, no title is plotted.
         ( title, xtitle, ytitle, etc.. )
       noerr - If set, error bars are not plotted.
       yrange - If present, the data points below (above) yrange(0)
                (yrange(1)) are plotted at the yrange(0) (yrange(1)).
 CALLS: ***
	ERRPLOT [1], ERRPLOT [2], FCHECK, GET_KBRD2
 CALLED BY:
	TEST_OUTH
 HISTORY:
       Written 10-dec-93 by T.Hiraoka ( Rikkyo Univ.)


SQRT2_LEV $SSW/yohkoh/ucon/idl/sakao/sqrt2_lev.pro
[Previous] [Next]
 NAME:
	SQRT2_LEV
 PURPOSE:
	To give contour levels with sqrt(2) step.
 CALLING SEQUENCE:
	level = sqrt2_lev(image)
 INPUT:
	image	- Image which is to be expressed by contours.
 CALLED BY:
	PLOT_CINEMA2
 OPTIONAL KEYWORD INPUT:
	weak	- If set, then also displays 4.4, 6.25, and 8.8 % levels.
	nlevels - Specifies number of contour levels.
 OUTPUT:
	level	- Contour levels with sqrt(2) step.
 OPTIONAL KEYOWORD OUTPUT:
	none
 RESTRICTIONS:
	none
 HISTORY:
	version 1.0	94.07.27 (Wed)	T.Sakao written at MSSL.
	version 1.1	94.07.29 (Fri)
		Option nlevels added.


SS2DSET $SSW/yohkoh/bcs/idl/util/ss2dset.pro
[Previous] [Next]
 NAME:
	SS2DSET
 PURPOSE:
	Given an SS array for a single file, this routine returns the
	structure required for DSET_ARR
 CALLING SEQUENCE:  
	DSET_ARR = ss2dset(ss)
 INPUT:
	ss	array of required records (from a single file)
 OUTPUT:
	structure needed for DSET_ARR. 
 OPTIONAL OUTPUT:

 HISTORY
	RDB	Feb 1992	written

 CALLS:


SS_SYMM $SSW/yohkoh/ucon/idl/hudson/ss_symm.pro
[Previous] [Next]
 NAME:
    SS_SYMM
 PURPOSE:
    take an subscript array from DEFROI and generate the
    four symmetrical areas relative to a fixed point [x,y]
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
    ss = subscript array
    xy = location 
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
    /sel allows interactive symmetry-point selection
    /show recopies the image and shows you where the regions are
 OUTPUTS:
    rr = lonarr(4, *) of which rr(0, *) is the input subscripts
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 WARNINGS:
    Watch out for wraparound!
 MODIFICATION HISTORY:
    HSH, written 4-May-97


ssc_files [2] $SSW/yohkoh/gen/galileo/idl/lmsal/ssc_files.pro
[Previous] [Next]
   Name: ssc_files

   Purpose: return SXT ssc (or sss/sxh) file names from user times

   Input Parameters:
      time0 - time to match or start time of range
      time1 - end time of range

   Keyword Parameters:
      count - number of files returned
      topdir - optional top level path (default via env: DIR_SXT_{SSC/SSS/SXH
      sss_files (switch) if set, consider SSS files ("show" movie"
      sxh_files (switch) if set, consider SXH files (histograms)
      extension - ssc processing flags<=>file extension
      collapse - if set, assume all files in top level  
                 (default is yearly subdirect: <toplev>/YYYY/xxxyyyy...
      prefix - specilized file prefix (default is derived from file_type
               uaually 'ssc', 'sss', 'sxh' 
     
 CALLS: ***
	BOX_MESSAGE, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE2TIME, TIME2FILE
	UNIQ [1], UNIQ [2], UNIQ [3], anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], concat_dir [4], data_chk [1], data_chk [2], get_logenv [1]
	get_logenv [2], get_yo_dates [1], get_yo_dates [2], get_yo_dates [3]
	reltime [1], reltime [2], sel_filetimes [1], sel_filetimes [2], strsplit
	tim2dset [1], tim2dset [2], time_window, timegrid
 CALLED BY:
	get_ssc_best, sxt_ssc2file
   History:
      6-July-2000 - S.L.Freeland - helper routine 
      9-May-2001  - S.L.Freeland - add PREFIX keyword
      2-aug-2004 - S.L.Freeland - strsplit -> ssw_strsplit

   Method: 
      ssw standards like anytim, sel_filetimes, get_logenv,...


ssc_files [3] $SSW/yohkoh/sxt/idl/atest/ssc_files.pro
[Previous] [Next]
   Name: ssc_files

   Purpose: return SXT ssc (or sss/sxh) file names from user times

   Input Parameters:
      time0 - time to match or start time of range
      time1 - end time of range

   Keyword Parameters:
      count - number of files returned
      topdir - optional top level path (default via env: DIR_SXT_{SSC/SSS/SXH
      sss_files (switch) if set, consider SSS files ("show" movie"
      sxh_files (switch) if set, consider SXH files (histograms)
      extension - ssc processing flags<=>file extension
      collapse - if set, assume all files in top level  
                 (default is yearly subdirect: <toplev>/YYYY/xxxyyyy...
      prefix - specilized file prefix (default is derived from file_type
               uaually 'ssc', 'sss', 'sxh' 
     
 CALLS: ***
	BOX_MESSAGE, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE2TIME, TIME2FILE
	UNIQ [1], UNIQ [2], UNIQ [3], anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], concat_dir [4], data_chk [1], data_chk [2], get_logenv [1]
	get_logenv [2], get_yo_dates [1], get_yo_dates [2], get_yo_dates [3]
	reltime [1], reltime [2], sel_filetimes [1], sel_filetimes [2], strsplit
	tim2dset [1], tim2dset [2], time_window, timegrid
 CALLED BY:
	get_ssc_best, sxt_ssc2file
   History:
      6-July-2000 - S.L.Freeland - helper routine 
      9-May-2001  - S.L.Freeland - add PREFIX keyword

   Method: 
      ssw standards like anytim, sel_filetimes, get_logenv,...


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

  PURPOSE: Program to compare TermSFC and SynSFC versions
	of SSCs.  

  PROCEDURE
	One day of data are read in according to keyword
	input.  A log scaled 1024x512 data cube,
	with Terms on the left and Syns on the right, is prepared.  
	Initially, all stepper2 output flags are set to 0 which
	means SynSFCs are selected.  However, if keyword(term) has
	been set the flag indices are all set to 1 as it is
	anticipated that most images will use TermSFCs as will
	be the case, e.g., for leak epochs 1 and 2.
	A small AlMg image is displayed in the upper RH corner
	for comparison purposes.

	Selection flags can be toggled in the stepper2.pro fashion.  
	After the selection process is complete an sda data
	file is written from the Term and Syn selections
	combined.  The saved AlMg selections are always SynSFCs.

  CALLING EXAMPLE:
       ssc_scan2,1993,decaday='013',nfils=[0,1],$
          /debug

  INPUT:
	year, year to be analyzed

 CALLS: ***
	LOADCT, RD_XDA [1], RD_XDA [2], STEPPER2 [1], STEPPER2 [2], WDEF [1], WDEF [2]
	curdir [1], curdir [2], gt_filtb, gt_res, safe_log10, sav_sda [1], sav_sda [2]
	sav_sda [3], strwhere, tim2dset [1], tim2dset [2]
  OPTIONAL KEYWORD INPUT:
	month, month to be analyzed, e.g., month='03'
	decaday, month_10day triplet, i.e., '092' 
       nfils, vector of files to be analyzed
	   Default: all available files for that year.
	term, /term selects Al.1 TermSFCS as the initial choice.
	/sscdir, write output to '/disk/yl1/ssc7/'+year+'/'
		else write output to curcurrent directory.
	/nouncert, don"t deal with the uncertainty files (for testing).

  OUTPUT:
	An sda file is written with mixes TermSFC and SynSFC
	usage, as selected, for Al.1 SSCs.

  RESTRICTIONS:
	Hardwired to use /data/yl1/ssc6 and /data/yl1/SynSFC/ssc6.
	Output to either curdir or /data/yl1/ssc7.  In the latter
	case the job must be run as software.

  HISTORY:
	11-Oct-2004 LWA  Created from ssc_scan.pro.
	12-Oct-2004 LWA  Put QR AlMg image in UR corner.
	 8-Nov-2004 LWA  Editted header.


SSDA $SSW/yohkoh/ucon/idl/shimizu/ssda.pro
[Previous] [Next]
 NAME:
	SSDA
 PURPOSE:
	 Obtain correlation coefficient and offset value of "data" 
	to the reference data "ref_data" using SSDA (sequential 
	similarity detection algorithm).
 INPUTS:
	data - data to be aligned to the reference data.
       ref_data - the reference data
 OPTIONAL INPUTS:
	subarea - subarea size (default: 384)
	medium - medium speed calculation option. Obtain the coefficient
	of only 64x64 area in the center.
	fast - fast calculation option. Obtain the coefficient of only 
	32x32 area in the center. If not supplied, it may take more than 
	1 hr to calculate the 2D correlation.   
 OUTPUTS:
 	r - R(a, b) map   See below.
	x_shift - offset value in X direction
	y_shift - offset value in Y direction 
 CALLS: ***
	anytim2ints [1], anytim2ints [2], gt_day [1], gt_day [2], gt_time [1], gt_time [2]
 PROCEDURE:
	SSDA:
	    Obtain the position at the minimum of 
		          N-1    N-1
               R(a, b)= \sigma \sigma |Ia,b(m, n) - T(m, n)|
			  m=0    n=0
	    where Ia,b(m,n) = data, T(m, n)= ref_data
	  See Data Analysis Handbook(ed,Takagi,Univ.of Tokyo) pp708 
	  in detail.
 HISTORY:
 	 8 April, 1994	written by T.Shimizu (Univ. of Tokyo)
	27 April, 1994  debug the calculation time
	27 April, 1994  /fast --> correlation in the center 16x16 area
			/medium -- > correlation in the center 64x64 area
	 3 August, 1994 data, ref_data are normalized.


sswfits_struct [2] $SSW/yohkoh/gen/galileo/idl/lmsal/sswfits_struct.pro
[Previous] [Next]
   Name: sswfits_struct

   Purpose: return "STANDARD" ssw structure  (FITs->IDL mapping)

   Input Parameters:
      number (optional) - number structures returned  - default is one  
  
   Keyword Parameters:
      addfits - switch , if set, include FITS required minimal tags

   Calling Sequence:
      str=sswfits_struct( [number] [/addfits] )

 CALLS: ***
	JOIN_STRUCT [1], JOIN_STRUCT [2]
 CALLED BY:
	STEREO_SIMUL, anahead2struct, fitshead2struct, map2index, struct2ssw, zcheck_hdr
   History:
      15-jan-1997 - S.L. Freeland (from 'eit_struct.pro')
      25-feb-1997 - SSW generic
      10-apr-1998 - add CROTA (CED)
       8-sep-1998 - add EXPTIME and WAVELNTH (CED)
      15-oct-1998 - S.L.Freeland add SOLAR_L0, SOLAR_P, CROTA2,
                    XCEN, YCEN
                    /ADDFITS keyword and function - made version=2
       4-Apr-2000 -  Add CROTACN1 and CROTACN2 (floating)
       5-oct-2005 - S.L.Freeland - add CUNIT1&CUNIT2
                    (World Coord System, Grisen&Calabretta)


sswhere $SSW/yohkoh/sxt/idl/util/sswhere.pro
[Previous] [Next]
 NAME:
       sswhere 

 PURPOSE:
	To produce an SS string for use with YODATroutine.
       Given a roadmap or index of many frames you can select
       a narrower subset. 
       When using index remember that the returned string 
       contains indices into the limited set defined by index,
       NOT the full set defined by roadmap.
          
 CALLING SEQUENCE:
 	ss=sswhere(roadmap)

       or

 	sr=sswhere(index) then ss=ss(sr)
        

 METHOD/OPERATION:

	This routine opens a widget. There is are sliders to set
       the minimum frame percentage and the maximum amount of 
	saturation, and buttons to select the image parameters. 
	The logic is OR within categories, and AND between categories, 
	except for the filters, where you can choose either AND or OR 
	logic, with OR being the default (unless there is only one 
	A filter or one B filter). If you choose AND then you must 
	select a filter in both the A & B lists obtaining frames with 
	that combination of filters. If you choose OR logic you get
	all frames with any of the selected filters, thus you
	only need to select a filter in A or B (if you do both 
	you get all frames with EITHER filter).

       When you have finished setting the buttons, press
       'Test' and you can see how many images match the parameters
       you have selected. Pressing 'Select' will add the currently
       selected images to a cumulative total SS string. You can choose 
       multiple sets of parameters, and the resulting SS strings are
       OR'd together, while the text widget informs you of the total
       images selected so far. Whenever you are done press 'Exit'. 
       If you want to start over press 'Clear'.
       By popular request an 'All' button has been added to the DPE
       list, which sets all the DPE values at once (either on or off).
       Selection of any single DPE value resets this button. 

       You can also call either PLOT_FOV to select the field of view
	or SHOW_OBS3 for selecting the time range. You DO NOT have to
	do either, if you do then these selections are added to the 
	rest of the criterion to give a result. This can be seen with 'test'.
	Each routine has its own CLEAR button which undoes any current
	selection, returning to the default (everything). The general 
	clear button also resets these.           

  	NB: The handling of the image percentage is done with direct
	access to the input structure (in mk_mask) rather than through
	one of the "gt_" routines.

 KEYWORDS:	ar	when set allows post-widget selection of data 
			from a specific active region

 CALLS: ***
	UNIQ [1], UNIQ [2], UNIQ [3], XMANAGER, XMENU [1], XMENU [2], gt_comp, gt_dp_mode [1]
	gt_dp_mode [2], gt_dpe, gt_expmode, gt_filta, gt_filtb, gt_res
 CALLED BY:
	rt_sxtdt
 COMMON: initflg,wdgtid,wdgtlbs,wdgtind,pssbck
        
 HISTORY:
	drafted by A. McAllister, Feb. 1992
       test and clear options added by A.McA., Apr. 1992
       DPEs rearranged and 'All' added, A.McA., May 1992
       Compression buttons added,  A.McA., May 1992.
       Logic switch added, A.McA., July 1992.
       DP Mode option added, A.McA., Nov. 1992.
	Rearranged layout, made single choice defaults, A.McA., Jan. 1993.
	Added option to call PLOT_FOV and SHOW_OBS3, added saturation
	        slider, changed default logic to 'OR', A.McA., Mar. 1993.
	Added AR option as a tag on at the end, A.McA., June 1993.
	Corrected the indexing in the mduval for loops, A.McA., Jan. 1994.
	Corrected "no saturation" message display, A.McA., Mar. 1995. 
	Trapped for single DPE value error, A.McA., Apr. 1996.
       Merged SLF 28-Oct-1993 change (use /original in call to get_res)
       RDB  7-Jan-97  Changed layout to fix problem of too big a widget: 
               more columns in DPE; Clears of FOV and Time/Seq in row; 
               test/select/clear boxed; message box _after_ test/select etc. 
               *** Conditional (on IDL version) call to XMANAGER - /block keyword
 
 TO DO:
       PFI options?
       'All' buttons on the filters? Perhaps if there are alot?
       Change calling sequence for index to include ss and create
       a real ss as output?


sswstruct_fill [2] $SSW/yohkoh/gen/galileo/idl/lmsal/ssw_structfill.pro
[Previous] [Next]
   Name: sswstruct_fill

   Purpose: fill missing SSW tags , if possible

 CALLED BY:
	struct2ssw
   History:
      24-October-1998 - S.L.Freeland - combine common function
      25-October-1998 - S.L.Freeland - allow explicit pass via keyword inherit
      27-November-1998 - D.M. Zarro - made more FITS standard compliant
      2-December-1998 - Zarro - removed case block for modifying CRVAL
                        as this caused downstream problems.
      7-Januaray-1999 - S.L.Freeland - auto flip date if DATE-OBS
                        uses old FITS standard
     12-Januaray-1999 - S.L.Freeland - fill in HXT/HXI part
     20-Januaray-1999 - S.L.Freeland - fix variable typo name for HXI conv.
     25-feb-1999 - S.L.Freeland - add CROTA for sxt
      2-Mar-1999 - S.L.Freeland - use 'str2number' instead of st2num
                                  for DATE-OBS/TIME-OBS->SSW check
     17-apr-1999 - S.L.Freeland - check SXT history for roll correction
     22-apr-1999 - S.L.Freeland - pass ROLL/CROTA->gt_center
     11-aug-1999 - S.L.Freeland - fixed a logic error in XCEN/YCEN->ssw derivation
     8-Oct-2001 - Zarro (EITI/GSFC) - added logic that if roll correction
                is not applied, then do not roll center fov
    18-Mar-2002 - S.L.Freeland - relax DATE_OBS verification (iso change?)
    24-Nov-2002 - Zarro(EER)/Biesecker(NOAA) - fixed degenerate structure dimension error
     5-Oct-2004 - CUNIT1&CUNIT2 for sxt/hxi

   Input Parameters:
      sswstr - Structure vector, usually including SSW standards

   Keyword Parameters:
      nosolar    - if set, do not fill in Solar ephemeris tags
      notime     - if set, do not fill in Time tags
      nopointing - if set, do not fill in Pointing tags
      xxx=value  - where XXX =standard tag name, fill with VALUE

   Category:
      structure , SSW , time , alignment


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

   Purpose: get staggered label coordinates for auto-label positioning

   Calling Sequence:
      norm_pos=stag_lab(labels [,min=min, max=max, sep=sep])

 CALLED BY:
	show_contacts
   History:
      10-apr-1995 (SLF) - for evt_grid use


STAT_MAP $SSW/yohkoh/ucon/idl/hudson/stat_map.pro
[Previous] [Next]
 NAME:
       STAT_MAP 
 PURPOSE:
	to map the statistics of a data cube
 CALLING SEQUENCE:
	stat_map, data, index, stats, totals, indices, flare=flare 
 INPUTS:
	data cube with index
	flare = intarr(2) is the range of index values of a flare
 OUTPUTS:
	maps of stats (n,m,7):
	  - means from stdev
	  - sigmas from stdev
	  - slopes from poly_fit linear fit
	  - intercepts from poly_fit linear fit
	  - maximum
	  - minimum
	  - sigma of differenced data (good for high-frequency noise)
	totals  = the total DN summed across the cube area
	indices = the array of INDEX indices used in the linear fits
 USE:
 	Should work just like it looks. The index values in the variable
	  FLARE are omitted (exclusive, meaning that the values entered
         are both supposed to be "background" values).
	Note that the times fitted to the linear trend are expressed
 	  in sec of the day (msod/1000., not gt_time directly)
 HISTORY:
	HSH, written May 3, 1992
	HSH, May 6, 1992, added "difference filter" output


STATSUM $SSW/yohkoh/ucon/idl/hudson/statsum.pro
[Previous] [Next]
 NAME:
	STATSUM
 PURPOSE:
	dump out stats on a variable
 CALLING SEQUENCE:
 INPUTS:
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
 CALLS: ***
	STDEV
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
	HSH, written May 17, 1993


stdct $SSW/yohkoh/gen/idl/movie/stdct.pro
[Previous] [Next]
 NAME:	
   stdct
 PURPOSE:
   Get the r, g, b vectors for a standard IDL color table (256)
 CALLING SEQUENCE:
		stdct, table_number, r, g, b [, silent = silent]
 INPUTS:
	Table_number = number of table to load, from 0 to 15.
 KEYWORD PARAMETERS:
	Silent = If present and non-zero, supress the Color Table
		message.
	Tables = If present and non-zero, prints Color table names.
 OUTPUTS:
	r, g, b = 256 long byte vectors containing the r, g, b color table
 CALLS: ***
	FILEPATH
 CALLED BY:
	go_lasdisk golaserdisk, go_lasdisk2 golaserdisk, go_nvs5, mk_movie [1]
	mk_movie [2], mk_nvs_movie, mk_ptv_movie
 COMMON BLOCKS:
	None.
 SIDE EFFECTS:
	None.
 RESTRICTIONS:
	Works from the file: $IDL_DIR/colors1.tbl.
 PROCEDURE:
	The file colors.tbl is read.  A maximum of 16 entries may 
	be defined.  The titles of each table are contained in the first 
	16 * 32 characters/name bytes.  

  	Based on loadct.  Doesn't modify working color tables.

 MODIFICATION HISTORY:
	 2-Mar-93, GAL major updated for colors1.tbl from colors.tbl.
	 3-Mar-93, GAL modified to work for idl ver. < 3 or > 3.
	22-Jul-96, GLS modified to work for idl ver. up to 4.0.1.


StEnIdx $SSW/yohkoh/gen/idl/dbase/stenidx.pro
[Previous] [Next]
	NAME:
		StEnIdx
	PURPOSE:
		Compute and return start and end indices for input 
		data vector corresponding to a given file ID (FID).
	CALLING SEQUENCE:
		a = StEnIdx(fid, timlst)
	INPUT:
		fid
		timlst
	RETURNED:
		a	where a is a two-d array
			a(0,*) is the start index and a(1,*) is the end
 CALLS: ***
	int2secarr [1], int2secarr [2]
 CALLED BY:
	fidmap
	HISTORY:
		written 15-Oct-91 by GAL
		update, 16-Oct-91 to compare 1st times from fid and dvec.


STEPPER [4] $SSW/yohkoh/gen/idl/util/stepper_s1.pro
[Previous] [Next]
  NAME:
	STEPPER
  PURPOSE:
	Step through individual images a single frame at a time.
  INPUTS:
	DATA = Three-dimensional array
  OPTIONAL INPUT KEYWORDS:
	XSIZE,YSIZE = If present, the routine will use rebin to using the
			the /sample option.  If only XSIZE is present, YSIZE
			will be set equal to XSIZE.
	START	    = Index of starting image
	INFO_ARRAY  = String array containing descriptive text
	NOSCALE	    = If set, will turn off tvscale
	SUBSCRIPT   = Subset of array is displayed.
	MOVIE	    = If present and =1, will initiate movie mode when called
 	INTERP      = Controls how REBIN is done.  If present and set to 1,
		      /INTERP ==> REBIN(A,xsize,ysize)
		      else    ==> REBIN(A,xsize,ysize,/sample)
	COLOR	    = The color to use for displaying the info text string.
       nolcur  - If set, then stepper is being called from LCUR_IMAGE and
                 it should not allow the LCUR option to be used
  VERSION:
	V1.2    17-NOV-92
 CALLS: ***
	LOADCT, PROFILES [1], PROFILES [2], STEPPER_S1, SXT_GRID [1], SXT_GRID [2]
	SXT_GRID [3], XLOADCT [1], XLOADCT [2], XLOADCT [3], ZOOM, data_type [1]
	data_type [2], get_logenv [1], get_logenv [2], gt_pfi_ffi, hardcopy [1]
	hardcopy [2], input [1], input [2], lcur_image, pfi_loc, tbeep [1], tbeep [2]
	tbeep [3]
 CALLED BY:
	ALIGN1BIGGRAM, BOX_LC, LAY1GKM, PIXEL_LC, ext_subset [1], ext_subset [2], fstepper
	go_nvs4, lastsfd [1], lastsfd [2], lastspd, lcur_image, video_title, wdefroi [3]
	wdefroi [4]
  HISTORY:
	Written 20-sep-91, JRL and LWA
	Updated 21-sep-91, JRL:  Added xloadct and zoom options.
	Updated 24-sep-91, JRL:  Added SUBSCRIPT and MOVIE options.
	Updated  2-dec-91, JRL:  Break the text string into two lines if
				 info_array is > 44
	Updated 15-dec-91, slf;  Replaced get_kbrd calls with get_kbrd2
				 to work around SGI anomoly
	Updated 16-apr-92, slf;  To work with single image
	Updated 28-apr-92, JRL:  Break text if strlen(info) > 38
	Updated 29-apr-92, JRL:  Added the INTERP keyword
	Updated 17-nov-92, JRL:  Added color keyword.  Allow info_array to
				 be a 2nd parameter
	Updated 15-mar-93, JRL:  Added an option to call profiles
	Updated 13-may-93, SLF;  Return last selected in lastss
	------------------------------------------------------------
       17-Oct-93 (MDM) -  Broke the routine into two parts
                                Allowed new options
                                       "g" will plot sxt grids
                                       "l" will call LCUR_PLOT to plot curves
                                       "h" will make hardcopies
                                       "c" will call loadct
                                       different panels for different filters
	19-Oct-93 (MDM) - Allowed exit from STEPPER when using q to exit movie
	25-Oct-93 (MDM) - Added passing NOSCALE parameter to LCUR_IMAGE
	29-Nov-93 (MDM) - Added NOLCUR option
			- Added /NORMALIZE to LCUR_IMAGE call
	10-Jan-94 (MDM) - Added "O" option - obs region location
	11-Jan-94 (MDM) - Corrected "O" option
	21-Feb-94 (MDM) - Added "W" option - calls WSHOW to pop the window
			- Replaced call to GET_KBRD2 with GET_KBRD
	18-Apr-94 (MDM) - Added /NODEL_WIN_P to not delete window after light
			  curve plot is made
	10-Jun-94 (MDM) - Added option to establish the breakpoint location
			  in the info_array by setting STEPPER_BREAK
	24-Aug-94 (MDM) - Added NONORMALIZE option
	15-Jan-02, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		xloadct did not work (tested on Linux, IDL 5.3 and Windows NT,
		IDL 5.5). Adding keyword /block fixed the problem. Assuming that
		widget blocking is the problem and since blocking was introduced
		in IDL 5.0, /block is now added to xloadct when
		!version.release >= 5.0


STEPPER [5] $SSW/yohkoh/sxt/idl/util/stepper.pro
[Previous] [Next]
  NAME:
	STEPPER
  PURPOSE:
	Step through individual images a single frame at a time.
  CALLING SEQUENCE:
  STEPPER,DATA [,XSIZE=XSIZE,YSIZE=YSIZE,START=START,INFO_ARRAY=INFO_ARRAY,$
	     /NOSCALE,SUBSCRIPT=SUBSCRIPT,/MOVIE,/INTERP]
  INPUTS:
	DATA = Three-dimensional array
  OPTIONAL INPUT PARAMETERS:
	XSIZE,YSIZE = If present, the routine will use rebin to using the
			the /sample option.  If only XSIZE is present, YSIZE
			will be set equal to XSIZE.
	START	    = Index of starting image
	INFO_ARRAY  = String array containing descriptive text
	NOSCALE	    = If set, will turn off tvscale
	SUBSCRIPT   = Subset of array is displayed.
	MOVIE	    = If present and =1, will initiate movie mode when called
 	INTERP      = Controls how REBIN is done.  If present and set to 1,
		      /INTERP ==> REBIN(A,xsize,ysize)
		      else    ==> REBIN(A,xsize,ysize,/sample)

  VERSION:
	V1.1    24-sep-91
 CALLS: ***
	STEPPER_S1, UNIQ [1], UNIQ [2], UNIQ [3], data_type [1], data_type [2], get_info [1]
	get_info [2], get_info [3], get_info [4], gt_filta, gt_filtb, gt_seq_num
 CALLED BY:
	ALIGN1BIGGRAM, BOX_LC, LAY1GKM, PIXEL_LC, ext_subset [1], ext_subset [2], fstepper
	go_nvs4, lastsfd [1], lastsfd [2], lastspd, lcur_image, video_title, wdefroi [3]
	wdefroi [4]
  HISTORY:
	Written 20-sep-91, JRL and LWA
	Updated 21-sep-91, JRL:  Added xloadct and zoom options.
	Updated 24-sep-91, JRL:  Added SUBSCRIPT and MOVIE options.
	Updated  2-dec-91, JRL:  Break the text string into two lines if
				 info_array is > 44
	Updated 15-dec-91, slf;  Replaced get_kbrd calls with get_kbrd2
				 to work around SGI anomoly
	Updated 16-apr-92, slf;  To work with single image
	Updated 28-apr-92, JRL:  Break text if strlen(info) > 38 
	Updated 29-apr-92, JRL:  Added the INTERP keyword


STEPPER [6] $SSW/yohkoh/ucon/idl/acton/stp.pro
[Previous] [Next]
  NAME:
	STEPPER
  PURPOSE:
	Step through individual images a single frame at a time.
  INPUTS:
	DATA = Three-dimensional array
  OPTIONAL INPUT PARAMETERS:
	XSIZE,YSIZE = If present, the routine will use rebin to using the
			the /sample option.  If only XSIZE is present, YSIZE
			will be set equal to XSIZE.
	START	    = Index of starting image
	INFO_ARRAY  = String array containing descriptive text
	NOSCALE	    = If set, will turn off tvscale
	SUBSCRIPT   = Subset of array is displayed.

  VERSION:
	V1.1    24-sep-91
 CALLS: ***
	STP, XLOADCT [1], XLOADCT [2], XLOADCT [3], ZOOM
 CALLED BY:
	ALIGN1BIGGRAM, BOX_LC, LAY1GKM, PIXEL_LC, ext_subset [1], ext_subset [2], fstepper
	go_nvs4, lastsfd [1], lastsfd [2], lastspd, lcur_image, video_title, wdefroi [3]
	wdefroi [4]
  HISTORY:
	Written 20-sep-91, JRL and LWA
	Updated 21-sep-91, JRL:  Added xloadct and zoom options.
	Updated 24-sep-91, JRL:  Added SUBSCRIPT and MOVIE options.
	Updated  2-dec-91, JRL:  Break the text string into two lines if
				 info_array is > 44
	Updated 24-apr-92, LWA:  Break test string a bit differently in
				 order to put more info on 256x256 window


STEPPER [7] $SSW/yohkoh/ucon/idl/acton/stp_nosamp.pro
[Previous] [Next]
  NAME:
	STEPPER
  PURPOSE:
	Step through individual images a single frame at a time.
  INPUTS:
	DATA = Three-dimensional array
  OPTIONAL INPUT PARAMETERS:
	XSIZE,YSIZE = If present, the routine will use rebin to using the
			the /sample option.  If only XSIZE is present, YSIZE
			will be set equal to XSIZE.
	START	    = Index of starting image
	INFO_ARRAY  = String array containing descriptive text
	NOSCALE	    = If set, will turn off tvscale
	SUBSCRIPT   = Subset of array is displayed.

  VERSION:
	V1.1    24-sep-91
 CALLS: ***
	STP_NOSAMP, XLOADCT [1], XLOADCT [2], XLOADCT [3], ZOOM
 CALLED BY:
	ALIGN1BIGGRAM, BOX_LC, LAY1GKM, PIXEL_LC, ext_subset [1], ext_subset [2], fstepper
	go_nvs4, lastsfd [1], lastsfd [2], lastspd, lcur_image, video_title, wdefroi [3]
	wdefroi [4]
  HISTORY:
	Written 20-sep-91, JRL and LWA
	Updated 21-sep-91, JRL:  Added xloadct and zoom options.
	Updated 24-sep-91, JRL:  Added SUBSCRIPT and MOVIE options.
	Updated  2-dec-91, JRL:  Break the text string into two lines if
				 info_array is > 44
	Updated 24-apr-92, LWA:  Break test string a bit differently in
				 order to put more info on 256x256 window


STEPPER2 [1] $SSW/yohkoh/gen/galileo/idl/lmsal/stepper2.pro
[Previous] [Next]
  NAME:
	STEPPER2
  PURPOSE:
       Step through individual images a single frame at a time
       and permit flagging the output vector with a 0 or 1.
       It is possible to switch back and forth on a given image
       as much as you want.  No movie mode here but otherwise
       stepping or jumping through the data cube is the same
       as in stepper.
  SAMPLE CALLING SEQUENCE:
	output = stepper2(input1, [input2, input3, $
        INFO_ARRAY=INFO_ARRAY, SUBSCRIPT=SUBSCRIPT, $
        NOSCALE=NOSCALE, COLOR=COLOR, $
        qstop=qstop,wunz=wunz]
	out = stepper2(data)
	out = stepper2(index,data)
	out = stepper2(index,data,info_array)
	out = stepper2(data,info_array)
  INPUT:
	DATA = Three-dimensional array
  OUTPUT
       A vector of 0's and 1's permitting easy selection or
       de-selection of images for further processing.
  OPTIONAL INPUTS:
	INDEX         = The index structure that goes with the data
       INFO_ARRAY    = descriptive text string (pass as parameter or keyword)
  OPTIONAL INPUT KEYWORDS:
	INFO_ARRAY  = String array containing descriptive text
	NOSCALE	    = If set, will turn off tvscale
	SUBSCRIPT   = Subset of array is displayed.
	COLOR	    = The color to use for displaying the info text string.
	WUNZ        = Initially sets the output array to 1 rather than 0.
 CALLS: ***
	STEPPER2_s1 [1], STEPPER2_s1 [2], data_chk [1], data_chk [2], data_type [1]
	data_type [2], get_info [1], get_info [2], get_info [3], get_info [4]
 CALLED BY:
	ssc_scan2
  HISTORY:
	11-Nov-2002, LWA; created from stepper to return 0/1 vector.
	21-May-2003, LWA; corrected program to return vector of 0's and 1's
	11-Oct-2004, LWA; added wwnz keyword


STEPPER2 [2] $SSW/yohkoh/ucon/idl/acton/stepper2.pro
[Previous] [Next]
  NAME:
	STEPPER2
  PURPOSE:
       Step through individual images a single frame at a time
       and permit flagging the output vector with a 0 or 1.
       It is possible to switch back and forth on a given image
       as much as you want.  No movie mode here but otherwise
       stepping or jumping through the data cube is the same
       as in stepper.
  SAMPLE CALLING SEQUENCE:
	output = stepper2(input1, [input2, input3, $
        INFO_ARRAY=INFO_ARRAY, SUBSCRIPT=SUBSCRIPT, $
        NOSCALE=NOSCALE, COLOR=COLOR, $
        qstop=qstop]
	out = stepper2(data)
	out = stepper2(index,data)
	out = stepper2(index,data,info_array)
	out = stepper2(data,info_array)
  INPUT:
	DATA = Three-dimensional array
  OUTPUT
       A vector of 0's and 1's permitting easy selection or
       de-selection of images for further processing.
  OPTIONAL INPUTS:
	INDEX         = The index structure that goes with the data
       INFO_ARRAY    = descriptive text string (pass as parameter or keyword)
  OPTIONAL INPUT KEYWORDS:
	INFO_ARRAY  = String array containing descriptive text
	NOSCALE	    = If set, will turn off tvscale
	SUBSCRIPT   = Subset of array is displayed.
	COLOR	    = The color to use for displaying the info text string.
 CALLS: ***
	STEPPER2_s1 [1], STEPPER2_s1 [2], data_chk [1], data_chk [2], data_type [1]
	data_type [2], get_info [1], get_info [2], get_info [3], get_info [4]
 CALLED BY:
	ssc_scan2
  HISTORY:
	11-Nov-2002, LWA; created from stepper to return 0/1 vector.
	21-May-2003, LWA; corrected program to return vector of 0's and 1's


STEPPER2_s1 [1] $SSW/yohkoh/gen/galileo/idl/lmsal/stepper2_s1.pro
[Previous] [Next]
  NAME:
	STEPPER2_s1
  PURPOSE:
	Step through individual images a single frame at a time
	and permit flagging the output vector with a 0 or 1.
	It is possible to switch back and forth on a given image
	as much as you want.  No movie mode here but otherwise
	stepping or jumping through the data cube is the same
	as in stepper.
  INPUTS:
	DATA = Three-dimensional array
  OUTPUT
	A vector of 0's and 1's permitting easy selection or
	de-selection of images for further processing.
  OPTIONAL INPUT KEYWORDS:
	INFO_ARRAY  = String array containing descriptive text
	NOSCALE	    = If set, will turn off tvscale
	SUBSCRIPT   = Subset of array is displayed.
	COLOR	    = The color to use for displaying the info text string.
 CALLS: ***
	data_chk [1], data_chk [2], get_logenv [1], get_logenv [2]
 CALLED BY:
	STEPPER2 [1], STEPPER2 [2]
  HISTORY:
	11-Nov-2002 LWA, Gutted stepper_s1 for purposes of stepper2.pro.
	11-Oct-2004 LWA, Moved info to UL corner.


STEPPER2_s1 [2] $SSW/yohkoh/ucon/idl/acton/stepper2_s1.pro
[Previous] [Next]
  NAME:
	STEPPER2_s1
  PURPOSE:
	Step through individual images a single frame at a time
	and permit flagging the output vector with a 0 or 1.
	It is possible to switch back and forth on a given image
	as much as you want.  No movie mode here but otherwise
	stepping or jumping through the data cube is the same
	as in stepper.
  INPUTS:
	DATA = Three-dimensional array
  OUTPUT
	A vector of 0's and 1's permitting easy selection or
	de-selection of images for further processing.
  OPTIONAL INPUT KEYWORDS:
	INFO_ARRAY  = String array containing descriptive text
	NOSCALE	    = If set, will turn off tvscale
	SUBSCRIPT   = Subset of array is displayed.
	COLOR	    = The color to use for displaying the info text string.
 CALLS: ***
	data_chk [1], data_chk [2], get_logenv [1], get_logenv [2]
 CALLED BY:
	STEPPER2 [1], STEPPER2 [2]
  HISTORY:
	11-Nov-2002 LWA, Gutted stepper_s1 for purposes of stepper2.pro.


STEPPER_LP $SSW/yohkoh/ucon/idl/shimizu/stepper_lp.pro
[Previous] [Next]
  NAME:
	STEPPER_LP
  PURPOSE:
	Step through individual images a single frame at a time.
  SAMPLE CALLING SEQUENCE:
	STEPPER_LP, DATA
	STEPPER_LP, INDEX, DATA
	STEPPER_LP, INDEX, DATA
  INPUTS:
	DATA = Three-dimensional array
  OPTIONAL INPUTS:
	INDEX         = The index structure that goes with the data
  OPTIONAL INPUT KEYWORDS:
	XSIZE,YSIZE = If present, the routine will use rebin to using the
			the /sample option.  If only XSIZE is present, YSIZE
			will be set equal to XSIZE.

			If one of the "panels" options is used, then this is the
			size of a single panel (the size that a single image 
			should be displayed)
	START	    = Index of starting image
	INFO_ARRAY  = String array containing descriptive text
	NOSCALE	    = If set, will turn off tvscale
	SUBSCRIPT   = Subset of array is displayed.
	MOVIE	    = If present and =1, will initiate movie mode when called
 	INTERP      = Controls how REBIN is done.  If present and set to 1,
		      /INTERP ==> REBIN(A,xsize,ysize)
		      else    ==> REBIN(A,xsize,ysize,/sample)
	COLOR	    = The color to use for displaying the info text string.

	noinfo	- If set, then do not build the INFO_ARRAY string even
		  when the index is passed in.
	panels	- An array with the same number of images as the data saying
		  which panel to display the image in (ie: 0,1,2,3,0,1,2...).
		  This allows images from a different filters to be displayed
		  in a different region on the x-window.
	filter_panels - If set, then build the "panels" array based on the
		  unique filters
	sequence_panels - If set, then build the "panels" array based on the
		  SXT sequence number
	nolcur	- If set, then stepper is being called from LCUR_IMAGE and
		  it should not allow the LCUR option to be used
  VERSION:
	V1.2    17-NOV-92
	V2.0	19-Oct-93
 CALLS: ***
	STEPPER_S1, UNIQ [1], UNIQ [2], UNIQ [3], data_type [1], data_type [2], get_info_lp
	gt_filta, gt_filtb, gt_seq_num
  HISTORY:
	Written 20-sep-91, JRL and LWA
	Updated 21-sep-91, JRL:  Added xloadct and zoom options.
	Updated 24-sep-91, JRL:  Added SUBSCRIPT and MOVIE options.
	Updated  2-dec-91, JRL:  Break the text string into two lines if
				 info_array is > 44
	Updated 15-dec-91, slf;  Replaced get_kbrd calls with get_kbrd2
				 to work around SGI anomoly
	Updated 16-apr-92, slf;  To work with single image
	Updated 28-apr-92, JRL:  Break text if strlen(info) > 38 
	Updated 29-apr-92, JRL:  Added the INTERP keyword
	Updated 17-nov-92, JRL:  Added color keyword.  Allow info_array to
				 be a 2nd parameter
	Updated 15-mar-93, JRL:  Added an option to call profiles
	Updated 13-may-93, SLF;  Return last selected in lastss
	------------------------------------------------------------
	Updated 17-Oct-93, MDM;  Broke the routine into two parts
				 Allowed new options
					"g" will plot sxt grids
					"l" will call LCUR_PLOT to plot curves
					"h" will make hardcopies
					"c" will call loadct
					different panels for different filters
	Updated 29-Nov-93, MDM;  Added NOLCUR option

	Revised 17 Jun 94 T.Shimizu for LaPalma data
       Revised 12 Nov 94 T.Shimizu just stamp observing time.


STIRLING_APPROX $SSW/yohkoh/ucon/idl/hudson/stirling_approx.pro
[Previous] [Next]
 NAME:
	STIRLING_APPROX
 PURPOSE:
	Evaluate the Stirling approximation for large arguments
	  of the gamma function
 CATEGORY:
	Math stuff hoked up for Yohkoh work
 CALLING SEQUENCE:
	logfact = stirling_approx(arg)
 INPUTS:
	arg > 0 
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
  	base 10 logarithm of the approximate factorial	
 RESTRICTIONS
	same as the gamma function, which is used for small arg
 CALLS: ***
	GAMMA
 MODIFICATION HISTORY:
	HSH, written 12-oct-93


STONY $SSW/yohkoh/ucon/idl/leka/stony.pro
[Previous] [Next]
 NAME:
	STONY
 PURPOSE:
	Stonyhurst disk overlay. Adds
	  grid lines to images, if you know where the image is.
 CATEGORY:	Image Processing
 CALLING SEQUENCE:
	stony,image,yr,mo,da,hr,xx,yy,rad,color=color,line=line
 INPUTS:
	image: byte image to display
	yr: year, e.g. 1991
	mo: month, 1-12
	da: day, 1-31
	hr: hour, e.g. 15.325
	xx: X center of image, image pixels
	yy: Y center, image pixels
	rad: radius, image pixels
 OPTIONAL INPUT PARAMETERS:
 KEYWORD PARAMETERS:
	color: color to draw grid, 0-255
	line:  linestyle, 0-5. 
	no_p: if set, then uses p-angle=0 (i.e. for YOHKOH data..)
 OUTPUTS:
	Image with grid overlay; prints ephemeris. Output is to
	  current graphics device.
 OPTIONAL OUTPUT PARAMETERS:
 CALLS: ***
	SPHINIT, SPHLAT, SPHLNG, SUN [1], SUN [2]
 CALLED BY:
	plot_lat_cmd
 COMMON BLOCKS:
	sph_com
 SIDE EFFECTS:
 RESTRICTIONS:
	Requires nruns, sphinit, sphlat, sphlng,sun,
		ymd2jd,recpol,isarray,array,datatype,monthnames,
		strsec,makex,maken,polrec3d,polrec,rot_3d,
		vect_angle,sphlng,getrun
 PROCEDURE:
 MODIFICATION HISTORY:
	Written DLM 1991 Nov 13, using routines from the JHUAPL library.


str2alp $SSW/yohkoh/ucon/idl/linford/str2alp.pro
[Previous] [Next]
	NAME: str2alp
	purpose: convert a str to pure alpha characters.
	
	Parameters:
		newstring = str2alp(str, plus='_', nonalpha=' ')
		
		str		is the input string to convert
		plus		is the addition non-alpha char to allow
		nonalpha	is the char to sub. for non-alpha chars.
		num		is a switch to allow numerics 0-9		
 CALLS: ***
	isalpha
 CALLED BY:
	modvolume_inf [1], modvolume_inf [2]
	Restrictions:
		note: If nonalpha is not defined, non-alpha chars are
			converted to '_'.  I would like to change this
			to removing non-alpha chars when nonalpha is not
			defined
	History:
		written by gal, 6-Mar-96


STR2BYTARR $SSW/yohkoh/ucon/idl/metcalf/str2bytarr.pro
[Previous] [Next]
NAME:
     STR2BYTARR
PURPOSE:
     Converts a structure to a byte array on a byte by byte basis.
CATEGORY:
CALLING SEQUENCE:
     array = str2bytarr(structure)
INPUTS:
     structure = structure to be converted into a byte array
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
OUTPUTS:
     array = the byte array 
 CALLED BY:
	STR_FILL
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf  November 1992


STR2INT $SSW/yohkoh/ucon/idl/hudson/str2int.pro
[Previous] [Next]
 NAME :
       STR2INT
 PURPOSE:
       Convert string of number to integer.
 CALLING SEQUENCE:
       xx = str2int(str)
 INPUTS:
       str   = string of number
 MODIFICATION HISTORY
       Written April 10, 1992 by Bachtiar Anwar


str_copy_tags [3] $SSW/yohkoh/gen/galileo/idl/lmsal/str_copy_tags.pro
[Previous] [Next]
   Name: str_copy_tags

   Purpose: copy structures where the tag names match.  The
	     default is NOT to copy the tags "index_version"
	     and "entry_type"

   Input Parameters:
      str1 - destination structure (template)
      str2 - source structure
   Optional Input:
	vercopy - If present, then the keywords "index_version" and
		    "entry_type" are not copied (to preserve the
		    new structure version number)

   Output: function return value is type str1 copy of str2 contents

 CALLED BY:
	BSC_FIELD, EIT_CATRD [1], EIT_PREP, MK_SSX, RD_XDA [1], RD_XDA [2], TRACE_PREP
	def_yssysv [1], def_yssysv [2], fit_bsc, fit_bsc_as, get_dc_image [2]
	get_dc_image [3], get_leak_image [1], get_leak_image [2], get_leak_image [3]
	get_sxa, mk_week_file [1], mk_week_file [2], rd_dt_genx, rd_sdl, rd_sld, rd_sls
	rd_sot, rd_sxtgoes, rd_trace_i0 [1], rd_trace_i0 [2], rd_week_file [1]
	rd_week_file [2], rd_week_file [3], rd_week_file [4], read_genxcat
	str_concat [1], str_concat [2], str_ver_update [1], str_ver_update [2]
	sxt_prep [1], sxt_prep [2], sxt_prep [3], weekid [2], ydb_exist [2]
   History: slf, 10/24/91
	     slf, 10/24/91 - streamlined recursive segment
	     mdm, 11/10/91 - took "str_copy" and made it copy by
			     matching tag names
	12-Nov-91 MDM - Added "spare1" and "spare2" to the skip-list
	18-Dec-92 MDM - Added code to avoid copying any SPARE tags all the
			time (not just if /vercopy is set)
	 4-Jan-94 MDM - Modified so that it will work if passing in
			an index with .GEN, .SXT, and .HIS and the other
			structure just has .GEN and .SXT.
		      - Previously, the input structure was being modified.
			Made changes to not corrupt the input template
	29-Sep-97 MDM - Patch to not crash when trying to copy a longer
			input into an output
       12-Mar-98 SLF - fix 'subscript w/-1' bug in 29-sep change
       11-Mar-2003 - SLF - sprinle liberally with 'reform's sinc RSI
                     screwed us with degenerate structure/vector dimensions
                     circa IDL V5.5
       15-apr-2003 - SLF - remove one of the 11-March reforms per Barry Labonte
                     suggested - avoid problems at least on linux 5.6
       16-may-2003 - SLF - change the syntax of the insertion string
                     to explicitly match n-dimen of value
	

   Method: recursive for nested structures


str_copy_tags [4] $SSW/yohkoh/sxt/idl/atest/str_copy_tags.pro
[Previous] [Next]
   Name: str_copy_tags

   Purpose: copy structures where the tag names match.  The
	     default is NOT to copy the tags "index_version"
	     and "entry_type"

   Input Parameters:
      str1 - destination structure (template)
      str2 - source structure
   Optional Input:
	vercopy - If present, then the keywords "index_version" and
		    "entry_type" are not copied (to preserve the
		    new structure version number)

   Output: function return value is type str1 copy of str2 contents

 CALLED BY:
	BSC_FIELD, EIT_CATRD [1], EIT_PREP, MK_SSX, RD_XDA [1], RD_XDA [2], TRACE_PREP
	def_yssysv [1], def_yssysv [2], fit_bsc, fit_bsc_as, get_dc_image [2]
	get_dc_image [3], get_leak_image [1], get_leak_image [2], get_leak_image [3]
	get_sxa, mk_week_file [1], mk_week_file [2], rd_dt_genx, rd_sdl, rd_sld, rd_sls
	rd_sot, rd_sxtgoes, rd_trace_i0 [1], rd_trace_i0 [2], rd_week_file [1]
	rd_week_file [2], rd_week_file [3], rd_week_file [4], read_genxcat
	str_concat [1], str_concat [2], str_ver_update [1], str_ver_update [2]
	sxt_prep [1], sxt_prep [2], sxt_prep [3], weekid [2], ydb_exist [2]
   History: slf, 10/24/91
	     slf, 10/24/91 - streamlined recursive segment
	     mdm, 11/10/91 - took "str_copy" and made it copy by
			     matching tag names
	12-Nov-91 MDM - Added "spare1" and "spare2" to the skip-list
	18-Dec-92 MDM - Added code to avoid copying any SPARE tags all the
			time (not just if /vercopy is set)
	 4-Jan-94 MDM - Modified so that it will work if passing in
			an index with .GEN, .SXT, and .HIS and the other
			structure just has .GEN and .SXT.
		      - Previously, the input structure was being modified.
			Made changes to not corrupt the input template
	29-Sep-97 MDM - Patch to not crash when trying to copy a longer
			input into an output
       12-Mar-98 SLF - fix 'subscript w/-1' bug in 29-sep change
        7-Mar-2003 SLF - protect against RSI 5.5 screwup with
                         degenerate dimensions
	

   Method: recursive for nested structures


STR_FILL $SSW/yohkoh/ucon/idl/metcalf/str_fill.pro
[Previous] [Next]
NAME:
     STR_FILL
PURPOSE:
     Fill a structure from a data array or another structure - simulates an 
     equivalence stetement for structures.

     The structure is filled byte by byte from the data array.  If the array
     is longer (in bytes) than the structure, the first part of the array 
     is used.  If the array is too short, as much of the structure as 
     possible is filled.
CATEGORY:
CALLING SEQUENCE:
     bytes = str_fill(structure,array,index=index,tags=tags)
INPUTS:
     structure = the structure to be filled
     array = the array of data to use in filling the structure (can be 
             another structure).  Can be of any type.
OPTIONAL INPUT PARAMETERS:
     index = If the structure to be filled is an array of structures,
             setting index fills only specific structure elements of the 
             array of structures.  Index gives the element number(s).  This 
             is necessary since IDL passes an element of a structure array by
             value, not by address.  Hence passing strucure(index) to 
             str_fill will not fill the structure array element.  The entire 
             array must always be passed.  Hence to fill an array element, 
             pass the entire structure and specify the index keyword.  Index 
             can be a vector of indices.  Default = all elements of the array.
     tags = The same problem crops up if you only want to fill certain tags
            in the structure.  The tags input is a vector of tag numbers to 
            be filled.  The others are left alone.  Default = All tags.
KEYWORD PARAMETERS
     /check = Check that the array has at least enough data to fill the 
             structure.
     /exact = Check that the array will EXACTLY fill the structure.
     /printable = force strings to be composed of printable characters
                  only (32b to 126b).
OUTPUTS:
     The input structure is modified (filled).
     bytes = the number of BYTES from array put into the structure
 CALLS: ***
	STR2BYTARR
COMMON BLOCKS:
SIDE EFFECTS:
     The input structure is filled
RESTRICTIONS:
     The number of bytes in each data type is hardwired to:
        nbytes = [0,1,2,4,4,8,8,1,1]
PROCEDURE:
EXAMPLES:
     To load a structure from a byte array:
     IDL> c={a:0,b:0}
     IDL> print,str_fill(c,[0b,1b,0b,2b])
           4
     IDL> help,c,/str
     ** Structure <1daf88>, 2 tags, length=4, refs=1:
        A               INT              1
        B               INT              2

     To determine the byte size of a structure:
     IDL> print,str_fill(c,c,/nocheck)
                4

     To fill a few elements of an array of structures:
     IDL> c={a:0,b:0}
     IDL> c=replicate(c,4)
     IDL> a={a:5,b:5}
     IDL> print,str_fill(c,replicate(a,2),index=[1,2])
                8
     IDL> print,c
     {       0       0}{       5       5}{       5       5}{       0       0}

MODIFICATION HISTORY:
     T. Metcalf November 1992
     T. Metcalf December 1992 Fixed the string code so that 0b is never
                              output to a string (this fouls things up
                              since 0b is the end-of-string marker.  If
                              /printable is set 0b through 31b becomes a 
                              space.  If /printable is not set, 0b becomes 1b.


STR_LOAD $SSW/yohkoh/ucon/idl/metcalf/str_load.pro
[Previous] [Next]
NAME:
     STR_LOAD
PURPOSE:
     Load a strucutre from an identical sturcture (same definition of tags).
     You would think you can just type "a=b" in IDL, but if the structure
     names are different, you will get an error, even if the structures
     are identical.  This routine gets around this problem byt loading the
     structure tags one at a time.
CALLING SEQUENCE:
     str_load, filee, filler
INPUTS:
     filler = the structure from which data is taken
KEYWORD INPUT:
     index = if the fillee structure is an array of structures and you only
             want to fill some elements of the array, set index equal to the
             the array indices to be filled.  You can't simply pass something
             like fillee(index) in the call to str_load because IDL will pass
             fillee(index) by value rather than by reference.
     tags = if you want to fill just a few tags in the structure, pass 
            a vector of tag index numbers in tags.  Applies to both fillee
            and filler.
OUTPUTS:
     fillee = the structure to be filled.  It must have the same definition
              as filler.
 CALLED BY:
	hxt_multimg, hxt_sources, hxtpix, makimg0
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
     The two structures must have the same difinition execpt possibly for the
     structure fdname.  If the definitions are not exactly the same, an error
     will result: use str_fill.pro in this case.
EXAMPLES:
     a = replicate({a,a:0,b:0},5)
     b = {b,a:1,b:2
     str_load, a, index=2, b
PROCEDURE:
     Transfers data tag by tag from filler into fillee.  The routine is 
     recursive so that it will work with tags which are themselves structures.
MODIFICATION HISTORY:
     Written 25-Jun-93 by T. Metcalf


str_merge [2] $SSW/yohkoh/gen/idl/ref_access/str_merge.pro
[Previous] [Next]
   Name: str_merge

   Purpose: merge (append) a new structure tag into an existing structure

   Input Parameters:
      str1 - top level structure (or vector of stuctures)
      str2 - new structure to merge (becomes new tag of str1)

   Optional Keyword Parameters:
      nest_name - optional tag name (default is 1st 3 char of structure name)
      down      - switch, if set, nest str1 (str1 and str2 at same level)

 CALLS: ***
	FMT_TAG [1], FMT_TAG [2], MAKE_STR [1], MAKE_STR [2]
 CALLED BY:
	BSC_FIELD, MK_BSC_STR [1], MK_BSC_STR [2], fort2hxi [1], fort2hxi [2], his_index
	hxt_memimg, hxt_multimg, hxt_sources, hxtpix, makimg0
   History: 30-Jun-93 (SLF) - Adapt 'make_str' to MDM str_merge logic
	      7-Jul-93 (SLF) - allow vectors and assign values properly
	      8-Jul-93 (MDM) - Corrected problem when STR2 was one element
				and STR1 had several elements.
	     28-Jul-93 (SLF) - allow non-structure tages
	     29-Jul-93 (SLF) - 1 parameter option, down keyword (recursive)

   Calling Sequence:
      newstr=str_merge(str1, str2 [,nest_name=nest_name, /down])

   Calling Examples:
      newstr=str_merge(str1,str2)	 ; str2 becomes new tag of str1
      newstr=str_merge(str1)		 ; nests str1 one level down
      newstr=str_merge(str1,str2,/down) ; same and then merges str2

   Method: uses make_str to assure uniq structure names


STRAY_CORR $SSW/yohkoh/ucon/idl/hudson/stray_corr.pro
[Previous] [Next]
 NAME:
     STRAY_CORR
 PURPOSE:
     a mini-PREP that does dark, stray, and vignetting corrections
 CATEGORY:
     Yohkoh
 CALLING SEQUENCE:
     stray_corr, index, data, index_stray, data_stray, final_img
 INPUTS:
     index and data of image to correct
     index and data of stray reference image
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
     final_img is the corrected output
 CALLS: ***
	dark_sub [1], dark_sub [2], dark_sub [3], gt_expdur [1], gt_expdur [2]
	sxt_off_axis, sxt_vignette
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     HSH 23-nov-94 


STRETCH2 $SSW/yohkoh/gen/idl/movie/stretch2.pro
[Previous] [Next]
 NAME:
	STRETCH2
 PURPOSE:
	Stretch the image display color tables so the full range 
	runs from Low to High.
 CATEGORY:
	Image processing, point operations.
 CALLING SEQUENCE:
	Stretch2, Low, High, Gamma, r, g, b [,CHOP = Chop]
 INPUTS:
	Low = lowest pixel value. If omitted 0 is assumed.
		Must range from 0 to the number of available colors-1.
	High = highest pixel value.  If omitted, colors-1 is assumed.
		Must range from 0 to colors-1.
	Gamma = Gamma correction factor.  Optional parameter, if
		omitted, 1.0 is assumed.  Color indices are raised
		to the Gamma power, assuming they are scaled to the
		range of 0 to 1.
 INPUTS/OUTPUTS:
	r,g,b = Color tables to be modified.
 KEYWORD INPUTS:
	Chop = Set values above the upper threshold to color index 0.
		Normally, values above the upper threshold are clipped
		to the maximum color index.
 CALLED BY:
	go_lasdisk golaserdisk, go_lasdisk2 golaserdisk, go_nvs5, mk_movie [1]
	mk_movie [2], mk_nvs_movie, mk_ptv_movie
 COMMON BLOCKS:
	None.
 SIDE EFFECTS:
	None.
 RESTRICTIONS:
	r,g,b must be 1-d vectors of byte type.
 PROCEDURE:
	New R, G and B vectors are created by linearly interpolating
	the vectors in common from Low to High.  
	The R, G, B vectors will be changed.
 MODIFICATION HISTORY:
	14-apr-92, JRL - Adapted from Stern's stretch routine.


strip_data $SSW/yohkoh/ucon/idl/mctiernan/strip_data.pro
[Previous] [Next]
 NAME:
     strip_data
 PURPOSE:
     Gets rid of open filter, and non full res images from a flare
     SXT data set. Also will dump non-64X64 images
 CALLING SEQUENCE:
     strip_data, index, data
 INPUT/OUTPUT:
     index and data, SXT, data is optional
 KEYWORDS:
     filterb= filter number you want to keep, all the rest will be gotten rid of
 CALLS: ***
	gt_filtb, gt_res
 CALLED BY:
	align_hxi, box_sxthxt_fsp, sxt_fl_analxpro, sxt_fsp, sxt_thfsp, sxtbox_fsp
	sxthxt_fsp
 HISTORY:
     1/24/95/jmm


StrMap $SSW/yohkoh/gen/idl/dbase/strmap.pro
[Previous] [Next]
	Name:
		StrMap
	Purpose:
		Decode the input string 'str' and return the ith 'idx'
		occurance of the item in the input string.
	CALLING SEQUENCE:
		req_str = StrMap(nfn, str, idx, [delimitor=delimitor])
	Input:
		nfn	number of items encoded in input string.
		str	input string to decode
		idx	item number (0 - n-1), note if idx = nfn
			all items will be decoded and returned.
	KeyWord:
		delimitor	Default is ',', else caller defined.	
	Returned:
		requested string
 CALLED BY:
	DsetVec, TrimDvec
	History:
		created 3-May-91 by GAL
		updated for delimitor keyword 10-May-91.


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

   Purpose: strmid with vectorized parameters

   Input Parameters:
      inarry  - initial string array to split
      start_position - first position (array ok)
      exlength - length to extract (array ok)

   Output:
      function return value is trimmed string array 

   Calling Sequence:
      strarr=strmid(inarray, start_positions, exlength )

   Calling Examples:
    IDL> more,strmids(replicate('123456789',5), indgen(5), indgen(5)+1 )
           1
           23
           345
           4567
           56789

 
 CALLS: ***
	UNIQ [1], UNIQ [2], UNIQ [3], data_chk [1], data_chk [2]
 CALLED BY:
	LIST_PRINTER_UNIX, MDI_COPY, UNFORMAT_INTERVALS, ef2time, eit_file2path
	extract_fids, gt2exe [1], gt2exe [2], hsi_ui_qlimage, html_get_files, make_mirror
	mk_sxh, mreadfits_header, read_trace, soon_cadence, ssw_install [2]
	ssw_instr_info, ssw_kyoto2dst, ssw_start_rpcserver, ssw_swmap_info
	ssw_swmap_uniqinfo, sswdb_upgrade, timeline, topsdb [1], topsdb [2]
	tr_mk_seq_alph, trace_dph2struct [1], trace_files, trace_movie_context
	trace_request_summary, trace_struct2filename, url_encode, web_seq, xdisp_fits
   History:
      12-sep-1997 - S.L.Freeland 
      16-sep-1997 - S.L.Freeland - ignore action for any '-1' paramters
                                   (allow strpos direct pass through)  
      17-sep-1997 - S.L.Freeland - dont bother initializing output array

   Method:
      calls strmid - vectorized for uniq combinations of 
                     of start position and length  


strnames $SSW/yohkoh/ucon/idl/freeland/strnames.pro
[Previous] [Next]
 NAME: strnames

 PURPOSE: define main level variables using tag names of structure

 CALLING SEQUENCE:
   1: [define main level structure variable with name <struct>]
   2: .run strnames	

 CALLING EXAMPLES:
   restgen,struct=struct 	(define struct from genx file)
   .run strnames		(convert struct tags to main level variables)

   struct=!d			(define struct from existing structure)
   .run strnames		(convert struct tags to main level variables)

 HISTORY:
   SLF,   3-Mar-1993 - for use with generic files)
   SLF,  30-Mar-1993 - fleshed out documentation     
 RESTRICTIONS:
   only one level of variable clobber protection


Strs2Mat $SSW/yohkoh/gen/idl/dbase/strs2mat.pro
[Previous] [Next]
	Name:
		Strs2Mat
	Purpose:
		Convert a group of strings within a structure to
		a matrix of the same data-type specified by the 
		Keyword "blank".
	CALLING SEQUENCE:
		matrix = Strs2mat([structure=a, stVal=stTag, 
			 enVal=enTag, blank=val])
	Input/Keywords:
		a	input structure to be converted
		stTag	starting Tag number for the conversion
		enTag	ending Tag number for the conversion
		val	default value for blanks and data type of 
			return matrix.
	Returned:
		matrix of type equal to the data-type for the Keyword
		specifier "blank".
 CALLS: ***
	STR2ARR [1], STR2ARR [2]
 CALLED BY:
	MkFnMapMake Filename Map
	History:
		written 26-June-91 by GAL


strsub $SSW/yohkoh/sxt/idl/to_be_deleted/strsub.pro
[Previous] [Next]
	NAME: strsub
	Purpose: Search for a char and replace all occurrences of that
		char with the replacement char "replchar".

 CALLED BY:
	STREP [1], STREP [4], STRESS [1], STRESS [2], STRESS [3]
	History: written by GAL, 1-June-95


stt_plot $SSW/yohkoh/ucon/idl/hudson/stt_plot.pro
[Previous] [Next]
   Name: stt_plot

   Purpose: plot STT(Star Tracker) ouput signal level ( to check STT ).

   Input Parameter:
      indate - date in yohkoh date format
               ada-data files of this date will be dispalyed in the selection
               menu.
               (if not sepecified, last 5 files will be displayed )

   Description:
      You can chose one of most recent 5 reformatted data (or those of a given
      date) and get a plot of STT signal level vs. time.
      If STT is working correctly, the signal level should be in between
      400 and 800, and also it varies only in the priod set by STT timer.
      This way, you can check STT.

 CALLS: ***
	DATA_PATHS, RD_ADA, UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5]
	UTPLOT [6], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	file_list [1], file_list [2]
   History:  
       17-Aug-97 (KLA) - Written to Simplify (complicate?) Toban duties


stuff_yo_logo $SSW/yohkoh/ucon/idl/labonte/stuff_yo_logo.pro
[Previous] [Next]
 IDL routine to stuff a Yohkoh logo in the corner of an image
 

PRO stuff_yo_logo, image, corner


 Input:
	image = byte array to put logo in
	corner = corner to put it in, 1 - 4, clockwise
		from upper left

 Routines called: yo_logo, wdef, wdelete


 Written April 29, 1993  Barry LaBonte
	Fix to use free window  May 28, 1993  BJL
 CALLS:
 CALLED BY
	background_new


subs_twod $SSW/yohkoh/ucon/idl/mctiernan/subs_twod.pro
[Previous] [Next]
	Pro subs_twod,i,j,ipix,jpix,ij
 Returns position ij in an (ipix,jpix) matrix, given (i,j), the 2d position


substruc $SSW/yohkoh/ucon/idl/leka/substruc.pro
[Previous] [Next]
 NAME:
   substruc
 PURPOSE:
   This function creates a copy of a structure, replacing fields which are
   2-D arrays with subarrays of the specified dimensions.  Scalar and
   1-D fields are passed unchanged.
 CALLING SEQUENCE:
   result = substruc (struc, [name,] x0, x1, y0, y1, help=help)
 INPUTS:
   struc = original structure from which to extract subarrays.
  [Optional:
   name = string specifying new name of structure type (must be different from
      any name currently in use; this function will test for uniqueness).]
   x0, x1, y0, y1 = integers specifying subarray, as in array(x0:x1,y0:y1).
 OUTPUT:
   result = new structure with reduced arrays.
 KEYWORDS:
   help = nonzero to print calling sequence summary and exit.
 OTHER ROUTINES INVOKED:
   strstat (T. R. Metcalf), get_def (TRM), makestr (TRM).
 CALLS: ***
	get_def, makestr, strstat [1], strstat [2]
 RESTRICTIONS:
   The makestr procedure is Unix-specific.
 MODIFICATION HISTORY:
   26 Feb 1992:  Written by J-F de La Beaujardiere, with assistance from
                 T. R. Metcalf.
   920917 ANM: Allow "name" to be omitted, using anonymous structures


SUM [2] $SSW/yohkoh/bcs/idl/atest/sumit.pro
[Previous] [Next]
 NAME:
	SUM
 PURPOSE:
  	Function to do a 1-d summation of a 2-d data set.
 CALLING SEQUENCE:  
	out = SUMIT(in)
 INPUTS:
	in	2-d input array
 OUTPUTS:
	out	1-d summation of array
 OPTIONAL OUTPUTS:

 CALLS: ***
	SUMIT
 RESTRICTIONS:

 PROCEDURE:

 MODIFICATION HISTORY:
	RDB	1990	Emulated IDL version 1 routine


sum_bsc $SSW/yohkoh/ucon/idl/sterling/sum_bsc.pro
[Previous] [Next]
 NAME:
       sum_bsc.pro
 PURPOSE:
	Sum up elements in input bsc index and data structures.

 CALLING SEQUENCE:
	sum_bsc,bsc_index,bsc_data,sum_bsc_index,sum_bsc_data

 INPUTS:
	bsc_index	   bsc_index with elements to be summed
	bsc_data	   bsc_data with elements to be summed
 KEYWORDS:

 NOTES:

 OUTPUTS:
	sum_bsc_index	new bsc_index with one element (summed flux and counts)
	sum_bsc_data    new bsc_data with one element
	
 CALLS: ***
	BSC_ERRCAL [1], BSC_ERRCAL [2]
 HISTORY:
	11-Oct-96.  Written. A.C. Sterling
	02-Jun-97.  ACS. Added error field
	09-Sep-98.  ACS. Fixed error in counts sum (removed faulty time norm).
	11-Sep-98.  ACS. Switched to Dominic's bsc_errcal code.


SUM_FLUXES $SSW/yohkoh/ucon/idl/hudson/sum_fluxes.pro
[Previous] [Next]
 NAME:
       SUM_FLUXES	
 PURPOSE:
	sum fluxes in an image over an array of pixels above a fraction
	  of the peak-brightness pixel within that array
 CATEGORY:
	Yohkoh
 CALLING SEQUENCE:
 	sum_flux = sum_flux(image, indices, fraction)	
 	sum_flux = sum_flux(image, indices, fraction, /fixed)	
 INPUTS:
	image is an array of images
	indices is an array of pixel numbers, gotten eg from DEFROI
	fraction is the cut, eg 0.1 or 0.5, of peak brightness within
	  the area defined
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
       /fixed forces interpreting fraction as a fixed level in image
	  brightness units
 OUTPUTS:
 	sum of pixel contents meeting those conditions	
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
	HSH, written 16-Mar-94


SUMM_CALS $SSW/yohkoh/bcs/idl/atest/summ_cals.pro
[Previous] [Next]
 NAME:
	SUMM_CALS
 PURPOSE:
	Reports countrate, HV and Temps for Source Cals
 CALLING SEQUENCE:  
	summ_cals [,/log]
 INPUTS:

 OPTIONAL INPUTS:

 KEYWORD INPUTS:
	log		name of file for log; not logged if absent
	pause		if present, pauses at key places...
 OUTPUTS:

 OPTIONAL OUTPUTS:

 CALLS: ***
	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], RD_BDA_DP
	STR2ARR [1], STR2ARR [2], break_file [4], concat_dir [4], fmt_tim [1], fmt_tim [2]
	systime2 [1], systime2 [2]
 RESTRICTIONS:
	No allowance for background made. Channels 1,2 can have high
	values at times because of particle background...
 PROCEDURE:

 MODIFICATION HISTORY:
	RDB  29-Nov-97	Written...


summary $SSW/yohkoh/ucon/idl/pike/summary.pro
[Previous] [Next]
                SUMMARY.PRO                                           
                                                                      
  Program to produce summary plots of BDA data files                  
                                                                      
                                                                      
                                                                      
  Use:                                                                
          IDL> .run test_rd              (include dp_sync data)  
          IDL> .run summary     


  Based on original pp_cratex.pro   RDB   Fall '91                    
                                    CDP   Dec '91                     


  Bug fix to cope with roadmap and dp_sync data starting on different 
  sides of 00:00 hrs UT                    Jan 92  CDP                
                                                                      
  Generalize extraction of file name and extension   Mar 92   CDP
  Fix to bypass the yohkoh_events                    May 92
 


SUMROW [3] $SSW/yohkoh/gen/idl/util/sumrow.pro
[Previous] [Next]
  NAME:
	SUMROW

  PURPOSE:
	Some along rows of a matrix

  CALLING SEQUENCE:
	Vector = SUMROW(A)

 CALLED BY
	HXT_LOW_SUM, font_size [1], font_size [2], lcwda, sat_obs_loc, text_size


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

   Purpose: running sum of a vector (must have been done 10e9 times)

   Method: brute force (hurry)
   
 CALLS: ***
	TOTVEC, deriv_arr [1], deriv_arr [2]
   History:
      14-mar-1995 (SLF)


SUN_B0 $SSW/yohkoh/sxt/idl/register/sun_b0.pro
[Previous] [Next]
 NAME:
	SUN_B0
	
 PURPOSE:
	Calculate solar reference angle B0 for date specified by D79

 CALLING SEQUENCE:
	B0 = SUN_B0(DAY79)

 INPUT:
	DAY79 = Decimal days since 1 January, 1979

 OUTPUT:
	B0 = Heliographic latitude of the central point of the

 CALLS: ***
	dont_use_this [1], dont_use_this [2]
 MODIFICATION HISTORY:
	Version 1.0 - Jan, 1991, Written, G. L. Slater, LPARL

 NOTES:
	See PB0R.PRO for more information on this calculation.


sun_grid $SSW/yohkoh/ucon/idl/wuelser/sun_grid.pro
[Previous] [Next]
 NAME:
        sun_grid
 PURPOSE:
        read a full disk solar image and overlay a grid
 CATEGORY:
 CALLING SEQUENCE:
        grid_gif,file,date
 INPUTS:
        file = file name (default: pop up menu of the current directory)
        date = 'dd-mmm-yy'  for b-angle (default = current date)
 KEYWORDS (INPUT):
        /click = do not use limb finder, but manually click limbs
        /ten = plot grid at 10 degree intervals (default = 15 degrees)
        /geo = for images with terrestrial N up and E to the left.
        roll = roll angle.  Direction to heliographic N, measured in
               degrees ccwise from image top.
               Default = 0 (or p-angle, if /geo set).
        /nogrid = don't draw grid (just display the image)
 Keywords specific to the Hawaii directory structure:
        /big = search the directory /solar/daily/GroundObs/BigBear.
        /sel = search the directory /solar/daily/GroundObs/SEL.
        /kit = search the directory /solar/daily/GroundObs/KittPeak.
        /cat = search the directory /solar/daily/GroundObs/Catania.
        /sxt = search the directory /solar/daily/Yohkoh/data.
        /bb = search the directory ~/BB_IMAGE.
 OUTPUTS:
 KEYWORDS (OUTPUT):
 CALLS: ***
	CLICKLIMB, DRAW_GRID [1], DRAW_GRID [2], DRAW_GRID [3], FITIM2INTS, MWLT_CENTER
	READ_GIF, RFITS [1], RFITS [2], RFITS [3], file_menu [1], file_menu [2]
	get_rb0p [1], get_rb0p [2], gt_pix_size, restsys [1], restsys [2], savesys [1]
	savesys [2], sxt_cen [1], sxt_cen [2]
 COMMON BLOCKS:
        None.
 SIDE EFFECTS:
 RESTRICTIONS:
        Can only read gif, jpeg, and fits files at this point
        Limb finder works for SEL Ha gif and BBSO Ha jpg.
        Does NOT work with BBSO fts (S up, labels too big).
 PROCEDURE:
 MODIFICATION HISTORY:
        JPW, 3-aug-95


SUN_P $SSW/yohkoh/sxt/idl/register/sun_p.pro
[Previous] [Next]
 NAME:
	SUN_P
	
 PURPOSE:
	Calculate solar reference angle P date specified by D79

 CALLING SEQUENCE:
	P = SUN_P(DAY79)

 INPUT:
	DAY79 = Decimal days since 1 January, 1979

 OUTPUT:
	P = Position angle of the northern extremity of the axis
	    of the sun's rotation, measured eastward from the
	    geographic north point of the solar disk.

 CALLS: ***
	dont_use_this [1], dont_use_this [2]
 MODIFICATION HISTORY:
	Version 1.0 - Jan, 1991, Written, G. L. Slater, LPARL

 NOTES:
	See PB0R.PRO for more information on this calculation.


SUN_R $SSW/yohkoh/sxt/idl/register/sun_r.pro
[Previous] [Next]
 NAME:
	SUN_R
	
 PURPOSE:
	Calculate the solar radius in arc seconds measured outside
	earth's atmosphere for the date specified by D79

 CALLING SEQUENCE:
	R = SUN_R(DAY79)

 INPUT:
	DAY79 = Decimal days since 1 January, 1979

 OUTPUT:
	R = Solar radius in arc seconds measured outside earth's
	    atmosphere

 CALLS: ***
	dont_use_this [1], dont_use_this [2]
 MODIFICATION HISTORY:
	Version 1.0 - Jan, 1991, Written, G. L. Slater, LPARL

 NOTES:
	See PB0R.PRO for more information on this calculation.


sun_today [2] $SSW/yohkoh/gen/idl/atest/fl_suntoday.pro
[Previous] [Next]
 NAME:
	sun_today
 PURPOSE:
       create sun_today image for showpix (guts from first_light)
       read the existing genx file version by default (speed)

 Calling Sequence:
    sun_today, suntoday, r, g, b,/generate	; create new image (slow)
    sun_today, suntoday, r, g, b	      ; read existing showpix copy (faster)

 Input Parameters: 
   none

 Output Parameters:
   suntoday - collage of SXT and groundbase images [bytarr(850,850)]
 
 CATEGORY:
 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]
	fl_suntoday [1], fl_suntoday [2], fl_suntoday [3], 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]
 MODIFICATION HISTORY:
       ------- edited modification history for first_light -------
	HSH, written July 1993
       da       30-Apr-94, Produces collage of SXT + 4 GBO images
       BNH       6-Jul-94, Changed display stuff for collage to 
			    (hopefully) better deal with varying
                           background in gki, gkm images
       SLF  - 10-Jul-1994 Broke out collage, wrote to Z-buffer 
			   return the collage and color table vectors
       SLF  - 12-Jul-1994 Scale character size (Z ne X), allow read of existing
       SLF  -  6-Sep-1994 Eliminate offpoint check
       SLF  - 15-Sep-1994 Only reposition GBO for non-offpoint images
                          incorporate fl_annotate (specialized) 
       SLF  -  8-oct-1994 Call GAL's <halp.pro> to clean big bear
       SLF  -  9-oct-1994 Fill out ~256 pixels for better resolution
                          make white light temporary file.
       SLF  - 10-oct-1994 took out rotation of white light (FITS arrows flipped??)
       SLF  - 19-oct-1994 use get1gbo instead of lastgbo 
	SLF  - 16-jan-1995 protect against no recent gbw case
	SLF  -  3-mar-1995 expand window (temporary fix)
       SLF  - 21-jun-1995 He 10830 scaling per J.Gurman/H.Jones
       SLF  -  5-jul-1995 verify GNT image integrity or go back in time...
       SLF  - 10-jul-1995 use SOON instead of BBSO (format problem)
       SLF  - 24-sep-1995 adjusted scaling for soon/gbh/gkm
			   Call histscale.pro for gbh, gkm
       SLF  - 12-mar-1996 gkm scaling (may already be scaled)
       NN   -  9-May-98   shrank He 10830 image slightly so that time be readable.


sun_today [3] $SSW/yohkoh/gen/idl/util/fl_suntoday.pro
[Previous] [Next]
 NAME:
	sun_today
 PURPOSE:
       create sun_today image for showpix (guts from first_light)
       read the existing genx file version by default (speed)

 Calling Sequence:
    sun_today, suntoday, r, g, b,/generate	; create new image (slow)
    sun_today, suntoday, r, g, b	      ; read existing showpix copy (faster)

 Input Parameters: 
   none

 Output Parameters:
   suntoday - collage of SXT and groundbase images [bytarr(850,850)]
 
 CATEGORY:
 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]
	fl_suntoday [1], fl_suntoday [2], fl_suntoday [3], 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]
 MODIFICATION HISTORY:
       ------- edited modification history for first_light -------
	HSH, written July 1993
       da       30-Apr-94, Produces collage of SXT + 4 GBO images
       BNH       6-Jul-94, Changed display stuff for collage to 
			    (hopefully) better deal with varying
                           background in gki, gkm images
       SLF  - 10-Jul-1994 Broke out collage, wrote to Z-buffer 
			   return the collage and color table vectors
       SLF  - 12-Jul-1994 Scale character size (Z ne X), allow read of existing
       SLF  -  6-Sep-1994 Eliminate offpoint check
       SLF  - 15-Sep-1994 Only reposition GBO for non-offpoint images
                          incorporate fl_annotate (specialized) 
       SLF  -  8-oct-1994 Call GAL's <halp.pro> to clean big bear
       SLF  -  9-oct-1994 Fill out ~256 pixels for better resolution
                          make white light temporary file.
       SLF  - 10-oct-1994 took out rotation of white light (FITS arrows flipped??)
       SLF  - 19-oct-1994 use get1gbo instead of lastgbo 
	SLF  - 16-jan-1995 protect against no recent gbw case
	SLF  -  3-mar-1995 expand window (temporary fix)
       SLF  - 21-jun-1995 He 10830 scaling per J.Gurman/H.Jones
       SLF  -  5-jul-1995 verify GNT image integrity or go back in time...
       SLF  - 10-jul-1995 use SOON instead of BBSO (format problem)
       SLF  - 24-sep-1995 adjusted scaling for soon/gbh/gkm
			   Call histscale.pro for gbh, gkm
       SLF  - 12-mar-1996 gkm scaling (may already be scaled)


sunsets $SSW/yohkoh/ucon/idl/acton/sunsets.pro
[Previous] [Next]
 NAME:
   sunsets
 PURPOSE:
   To examine sunset images and select good ones.
 CALLING SEQUENCE:
   sunsets,data,info_array,sx=[2,3]
 INPUTS:
   data   = SXT data cube, all images of same exposure.
   info_array = the usual produced by get_info2(index) or yodat
   sx = index array of pairs of sunlight and sunset images where the
       sunlight images come first, e.g.,
       sx=[1,2,3,4,10,9,10,11,12,13,17,18]
 OUTPUTS:
   First the sunset image is displayed with a pause, no tv scaling is done
   Then the normal image is displayed with a pause, no tv scaling is done
   Then the difference of the (sum of lines 10:15)/6 is presented
  INTERPRETATION
       No x-ray features and scatter around 0 = good sunset image
       Largely positive values = sunset image too late (faint)
       Negative values = poor choice of sunlight image, try again.

  NOTE -- the following is to remind me how to select sunset images.
  From morrison@sxt2.space.lockheed.com Thu Aug 12 10:04:09 1993
  rd_roadmap, infil, roadmap      ;or have already done this through YODAT
  tim2orbit, roadmap, tim2night=tim2night
  ss = where(tim2night lt 1)      ;tim2night is in minutes

  MODIFICATION HISTORY
     Programmed 12-Aug-93 by LWA
 CALLS:


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

   Purpose: distribute files in path into Yohkoh SW tree.
            original purpose is for atest

   Input Parameters:
      path - input pathname (default=/ys/atest/soft)
      
   Keyword Parameters
      olderthan - age of files to afect - only files older than this
      interactive - if set, user can specify action for files not on line
      testing - if set, no commands are actually spawned

   History: slf,  4-Feb-1993
	     slf,  7-Feb-1993	; delete, user input options
	     slf, 13-may-1993   ; asthetic details
	     slf, 26-oct-1993	; clean up not online file 

 CALLS: ***
	ATEST2TREE, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1]
	CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], SPLIT_FILES, break_file [4]
	concat_dir [4], file_append [1], file_append [2], file_exist [1], file_exist [3]
	mk_mapfile [1], mk_mapfile [2], path_sw [1], path_sw [2], prstr [1], prstr [2]
	wmenu_sel [1], wmenu_sel [2]
   Restrictions: unix only, user generally requires root priviledge 


SW_ELAPSED_TIME $SSW/yohkoh/ucon/idl/hudson/sw_elapsed_time.pro
[Previous] [Next]
 NAME:
	SW_ELAPSED_TIME
 PURPOSE:
	Estimate elapsed time for solar wind flow to a given radial distance
	  (eg, distance = 1.5 means out to 0.5 Ro above photosphere; distance =
	  214 means out to one AU).
	The calculation is for the Withbroe minimum polar hole model,
	  but with the ref_vel keyword one can scale to any velocity 
	  at one AU (default 588 km/s)
 CATEGORY:
	Yohkoh
 CALLING SEQUENCE:
	time = sw_elapsed_time(distance)
 INPUTS:
	distance in solar radii
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
	ref_vel = sw speed in km/s
	ref_dist = radial distance of reference, AU (default 1)
	bin = integration grid (points per Ro, default 1000)
 OUTPUTS:
	time in days
 CALLS: ***
	SW_VEL_MODEL
 CALLED BY:
	HELIO_FOOT
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
	doesn't handle some special cases. 
 MODIFICATION HISTORY:
	HSH, written 8-Feb-1994
	HSH, modified to vectorize and extend range 13-Feb-1994
	HSH, extended the range again to 1000 R_sun via SW_VEL_MODEL


sw_tape $SSW/yohkoh/gen/idl/tape/sw_tape.pro
[Previous] [Next]
   Name: sw_tape

   Purpoes: save or restore yokoh software to and from archive tapes

   Input Parameters:
      device - string variable containing device name (tape,disk)

   Keyword Parameters:
      save (input) - if set, generates tar commands to save software to
		      the tape
      restore (input) - if set, generates tar command to restore
			 software from tape to disk.
      direct (input) - if set, uses this string variable as the upper
			pathname for save and restore - default to /ys
      subsets (input) - subdirectories to save - relatvie to direct

      all (input)     - restore only - all software restored

      disc (input)    - if set, output to disc at direct=disc
			 file names derived from subset names

   Ouput - function returns string array of tar commands - it is
	    assumed that these are appended or form a script file
	    which is written by the calling program or they can be
	    spawned by the caller.

   History - written by slf, 11/8/91
	13-Jun-93 (MDM) - Modified so that the compressed tar files are
			  saved to the tape

 CALLS:
 CALLED BY
	RdTap [1], RdTap [2], RdTap [3], mktap


SW_VEL_MODEL $SSW/yohkoh/ucon/idl/hudson/sw_vel_model.pro
[Previous] [Next]
 NAME:
 	SW_VEL_MODEL	
 PURPOSE:
	generate a velocity profile based on Withbroe's model for polar
	  @ solar minimum (reference G.L. Withbroe, Ap. J. 325, 442, 1988)
	the crude assumption here is that the solar wind doubles in speed
	   (from 294 to 588 km/s) between 10 Ro and 1 AU.
 CATEGORY:
	Yohkoh
 CALLING SEQUENCE:
 	vel = sw_vel_model(radii, vel=vel, rad=rad)	
 INPUTS:
	radii to calculate at (monotonic, units R_sun)i
 KEYWORDS:
	vel scales the whole model to an observation at 1 A.U.
	rad provides an input for a reference radial distance for the scaling
	  velocity, ie if Ulysses were not at 1 AU for example 
 OUTPUTS:
	velocities on the grid of points in radii
 CALLS: ***
	DSPLINE
 CALLED BY:
	SW_ELAPSED_TIME
 RESTRICTIONS:
	only works out to 1000 R_sun = 4.67 A.U., and probably doesn't
	  mean much that far out anyway (blame Withbroe, of course)
 MODIFICATION HISTORY:
	HSH written 8 Feb. 1994 (rad not implemented)


sxl2radiance $SSW/yohkoh/sxt/idl/atest/sxl2radiance.pro
[Previous] [Next]
 NAME:
	sxl2radiance
 PURPOSE
	To calculate the spectral radiance at the sun in a band from SXT signals 
	averaged over specified time intervals.  Assumed spectrum is from
	the temperature derived from Al.1/AlMg filter ratio for the same
	time interval.  Convert to irradiance if keyword set.
 CALLING EXAMPLES
	output_structure=sxl2radiance([10,18],24.*60.*60.)
	out=sxl2radiance(edges,dtime,index,flux,indata=indata, $
		sttime=sttime,endtime=endtime, $
		photon=photon,erg=erg,debug=debug,loud=loud, $
		irradiance=irradiance,new=new)
 INPUT
	edges, 1-d array of wavelengths (A) defining bands for flux ratio analysis
	  Note:  Band limits must lie within the range 1.26867-298.029 A.
	dtime, length of averaging time intervals (seconds)
 OPTIONAL INPUT
	index, index structure from sxl_analysis.pro
	flux, signal structure from sxl_analysis.pro
 OPTIONAL KEYWORD INPUT
       indata, name of .genx file with the sxl fluxes and index
		required if index and flux are not passed in.
	sttime, starting time of desired analysis interval
	endtime, ending time of desired analysis interval
     Note:  If sttime or endtime are not provided analysis refers
		to index for the start and/or end time.
	/photon, do computations in photons 
	/erg,    do computations in ergs (default)
	/debug, stops program just before end
	/loud,  prints out a lot of results to screen
	/new,  force reading of sxl data from SXT database
	/irradiance, output irradiance, i.e., (flux/cm^2/s) at earth.
 OUTPUT 
	IDL structure containing:
		time, day:	structure times of midpoints of intervals
		fmttim:		ascii time of midpoints of intervals
		units:	ergs/cm^2/s, ergs/s, photons/cm^2/s, or photons/s
		temp:	alog10(temperature), [K]
		em:	alog10(emission measure), [cm^-3]
		interp:	=0 for temp & em values computed from data
			=1 for interpolated temp & em values
		al:	SXT Al.1 average full-disk signal for interval (DN/s)
		almg:	SXT AlMg average full-disk signal for interval (DN/s)
		band:	edges in angstrom of spectral band(s)
		rad:	spectral radiance(s) for the specified band(s)
	  			in photons or ergs per wavelength bin
 CALLS: ***
	INTERPOL, KILL_INDEX [1], KILL_INDEX [2], PMM [3], SXT_TEEM2 [1], SXT_TEEM2 [2]
	SXT_TEEM2 [3], UNIQ [1], UNIQ [2], UNIQ [3], anytim2ints [1], anytim2ints [2]
	choose_pairs, divyup, fmt_tim [1], fmt_tim [2], gt_filtb, pmm [1], pmm [2]
	restgen [1], restgen [2], sxl_analysis, sxl_select, sxt_chk_era, sxt_flux [1]
	sxt_flux [2], sxt_flux [3], sxt_sig_per_dn_lwa, tim2dset [1], tim2dset [2]
	Example:	** Structure <40373688>, 10 tags, length=944, refs=1:
			   TIME            LONG          43200000
			   DAY             INT           5672
			   FMTTIM          STRING    '12-JUL-94  12:00:00'
			   UNITS           STRING    'photons/s'
			   TEMP            FLOAT           6.35518
			   EM              FLOAT           48.8143
			   INTERP	   INT		 0
  			   AL              FLOAT       4.75468e+06
			   ALMG            FLOAT       2.36557e+06
			   EDGES           FLOAT     Array[111]
  			   RAD             FLOAT     Array[110]
 OPTIONAL KEYWORD OUTPUT 
 PRINTED OUTPUT
 RESTRICTIONS
	Oribital variation of AU ignored in computing irradiance.
 PROGRAMS CALLED
	sxl_analysis, sxl_select, sxt_flux, sxt_teem2,
	sxt_sig_per_dn_lwa, stdev
 HISTORY
	14-Jul-99  LWA  Created from sxl2radiance.pro.
	19-Jul-99  LWA  Temporary fix to for-loop to deal with JUMP.
	 3-Aug-99  LWA  Derive temperatures from sxt images out to
			Rsun=1.1 only, to improve signal to noise.
	 2-Nov-99  LWA  Deleted all unused junk still in sxl2rad3.pro.
	 3-Nov-99  LWA  Changed step 2 to force use of right date.
			Added irradiance keyword.
      	 4-Nov-99  LWA  Added code to properly handle leak-era boundaries.
                       Pad arrays to make alout and dgout same length.
	18-May-00  LWA  Changed all "for loops" to data type long.
	19-May-00  LWA  Installed check to assure data series are same length.
	24-Jan-01  LWA  Renamed from sxl2rad5.pro
	21-Dec-01  LWA  Deleted obsolete te_corr keyword.
			Changed all indgen to lindgen.


sxl_analysis $SSW/yohkoh/ucon/idl/acton/sxl_analysis.pro
[Previous] [Next]
       NAME: sxl_analysis


       PURPOSE: Collect data from the SXL data base for study of the
		radiative output of the corona within different brightness
		regimes versus time.  Basic input data are the SXL 
		histograms.  Output data are total decompressed DN/HRpix/sec.
		The normalization to /sec comes from the fact that the 
		SFDs are normalized this way. 
	COMMENTS - (3/10/96):
                Changed the conversion to throw away sxl(dn)=0
		to compensate error introduced by mk_sfd ignoring
		negative values after dark/leak subtraction.  Kept integer
		truncation of sfd_decomp as this gave a more accurate
		result for the 1 case (25-May-95) tested.
		 However, for the on-disk fluxes between levels I have
		kept the sxl(dn)=0 in the sum because the on-disk intensities
		are more likely to be above background.

       CALLING SEQUENCE:
           sxl_analysis, sttime, entime, index, flux $
              [, filter=filter, res=res, lvls=lvls]
           sxl_analysis,'1-dec-92','15-feb-93',ind0,flux0
	    sxl_analysis,'1-dec-92','15-feb-93',ind0,flux0, $
		filter=2,res=[1,2]

       INPUT:
               sttime = starting time
               entime = ending time

	OPTIONAL KEYWORD INPUT
		filter, (2=Al.1, 3=AlMg), default=3
		  can do either filter or both, i.e., filter=[2,3]
		res = resolution, (1=half, 2=qrtr), default=1
 CALLED BY:
	sxl2radiance
		  Note: QR data have been multipled by 4 to match HR data.
		lvls = Brightness levels in sfd_compressed DN for basis
                 of sorting on-disk data.
		  Default: lvls = [0, 50, 100, 150, 255]; for AlMg
                 Use:     lvls = [0, 62, 112, 161, 255]; for Al.1
		/loud, prints out diagnostic info

       RETURNED/OUTPUT:
         ***Note: QR data HAVE BEEN multipled by 4 to match HR data.***
               index  = index(nn) of sfd images analyzed
		flux(6,nn) = array of fluxes in decompressed DN/sec
	  flux(0,nn) = signal in the entire image
	  flux(1,nn) = signal above radius = 1.05 solar radius
         flux(2:5,nn) = Total DN per second of on-disk (R<0.86Rsun) image
                             within the intervals set
                             by the array lvls within the program.
                             Presently lvls = [0,50,100,150,255].

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], KILL_INDEX [1]
	KILL_INDEX [2], RD_XDA [1], RD_XDA [2], concat_dir [4], file_exist [1]
	file_exist [3], gt_filta, gt_filtb, gt_res, prstr [1], prstr [2], sfd_decomp
	str_concat [1], str_concat [2], sxt_cen [1], sxt_cen [2], week_loop [1]
	week_loop [2], week_loop [3]
	RESTRICTIONS:
	     1. Program returns at least a full week of data, even if
		sttime, entime span less than a week.

       HISTORY:
               Written by LWA 25-Feb-94
		Expanded and changed to read one week at a time 2-Mar-94
		Changed to output roadmap rather than index 2-mar-94.  lwa
		Changed to allow keywords and print info while running,
		  also use STR_CONCAT.  3-Mar-94, lwa.
		Changed header to explicitely state that output is 
		  decompressed DN/sec.
		Added clarifications on QR data and sttime, entime span
		  LWA 11/18/95, 12/8/95.
		Empirical mod to compensate for serious "flux enhancement"
		  by mk_sfd for low signal cases where all zero or negative
		  values of the corrected image are set = 1.  LWA 3/10/96
		Incorporate smaller index structure.  LWA 3/10/96
		Changed name from sxl_analysis2 to sxl_analysis. LWA 12/5/97
		Changed variable filtr back to filter for historical reasons.
		and modified so both Al.1 and AlMg can be done at once.  LWA 6/24/99
		4-Jul-99 LWA, Added keyword loud.
		4-Nov-99 LWA, Replaced delind with kill_index.
		21-Jul-00 LWA, Clarified header definition of flux(2:5,nn)
		  and changed extension to a.03.
		 1-Aug-00 LWA, Changed extension back to a.02 (dumb mistake).
		10-May-01 LWA, Fixed Y2K problem in file generator.


sxl_clip $SSW/yohkoh/ucon/idl/acton/sxl_clip.pro
[Previous] [Next]
 NAME:
	sxl_clip
 PURPOSE
 	Written to identify extra high or low SXL flux values.
       Plot results for eyeball judgment of effectiveness.
 CALLING SEQUENCE
	sxl_clip,data,out [,ii=ii,width=width,level=level,/verbose $
		,/keep,/verbose]
 INPUT
	data, data array from sxl_analysis to clip, e.g, data(0,*).
 OPTIONAL KEYWORD INPUT
       ii, array of indices to process.  Default:  All data.
	width, smoothing width.  Default:  17
	level, +/- clipping level.  Default:  0.25
	/keep, return the indices of unclipped data.
       /verbose, print out "help" listings of input and output arrays.
	/noplot, skip plot output
 OUTPUT
	out, vector of indices of rejected or accepted (/keep)
	     data points.  I.e., if array ii is input then output
	     is out=ii(rejected) or out=ii(accepted).
 HISTORY
 	11/18/95, LWA, written.
	12/08/95, LWA, cleaned up and generalized.
	12/11/95, LWA, added keyword verbose.
	 8/10/98, LWA, put in test for negative values.
		       put in forgotten keyword ii.
	 8/03/00, LWA, corrected error in neg value logic.
 CALLS:
 CALLED BY
	sxl_select


sxl_select $SSW/yohkoh/ucon/idl/acton/sxl_select.pro
[Previous] [Next]
 NAME:
       sxl_select
 PURPOSE
       To prepare data for sxl2irradiance.
               1. Identify SXL data to be rejected because of offpointing
                  hot CCD, eclipse, etc., etc. (about 2%).
               2. Average data into dtime intervals, uses divyup.pro.
 INPUT
       index, index structure from output of sxl_analys.pro
	data,  DN/s signal array from sxl_analysis
	dtime, time interval (seconds) over which to average data
 KEYWORD INPUT
	start, the starting time for grouping of data by divyup.pro
	endt, the ending time for grouping of data.  If groups extend
		beyond this time the later groups are deleted.
 OPTIONAL KEYWORD INPUT
       minsamp, minimum samples in an interval required for processing,
               default = 1
 OUTPUT
	Array of average signal levels for each time interval.
	Intervals with no valid data set equal to -1.
 KEYWORD OUTPUT
       tout, structure of mid-points of day averages.
 OPTIONAL KEYWORD OUTPUT
       nout, array giving number of samples in each average value.
       ok, indices of good data
 PROGRAMS CALLED
	int2secarr, sxl_clip, divyup
 HISTORY
       24-Jun-99, LWA, rewritten from sxl_dg_analysis.pro
	28-Jun-99, LWA, added start keyword
 CALLS:
 CALLED BY
	sxl2radiance


SXS_EFF $SSW/yohkoh/ucon/idl/hudson/sxs_eff.pro
[Previous] [Next]
 NAME:
	SXS_EFF
 PURPOSE:
	read calibration file for SXS spectral response (effective area
	  data provided by Takahashi_kun in file PHEF.DATA
 CALLING SEQUENCE:
	sxs_eff,energy,area,plot=plot
 OUTPUTS:
	energy = energy of calculation (fltarr(2) for SXS1 and SXS2)
       area = effective area (fltarr(2))
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], RDFILE [1], RDFILE [2]
	concat_dir [4]
       note: there are 128 points
 KEYWORDS:
 	/plot makes a plot
 HISTORY:
	HSH, written Nov. 27, 1992


SXSCV $SSW/yohkoh/ucon/idl/takahash/sxscv.pro
[Previous] [Next]
ROUTINE:
        SXSCV
PURPOSE:
        Return a structure of SXS-PC data including time-data. 
        A dead-time correction is also performed. Output data is 
        pulse count data (count/sec) with full time resolution.
        The begin time of time-data is corresponding to time 
        of index(0). 
INPUT:
        data     - structure data (from WDA data)
        index    - index structure
OUTOUT:
        ** Structure  SXS_PC, 5 tags
           TIME        DOUBLE    Array 
           PC11        DOUBLE    Array
           PC12        DOUBLE    Array
           PC21        DOUBLE    Array
           PC22        DOUBLE    Array
KEY WORD PARAMETER:
        plot  -   If set, SXSPC is called and PC-data
                   is ploted with UTPLOT. 
 CALLS: ***
	SXSPC
EXAMPLE:
             idl> pcdata=sxscv(data,index)
        of   idl> pcdata=sxscv(data,index,/plot)
PLOT:  
        Use UTPLOT in the follwing example,

         idl> utplot,pcdata.time,pcdata.pc11,index(0)

        You can also use SXSPC which was made by me
        in the following,

         idl> sxspc,pcdata,index  
HISTORY:
        M.Takahashi(Tokai Univ.) Early  1-Sep-1992
                                        1-Jun-1993  For UTPLOT
                                       11-Jun-1993  Dead time correction
                                       16-Aug-1993  Changed to Function


SXSPC $SSW/yohkoh/ucon/idl/takahash/sxspc.pro
[Previous] [Next]
NAME:
         SXSPC
PURPOSE:
         From sxs-pc data made by sxscv, light curve is ploted,
         blown up and Post Script file is made. All operation
         is performed with mouse-device.
INPUT:
         pc_data   -   Structure data made by SXSCV
         index     -   index data structure
 CALLS: ***
	UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6]
	plot_lcur [1], plot_lcur [2], wmenu_sel [1], wmenu_sel [2]
 CALLED BY:
	SXSCV
EXAMPLE:
             idl> sxspc,pc_data,index
HISTORY:
         M.Takahashi (Tokai Univ.) Early  1-Sep-1992
                                          1-Jun-1993 for UTPLOT
                                         16-Aug-1993 for PLOT_LCUR


sxt2file $SSW/yohkoh/sxt/idl/util/sxt2file.pro
[Previous] [Next]
   Name: sxt2file

   Purpose: Convert an SXT image file to a standard format (fits/jpeg/gif/tiff)

   Input Parameters:
      index - SXT Index record(s)
      data  - SXT image(s)
      r,g,b - if permitted by output format, optional 8bit color table values

   Keyword Parameters:
      infil - If supplied, read from SDA file to get INDEX and DATA
      ss - (used with infil option only)  - only process these file images
      outsize - if set, image will be "congridded" to this size
      mag_fact - if set, magnification factor (instead of outsize)
      outdir - output directory (default is apprpriate WWW image area)
      replace - if set, overwrite existing file 
      fits - if set, output files are FITS format
      gif  - if set, output files are GIF format
      jpeg - if set, output files are JPEG format
      tiff - if set, output files are TIFF format
      pict - if set, output files are PICT format
      quality - optional quality (JPEG only)
      currentcolor - switch, if set, use current R,G,B values
      red/green/blue - optional color table values (3x256 bytes)
      prefix - if set, output file prefix name (default='sxt')
      goes (input) switch, if set, merge GOES lightcure/timeline w/imag

   Calling Sequence:
      sxt2file, index, data, [r,g,b, /gif,/tiff,/jpeg,/fits, outsize=outsize]
      sxt2file, infil=infil, /gif,/tiff,/jpeg,/fits, red=red,blue=blue,green=green

   Calling Examples:
      sxtfile, index, data, /gif, outsize=256
      sxtfile, infil='$DIR_SXT_SFM/sfm950300.0000', /jpeg, quality=25
   
   Notes:
      Makes one file per SXT image - output file name is:
         PREyymmdd.hhmm.XXX  (PRE=user supplied prefix, default='sxt')
                             (XXX=gif/fits/tiff/jpeg/pict)

      If r,g,b postional or RED,GREEN,BLUE keywords  are not specified then:
         switch /CURRENTCOLOR - will use current color table
	  otherwise, a default RED greyscale table is assigned
	  (original color is restored prior to return)
 
      If OUTDIR not specified, looks under WWW area (environ "path_http")
      for         1) ../im*g*/XXX   (ex: ../images/gif, ../img/fits)
		   2) ../im*g*	     (ex: ../img, ../image, /images)
      If OUTDIR and $path_http not defined, uses current directory

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], CONGRID [1], CONGRID [2]
	CONGRID [3], FILE_EXIST [2], FMT_TAG [1], FMT_TAG [2], LOADCT, RD_SDA [1]
	RD_SDA [2], RD_SDA [3], SINCE_VERSION [1], SINCE_VERSION [2], STRETCH
	anytim2ex [1], anytim2ex [2], concat_dir [4], curdir [1], curdir [2], data_chk [1]
	data_chk [2], event_movie [1], event_movie [2], ex2fid [1], ex2fid [2]
	file_exist [1], file_exist [3], get_logenv [1], get_logenv [2], get_subdirs [1]
	get_subdirs [2], gt_shape_cmd, is_member [1], is_member [2], pr_status [1]
	pr_status [2], prstr [1], prstr [2], rd_tfile [1], rd_tfile [2], savegen [1]
	savegen [2], str_replace [1], str_replace [2], ut_time [1], ut_time [2]
	wc_where [1], wc_where [2]
 CALLED BY:
	sxt2mpeg
   Restrictions:
      TODO: Update FITS header if outsize specified

   History:
      22-Sep-1995 (SLF) - simplify WWW and other file interchange work
      20-oct-1995 (SLF) - add PICT keyword and function
      25-oct-1995 (SLF) - add LOG and PREFIX keywords and function
      13-nov-1995 (SLF) - add MAG_FACT keyword 


SXT2HXAXY $SSW/yohkoh/gen/idl/pointing/sxt2hxaxy.pro
[Previous] [Next]
 NAME:
        SXT2HXAXY
 PURPOSE:
        Transform SXT suncenter coordinates into HXA coordinates and
        perform time dependent corrections.  Inverse of hxaxy2sxt.
        Time dependent corrections are: orbital phase correction,
        orbit duration correction, mission time correction (non-periodic).
 CATEGORY:
 CALLING SEQUENCE:
        s_sunc = hxa_suncenter(time_index,h_sunc)
 INPUTS:
        time_index = time vector, e.g., pnt, atr, or ada_index structure.
        s_sunc = array(2,*). suncenter coordinates in SXT fullresolution
                 pixels (FRE pixels).
                 sunc(0,*) = sxt_x, sunc(1,*) = sxt_y
 KEYWORDS (INPUT):
        /noorbit = do not correct for orbital variations of the offset
                   between HXT and SXT.
        /nomission = do not correct for mission time variation of the offset
                     between HXT and SXT.
 OUTPUTS:
        h_sunc = array(2,*). suncenter coordinates in HXA detector pixels.
                 sunc(0,*) = hxa_x, sunc(1,*) = hxa_y
 KEYWORDS (OUTPUT):
 CALLS: ***
	HXA_PARMS [1], HXA_PARMS [2], HXA_PARMS [3], gt_day [1], gt_day [2], tim2orbit [1]
	tim2orbit [2]
 CALLED BY:
	show_hxafid
 COMMON BLOCKS:
        None.
 SIDE EFFECTS:
 RESTRICTIONS:
        The mission time variation of the offset between HXT and SXT is
        well corrected for the first year of Yohkoh.  The correction
        needs to be updated as the project goes on.
 PROCEDURE:
 MODIFICATION HISTORY:
	28-Jul-93 (JPW) - from hxaxy2sxt
       22-Sep-94 (JPW)   Changed to apply mission correction only to pre-1993
                         data.  Extrapolation beyond that caused large errors.
                         Slightly changed algorithm for orbital phase corr.


sxt2mpeg $SSW/yohkoh/sxt/idl/util/sxt2mpeg.pro
[Previous] [Next]
   Name: sxt2mpeg

   Purpose: convert an SXT SDA file to mpeg movie

   Input Parameters:
      sxtfile - sxt file name (default is most recent spd file)
   
   Keyword Paramters:
      movie_name - mpg file name (default is derived)

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], FILE_EXIST [2], FMT_TIMER [1], FMT_TIMER [2], RD_SDA [1]
	RD_SDA [2], RD_SDA [3], Rd_Roadmap [2], anytim2ex [1], anytim2ex [2]
	break_file [4], concat_dir [4], ex2fid [1], ex2fid [2], file_append [1]
	file_append [2], file_exist [1], file_exist [3], get_logenv [1], get_logenv [2]
	grid_data [1], grid_data [2], int2secarr [1], int2secarr [2], line_table, mkthumb
	newfiles [1], newfiles [2], newfiles [3], rd_roadmap [1], rd_tfile [1]
	rd_tfile [2], ssw_deltat, str_replace [1], str_replace [2], sxt2file, ut_time [1]
	ut_time [2]
   History:
      6-nov-1995 (SLF) 
      8-nov-1995 (SLF) - make a thumbnail and html for mpg interface.


SXT2POS $SSW/yohkoh/ucon/idl/hudson/sxt2pos.pro
[Previous] [Next]
 NAME:
     SXT2POS
 PURPOSE:
     dump the Yohkoh/SXT active-region selections
 CATEGORY:
 CALLING SEQUENCE:
     sxt2pos, index
     sxt2pos, index, out
 INPUTS:
     an SXT index record. Takes the first of an array.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
     out is the coordinate array (4,6) = (sxt, heliographic, angular)
 CALLS: ***
	conv_p2a [1], conv_p2a [2], conv_p2h [1], conv_p2h [2], fmt_tim [1], fmt_tim [2]
	gtab_roi
 COMMON BLOCKS:
 SIDE EFFECTS:
     prints the coordinates
 RESTRICTIONS:
 MODIFICATION HISTORY:
     14-Jun-99, written by Hugh Hudson


sxt_adjacent_image $SSW/yohkoh/sxt/idl/atest/sxt_adjacent_image.pro
[Previous] [Next]
   Name: sxt_adjacent_image

   Purpose: return observing log records for preceding/following  

   Input Parameters:
      times - index/roadmap/times of desired images

   Output:
      function returns observing logs (inc times...) of image
      immediately preceding or following input

   Keyword Parameters:
     before/preceding (synonyms) - return preceding image info
     after/following  (synonyms) - return following image info [DEFAULT]
     exact - if set, return eact match (or closest) from obslog
  
   Calling Examples:
      preceding=sxt_adjacent_image(index,/before)
      subsequent=sxt_adjacent_image(index,/after)
      exact=sxt_adjacent_image(index,/exact)

 CALLS: ***
	BOX_MESSAGE, get_utevent [1], get_utevent [2], sort_index [1], sort_index [2]
	tim2dset [1], tim2dset [2], time_window
   History:
      7-Aug-2001 - S.L.Freeland     


sxt_align $SSW/yohkoh/ucon/idl/metcalf/sxt_align.pro
[Previous] [Next]
NAME:
     sxt_align
PURPOSE:
     Determine offest between SXT NaBan and X-Ray images
CATEGORY:
CALLING SEQUENCE:
     sxt_align,output_file,sfrfile_list,ss
INPUTS:
     ouput_file = file name to dump data to
     sfrfile_list = string array(nfiles) of sfr file names
     ss = array(2,nfiles) containing image number of naban and then xray image
          NaBan must always be listed first!
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     /read = if set read previously prepared data file
     max_time = Maximum time difference between images (minutes) (def=5 min)
     /reverse = reverse the order of the sfrfile_list vector (do the 
               files in the reverse order)
     /plot = plot the offsets vs. time
     scut = number of standard deviations away from the mean to cut the
            data.  0 = off, 1 = 1 stdev, 2 = 2 stdev etc.
     /ellipse = fit with an ellipse (passed to sxt_center)
     fltol = tolerance for NaBan sxt_center vs. find_limb check
     /verbose = print stats after every good file
     /norfit = do not fit radius in sxt_center
     /fast = use fast derivative in sxt_center
OUTPUTS:
     statistics on the offset
 CALLS: ***
	FIND_LIMB, RD_SDA [1], RD_SDA [2], RD_SDA [3], SQUEEZE, STDEV, SXT_ALIGN_STATS
	UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6], fmt_tim [1]
	fmt_tim [2], gt_day [1], gt_day [2], gt_time [1], gt_time [2], sxt_center
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
     Calls sxt_center repeatedly
MODIFICATION HISTORY:
     T. Metcalf 5/2/1992
     T. Metcalf 1/21/1994  
        o Added call to find_limb and find_limb check.
        o Added scut keyword
        o Added check for duplicates


sxt_anycomp $SSW/yohkoh/ucon/idl/mctiernan/sxt_anycomp.pro
[Previous] [Next]
 NAME:
       sxt_anycomp
 PURPOSE:
       Calculates the expected SXT response for a spectral fit
 CALLING SEQUENCE:
       cps = sxt_anycomp(tyspec, a, date = date)
 INPUT:
       tyspec= spectral type, 
       a = fit parameters, an array of (ma, ntimes)
         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, a(0) = EM at 1MK, a(1) = c_2, a(2)=c_3
               =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
 KEYWORDS:
      date= a time for the SXT, to be sure that entrance filter
            holes are dealt with correctly
 CALLS: ***
	ADDTIME [1], ADDTIME [2], Countrate, Multresponses, anytim2ints [1]
	anytim2ints [2], fdf10_init, ma_labels
 HISTORY:
      2-Apr-1996, jmm


sxt_av_teem $SSW/yohkoh/ucon/idl/labonte/sxt_av_teem.pro
[Previous] [Next]
  Averages SXT PFI images and computes temperature and
  emission measure from average.


PRO sxt_av_teem, ix1, da1, ix2, da2, te, em, d_te, d_em, $
		align=align, 				$ ; Input
		av1=av1, av2=av2, sum1=sum1, sum2=sum2, $ ; Output
		expose1=expose1, expose2=expose2, 	$ ; Output
		error1=error1, error2=error2,		$ ; Output
		xy1=xy1, xy2=xy2			; Output


  Inputs:
	ix1, da1 = index, data for filter 1
	ix2, da2 = index, data for filter 2

  Outputs:
	te, em = temperature, emission measure images
	d_te, d_em = errors in temperature, emission measure

  Optional Keywords:
    Input
       align = input - if set, does alignment to subpixel accuracy.
		Otherwise, uses registration of SXT_PREP only.
    Output
	av1, av2 = average images, output, DN per millisecond
	sum1, sum2 = sum images, output, DN.
	expose1, expose2 = total exposure time images, milliseconds.
	error1, error2 = uncompression uncertainty images, DN.
	xy1, xy2 = fine alignment offsets, pixels

  Method:
	Calibrates and aligns data, averages, then uses averaged
	data to get Te, EM.  Makes correction for SXT vignetting
	as a function of energy.

  Routines called:  SXT_PREP, SXT_AVERAGE1, SXT_TEEM, KORREL

 CALLS: ***
	AVG [1], AVG [2], KORREL, SXT_TEEM [1], SXT_TEEM [2], gt_expdur [1], gt_expdur [2]
	gt_res, gt_shape, str_concat [1], str_concat [2], sxt_average1, sxt_off_axis
	sxt_prep [1], sxt_prep [2], sxt_prep [3]
  Restrictions:
	Cannot handle switching between Open/NuDen internal to 
	the data sequence.

  History:
	Written  Barry LaBonte  May 28, 1993
	Accurate time units, June 3, 1993  BJL
	Use new SXT_PREP for cal and coarse alignment, add error determination
		rewrite fine alignment. February 3, 1994  BJL
	Fix case of no missing data   March 3, 1994  BJL
	Add vignetting correction.    March 4, 1994  BJL


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

  Aligns and averages a cube of images, accounting for saturated and missing
  data.

PRO sxt_average, index, data, average


 Inputs:
	index, data = index, data cube, uncalibrated

 Outputs:
	average = average image, DN/millisec

 Routines called:
	SXT_PREP, ALIGN_AR, GT_EXPDUR, SXT_AVERAGE1

 CALLS: ***
	ALIGN_AR, gt_expdur [1], gt_expdur [2], sxt_average1, sxt_prep [1], sxt_prep [2]
	sxt_prep [3]
 History:
	Written June 1, 1993 Barry LaBonte
	Separated out SXT_AVERAGE1  June 3, 1993  BJL


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

  Averages a cube of images, accounting for saturated and missing
  data.

PRO sxt_average1, data, texp, average, satpix=satpix, unc=unc, error=error, sum=sum, expose=expose, missing=missing


 Inputs:
	data =  data cube, calibrated, to be averaged. 
	texp = vector of exposure times for the images in data, milliseconds

 Outputs:
	average = average image, DN/millisec

 Optional Keywords:
   Input:
	satpix = cube of saturated pixels
	unc = cube of decompression uncertainty. Used to compute error image.
	missing = lowest valid data value.  Default = 0.  To preserve
		accuracy, set this to a large negative number, < -4096.
   Output:
	sum = sum image, DN
	expose = exposure time image, milliseconds
	error = uncertainty image, DN. Derived from unc cube.


 CALLED BY:
	sxt_av_teem, sxt_average
 History:
	Written June 3, 1993 Barry LaBonte
	Add uncertainty, sum, time images   February 2, 1994   BJL
	Add /MISSING keyword	March 4, 1994   BJL


SXT_BAKEOUT_IN $SSW/yohkoh/sxt/idl/atest/sxt_bakeout_in.pro
[Previous] [Next]

function sxt_bakeout_in,index,cooling_time=incooling_time

NAME:
     SXT_BAKEOUT_IN
PURPOSE:
     Determine if an image is during a bakeout
CATEGORY:
CALLING SEQUENCE:
     bake = sxt_bakeout_in(index)
INPUTS:
     index = index or time.  Used to get the time of the observation
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS:
     cooling_time = Time after the end of the bakeout before the CCD
                    is considered to be cool (hours).  Default = 0.0
OUTPUTS:
     bake = byte array, 0 or 1 depending on whether the index time is
            during a bakeout
 CALLS: ***
	SPLITSTR, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	get_yo_dates [1], get_yo_dates [2], get_yo_dates [3], sel_timrange [1]
	sel_timrange [2]
 CALLED BY:
	mk_sdc [2], mk_sdc [3], mk_sdc [4]
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf 2002-Dec-03


sxt_bleedtest $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_bleedtest.pro
[Previous] [Next]
 NAME:
	sxt_bleedtest
 PURPOSE
	Test for severe CD bleed in SXT images.
 CALLING SEQUENCE
	boolean_array=sxt_bleed(index,data)
 INPUT
	index, SXT index structure
	data, SXT raw, compressed, image or data cube
 OUTPUT
	Boolean vector indicating images with bleed
	   0 = no bleed
	   1 = bleed in >10% of pixels
 PROCEDURE
	Test to see if more than 10% of the pixels in
	row 20 (HR) or row 10 (QR) have DN=255.
 HISTORY
	20-Jan-2004 LWA
 CALLS:
 CALLED BY
	mk_sff_pair [1], mk_sff_pair [2]


SXT_CADENCES $SSW/yohkoh/ucon/idl/sxt_co/sxt_cadences.pro
[Previous] [Next]
 NAME:
   SXT_CADENCES
 PURPOSE:
     Estimate nominal cadence based on bitrate, fov, flush count.
     Has capability of predicting cadence for non-ideal setups.
 CATEGORY:
     Yohkoh
 CALLING SEQUENCE:
 INPUTS:
     User is prompted for fov size, flush count, FFI/PFI-dom state, and DPE.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
 CALLS: ***
	EXPTIM2DPE [1], EXPTIM2DPE [2], gt_dpe, input [1], input [2]
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
     Flush inputs must be decimal, not hex.
 MODIFICATION HISTORY:
     04-jun-98, DMcK, written in rough form
     08-jun-98, DMcK, added estimation of resultant cadence for 
			'marginal' DPEs
      7-oct-98, S.L.Freeland renamed 'cadences' to 'sxt_cadences'

     Eventually want to allow hex input for 'A', since F is a commonly
	used value....DMcK


sxt_cba2os1 [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_cba2os1.pro
[Previous] [Next]
   Name: sxt_cba2os1

   Purpose: extract OS1 from CBA 'index,data'

   Input Parametesr:
      cbaii, cbadd - index,data from 'rd_xda,cbafiles,-1,cbaii,cbadd'

   Output:
      function returns extracted OS1 structure vector

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], BOX_MESSAGE, GETOS1, SXT_STRUCT, data_chk [1]
	data_chk [2]
 CALLED BY:
	yo_mkos1_dbase
   History:
      Circa August 5, 20001  S.L.Freeland 
                             (for shuttere encoder investigations)
      30-Apr-2003 - "complete" for Yohkoh-Galileo project
       6-jul-2005 - add minor frame 05 (res/comp/nexposures)


sxt_cba2os1 [2] $SSW/yohkoh/sxt/idl/atest/sxt_cba2os1.pro
[Previous] [Next]
   Name: sxt_cba2os1

   Purpose: extract OS1 from CBA 'index,data'

   Input Parametesr:
      cbaii, cbadd - index,data from 'rd_xda,cbafiles,-1,cbaii,cbadd'

   Output:
      function returns extracted OS1 structure vector

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], BOX_MESSAGE, GETOS1, SXT_STRUCT, data_chk [1]
	data_chk [2]
 CALLED BY:
	yo_mkos1_dbase
   History:
      Circa August 5, 20001  S.L.Freeland 
                             (for shuttere encoder investigations)


sxt_cen [1] $SSW/yohkoh/sxt/idl/atest/sxt_cen.pro
[Previous] [Next]
NAME:
	sxt_cen
PURPOSE:
	To return the pixel coordinates of the center of the SXT image using
	either GET_SUNCENTER, HXA_SUNCENTER or S/C commanded values.
SAMPLE CALLING SEQUENCE:
	out = sxt_cen(index)
	out = sxt_cen(index, att_perfect=att=perfect)
	out = sxt_cen(index, /hxa)
	out = sxt_cen(index, /cmd)
	out = sxt_cen(index, roll=roll)
	out = sxt_cen(index, roll=roll, /cmd)
       out = sxt_cen(index, /rawcmd)		; dont apply seasonal correct.
INPUT:
	times	- The list of times for which the coordinates are required
 CALLS: ***
	GET_NBYTES, HXA_SUNCENTER, UNIQ [1], UNIQ [2], UNIQ [3], get_att, get_logenv [1]
	get_logenv [2], get_roll, get_suncenter2, sxt_cmd_pnt, tbeep [1], tbeep [2]
	tbeep [3], ydb_exist [1], ydb_exist [2], ydb_exist [3], ydb_exist [4]
 CALLED BY:
	ALIGN1BIGGRAM
	Check the ATT database vs the SXC limb fit database to look for bad
	GET_POINTS, LAY1GKM, MK_SSX, NORH_NORH2SXT [1], NORH_NORH2SXT [2]
	NORH_NORH2SXT [3], NORH_NORH2SXT [4], PFI_CENTER, PLOT_CLON, POLAR_GRID
	PP_MWLT2SXT, PP_SXT2ANY, PP_SXT2VLA, PROM_ON_DISK, QUICKDRIFT [1], QUICKDRIFT [2]
	QUICKLIMB [1], QUICKLIMB [2], SFD_PHOT, SXT_EXPOSURE_MAP, SXT_GRID [1]
	SXT_GRID [2], SXT_GRID [3], SXT_RPAXY, TERM_FIDS, TERM_QUICK, TERM_REVIEW
	TERM_REVIEW_GIF, TEST_ATT, agl2cut, align_prep [1], align_prep [2], align_prep [3]
	check_sfd_leak, coal_image, coal_rot, conv_a2p [1], conv_a2p [2], conv_p2a [1]
	conv_p2a [2], fl_suntoday [1], fl_suntoday [2], fl_suntoday [3], gbo_obs_coord
	gbo_pfi, get_epoch_sfcs [1], get_epoch_sfcs [2], gt_sxt_cen, his_suncen
	match_index [1], match_index [2], mk_sfd [1], mk_sfd [2], mk_sfd [3], mk_sfd [4]
	mk_strip_file, mk_sxc, mk_sxh, mk_sxl, mk_syn_sfc [1], mk_syn_sfc [2]
	mk_synsfc_coeff [1], mk_synsfc_coeff [2], op_term_score, pfi_loc, plot_ar_pfi
	plot_nar [1], plot_nar [2], rest_low8_cube [1], rest_low8_cube [2], scale_gbo
	sda2fits, sleazy_rot, sol_rot [2], sun_grid, sun_today [1], sun_today [2]
	sun_today [3], sxl_analysis, sxt_deleak [1], sxt_deleak [2], sxt_obs_coord [1]
	sxt_obs_coord [2], sxt_plot_fov, sxt_xsaa, term_score2, termlite, xsxt_prep_event
	xy_lwa
OPTIONAL KEYWORD INPUT:
	hxa	- If set, use HXA_SUNCENTER.  Default is to use GET_SUNCENTER
	cmd	- If set, use the S/C commanded pointing data file.  The true
		  suncenter can be up to 4-5 pixels different because of the
		  "slop" in the attitude control.  Default is to use 
		  GET_SUNCENTER
	oride_pnt_chk - If set, then do not compare the ATT/GET_SUNCENTER
		  results to the commanded values to see that they are
		  truly valid points.  This is useful for times when the
		  commanded pointing history file is not updated properly
		  or for real time applications when the commanded pointing
		  history is not updated yet.
       rawcmd -  if set, use commanded and do not apply seasonal correction
OPTIONAL KEYWORD OUTPUT:
	delta	- Time difference (in s) between index time and pnt
                 time for each sun center position.  A value larger than a few
                 seconds indicates that the suncenter position may not be
                 reliable.  It is only valid when not using /HXA or /CMD
		  options.
	roll	- The SXT roll in degrees.  The CCD-north is "roll" degrees
		  counter clock wise from solar-N.
	att_ok  - Indices of those pointings which have ATT files within 1 second
		  of times and which have perfect (att.status1=4) HXA solutions.
METHOD:
	This routine is intended as a front end to return the pointing 
	information.  It does a check to see that the PNT files exist 
	when using GET_SUNCENTER or HXA_SUNCENTER.

       The seasonal/mission long drift correction can be disabled
       the the IDL command: setenv,'ys_no_attcmd_corr=1'
HISTORY:
	Written 10-Jun-93 by M.Morrison
	10-Jul-93 (MDM) - Check that the value to be returned is believable
			  and if not, use the /CMD option for the bad values.
	14-Jul-93 (MDM) - Replaced some code with a call to PNT_EXIST
	18-Aug-93 (MDM) - Replaced PNT_EXIST call with YDB_EXIST
			- Replaced call to GET_SUNCENTER with a call to
			  GET_ATT if the ATT files exist
	19-Aug-93 (MDM) - Added DELTA variable
	17-Sep-93 (MDM) - Added ROLL keyword output
			  Introduced code to call GET_ROLL
	 2-Oct-93 (MDM) - Corrected error where a problem arises when some
			  of the ATT files exist, but not the one needed.
	16-Oct-93 (MDM) - Make sure that the roll variable is defined 
	19-Nov-93 (MDM) - Added "min_status=2" call to GET_ATT so that the
			  results returned are at least acceptably good
	11-Jan-94 (MDM) - Modified not to display "values returned are
			  unreasonable" message if /CMD is set.
	10-Feb-94 (MDM) - Modified the criteria that is used to recognize bad
			  results in the ATT database to use the relative
			  offset from commanded IN ADDITION to the absolute value
			  of "lt 100 or gt 900".  If x or y is more than 50
			  pixels from expected, and outside the above range, then 
			  it is flagged as bad and the expected (commanded value) 
			  is used.
	21-Feb-94 (MDM) - Added /ORIDE_PNT_CHK to optionally not compare the 
			  ATT/GET_SUNCENTER results to the commanded values to see 
			  that they are truly valid points
	21-Feb-94 (MDM) - Added capability of setting /ORIDE_PNT_CHK by setting
			  and environment variable "YS_ORIDE_PNT_CHK" to non-null
	29-Nov-94 (MDM) - Print warning statement if the ATT record that it selects
			  is over 5 minutes from the requested time.
	14-Feb-95 (MDM) - Changed warning message to say ATR instead of PNT
        9-Mar-95 (MDM) - Modified SXT_CMD_PNT to apply the correction required for
                         the seasonal/mission long drift between the
                         commanded and actual.
       25-mar-95 (SLF) - add RAWCMD keyword and function
	15-sep-98 (LWA) - added att_perfect as an option keyword output.
	21-sep-98 (LWA) - corrected min_status bug introduced on 15-sep-98.
       23-May-99 (NN)  - included in the ATT mismatch warning the time of interest
                        and the closet ATT time.
        8-Jun-99 (NN)  - fixed the bug that resulted from the 23-May-99 change. 


sxt_cen [2] $SSW/yohkoh/sxt/idl/util/sxt_cen.pro
[Previous] [Next]
NAME:
	sxt_cen
PURPOSE:
	To return the pixel coordinates of the center of the SXT image using
	either GET_SUNCENTER, HXA_SUNCENTER or S/C commanded values.
SAMPLE CALLING SEQUENCE:
	out = sxt_cen(index)
	out = sxt_cen(index, /hxa)
	out = sxt_cen(index, /cmd)
	out = sxt_cen(index, roll=roll)
	out = sxt_cen(index, roll=roll, /cmd)
       out = sxt_cen(index, /rawcmd)		; dont apply seasonal correct.
INPUT:
	times	- The list of times for which the coordinates are required
 CALLS: ***
	GET_NBYTES, HXA_SUNCENTER, UNIQ [1], UNIQ [2], UNIQ [3], get_att, get_logenv [1]
	get_logenv [2], get_roll, get_suncenter2, sxt_cmd_pnt, tbeep [1], tbeep [2]
	tbeep [3], ydb_exist [1], ydb_exist [2], ydb_exist [3], ydb_exist [4]
 CALLED BY:
	ALIGN1BIGGRAM
	Check the ATT database vs the SXC limb fit database to look for bad
	GET_POINTS, LAY1GKM, MK_SSX, NORH_NORH2SXT [1], NORH_NORH2SXT [2]
	NORH_NORH2SXT [3], NORH_NORH2SXT [4], PFI_CENTER, PLOT_CLON, POLAR_GRID
	PP_MWLT2SXT, PP_SXT2ANY, PP_SXT2VLA, PROM_ON_DISK, QUICKDRIFT [1], QUICKDRIFT [2]
	QUICKLIMB [1], QUICKLIMB [2], SFD_PHOT, SXT_EXPOSURE_MAP, SXT_GRID [1]
	SXT_GRID [2], SXT_GRID [3], SXT_RPAXY, TERM_FIDS, TERM_QUICK, TERM_REVIEW
	TERM_REVIEW_GIF, TEST_ATT, agl2cut, align_prep [1], align_prep [2], align_prep [3]
	check_sfd_leak, coal_image, coal_rot, conv_a2p [1], conv_a2p [2], conv_p2a [1]
	conv_p2a [2], fl_suntoday [1], fl_suntoday [2], fl_suntoday [3], gbo_obs_coord
	gbo_pfi, get_epoch_sfcs [1], get_epoch_sfcs [2], gt_sxt_cen, his_suncen
	match_index [1], match_index [2], mk_sfd [1], mk_sfd [2], mk_sfd [3], mk_sfd [4]
	mk_strip_file, mk_sxc, mk_sxh, mk_sxl, mk_syn_sfc [1], mk_syn_sfc [2]
	mk_synsfc_coeff [1], mk_synsfc_coeff [2], op_term_score, pfi_loc, plot_ar_pfi
	plot_nar [1], plot_nar [2], rest_low8_cube [1], rest_low8_cube [2], scale_gbo
	sda2fits, sleazy_rot, sol_rot [2], sun_grid, sun_today [1], sun_today [2]
	sun_today [3], sxl_analysis, sxt_deleak [1], sxt_deleak [2], sxt_obs_coord [1]
	sxt_obs_coord [2], sxt_plot_fov, sxt_xsaa, term_score2, termlite, xsxt_prep_event
	xy_lwa
OPTIONAL KEYWORD INPUT:
	hxa	- If set, use HXA_SUNCENTER.  Default is to use GET_SUNCENTER
	cmd	- If set, use the S/C commanded pointing data file.  The true
		  suncenter can be up to 4-5 pixels different because of the
		  "slop" in the attitude control.  Default is to use 
		  GET_SUNCENTER
	oride_pnt_chk - If set, then do not compare the ATT/GET_SUNCENTER
		  results to the commanded values to see that they are
		  truly valid points.  This is useful for times when the
		  commanded pointing history file is not updated properly
		  or for real time applications when the commanded pointing
		  history is not updated yet.
       rawcmd -  if set, use commanded and do not apply seasonal correction
OPTIONAL KEYWORD OUTPUT:
	delta	- Time difference (in s) between index time and pnt
                 time for each sun center position.  A value larger than a few
                 seconds indicates that the suncenter position may not be
                 reliable.  It is only valid when not using /HXA or /CMD
		  options.
	roll	- The SXT roll in degrees.  The CCD-north is "roll" degrees
		  counter clock wise from solar-N.
METHOD:
	This routine is intended as a front end to return the pointing 
	information.  It does a check to see that the PNT files exist 
	when using GET_SUNCENTER or HXA_SUNCENTER.

       The seasonal/mission long drift correction can be disabled
       the the IDL command: setenv,'ys_no_attcmd_corr=1'
HISTORY:
	Written 10-Jun-93 by M.Morrison
	10-Jul-93 (MDM) - Check that the value to be returned is believable
			  and if not, use the /CMD option for the bad values.
	14-Jul-93 (MDM) - Replaced some code with a call to PNT_EXIST
	18-Aug-93 (MDM) - Replaced PNT_EXIST call with YDB_EXIST
			- Replaced call to GET_SUNCENTER with a call to
			  GET_ATT if the ATT files exist
	19-Aug-93 (MDM) - Added DELTA variable
	17-Sep-93 (MDM) - Added ROLL keyword output
			  Introduced code to call GET_ROLL
	 2-Oct-93 (MDM) - Corrected error where a problem arises when some
			  of the ATT files exist, but not the one needed.
	16-Oct-93 (MDM) - Make sure that the roll variable is defined 
	19-Nov-93 (MDM) - Added "min_status=2" call to GET_ATT so that the
			  results returned are at least acceptably good
	11-Jan-94 (MDM) - Modified not to display "values returned are
			  unreasonable" message if /CMD is set.
	10-Feb-94 (MDM) - Modified the criteria that is used to recognize bad
			  results in the ATT database to use the relative
			  offset from commanded IN ADDITION to the absolute value
			  of "lt 100 or gt 900".  If x or y is more than 50
			  pixels from expected, and outside the above range, then 
			  it is flagged as bad and the expected (commanded value) 
			  is used.
	21-Feb-94 (MDM) - Added /ORIDE_PNT_CHK to optionally not compare the 
			  ATT/GET_SUNCENTER results to the commanded values to see 
			  that they are truly valid points
	21-Feb-94 (MDM) - Added capability of setting /ORIDE_PNT_CHK by setting
			  and environment variable "YS_ORIDE_PNT_CHK" to non-null
	29-Nov-94 (MDM) - Print warning statement if the ATT record that it selects
			  is over 5 minutes from the requested time.
	14-Feb-95 (MDM) - Changed warning message to say ATR instead of PNT
        9-Mar-95 (MDM) - Modified SXT_CMD_PNT to apply the correction required for
                         the seasonal/mission long drift between the
                         commanded and actual.
       25-mar-95 (SLF) - add RAWCMD keyword and function


sxt_center $SSW/yohkoh/ucon/idl/metcalf/sxt_center.pro
[Previous] [Next]
NAME:
     sxt_center
PURPOSE:
     Find the center and radius of an SXT full sun white light or X-ray
     image
CATEGORY:
CALLING SEQUENCE:
     sxt_center, data, index, [, x, y, r]
INPUTS:
     data = Full sun image data cube for which the center and radius will 
            be computed
     index = SXT index  (optional ONLY if initial_values is suppled)
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     nimage = image number in data cube
     resolution = resolution of the SXT image (output)
                  1 = Full resolution
                  2 = Half resolution
                  4 = Quarter resolution
                  computed from gt_res.pro
     pixel_size = size of pixels in arcseconds
     verbose = if set, print a bunch of diagnostics
     /ellipse = fit an ellipse instead of a circle.  Better of oblate images.
     oblateness = second harmonic of radius
     ob_angle = phase of 2nd harmonic
     /noobcorrect = do not correct final sun center value for oblateness
     bias = distortion of limb due higher harmonics
     xlimb,ylimb = returns the coordinates of the selected limb pixels
     interactive = if set, 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], all in units of PIXELS.  
                      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).
     hxa_x = returns HXA x coordinate of image center
     hxa_y = returns HXA y coordinate of image center
     decompress = If set, use sxt_decomp to decompress the image
     iterate = If set, iterate in the circle fitting routine.  This is
               not very useful, but in principle it could improve the 
               accuracy.
     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.
     nordpnt = if set, do not try to read the PNT file.  This implies the
               interactive keyword if no initial guess is supplied.  This
               should only be used if the PNT read crashes (very unlikely)
     hxacode = returns the HXA code from get_suncenter.  A value less than or
               equal to 1 means there was a problem with the HXA data.
     norfit = if set, do not fit the radius of the sun: use the initial guess
OUTPUTS:
     x = x position of the center of the image in units of FULL res pixels
     y = y position of the center of the image in units of FULL res pixels
     r = radius of the image in units of FULL resolution 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: ***
	fit_limb
 CALLED BY:
	mk_sxc, sxt_align, sxt_mauna
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:
     HXA is used to get an initial guess for the center.  This
     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
     T. Metcalf 1/1994:   o Default kill for non x-ray images is now 0.
                          o Added obcorrect keyword.
                          o Use sxt_cen instead of get_suncenter
                          o Use fit_circle instead of circlefit.
     T. Metcalf 2/1994    Gutted sxt_center.  It now calls the more general
                          routine fit_limb.
                          o hxacode is no longer used
                          o nordpnt is no longer used
                          o added ellipse keyword
     T. Metcalf 1995-06-15  nimage is no longer required for single images
     T. Metcalf 1995-06-16  Yesterday's fix introduced a bug: always took 
                            image 0 from a data cube.  Fixed.


sxt_chk_era $SSW/yohkoh/sxt/idl/util/sxt_chk_era.pro
[Previous] [Next]
 NAME:
	sxt_chk_era
 PURPOSE
	To identify entrance filter era boundaries within data sets.
 SAMPLE CALLING SEQUENCE
	jj = sxt_chk_era(index)
 INPUT
	index structure
 OUTPUT
	Array of indices of those records just AFTER an era change.  
	A -1 is returned if there is no era change in the data set.
 HISTORY
	 4-Nov-99  LWA, Written.
 CALLS:
 CALLED BY
	sxl2radiance


sxt_clean [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_clean.pro
[Previous] [Next]
NAME:
	sxt_clean
PURPOSE
	To remove spikes and holes from an SXT image.
PROCEDURE
	1. If data are byte-type run SXT_PREP on the data.
      *2. If /xsaa is set and image is taken in SAA call sxt_xsaa to
	   attempt to remove "cosmic ray" streaks.
      *3. Test for and repair persistent column blem in HR column 182.
	4. Use a dark frame to determine the expected variance.
	5. Use the standard deviation [sqrt(variance)] to decide which
	   parts of the image to handle as noise and which as signal.
	6. Use SIGMA_KLIP to despike the noisy parts of the image.
	   This assumes that these parts of the image are Poissonian.
	7. Use a median filter to despike the signal parts of the image.
	   Spike replacement level determined SXT PSF and experiment.
	8. Return the cleaned image.
      * Steps only done for square (true) FFIs.
CALLING SEQUENCE
	nice_img=sxt_clean(index,data,/timer)
	nice_img=sxt_clean(index,data,$
          [level=level,dat=dat,dark1=dark1,timer=timer,$
          nsmooth=nsmooth,nsigma=nsigma,nbound=nbound,debug=debug,$
	   xsaa=xsaa]
INPUTS
	index, SXT index structure
	data, either sxt_prep'd image or raw compressed SXT image
OPTIONAL KEYWORD INPUTS
	level, logarithmic spike threshold for signal parts of the image.
		[default = 1.125 (QR), 0.75 (HR), 0.375 (FR)]
	/timer, prints out how long it took program to run.
	nsmooth, median smoothing parameter [default = 3]
	nsigma, gaussian smoothing parameter [default = 3, sigma]
	nbound, sets boundary between noisy and signal parts of image.
		[default = 0.5, i.e., half the std dev of darkframe.]
	/xsaa, removes SAA streaks if image taken in saa.
	  *******WARNING: xsaa will affect small linear x-ray features!***
	/debug, stops program from time to time for debugging.
OPTIONAL OUTPUTS
	satpix, saturated pixels in byte-type input image.
OPTIONAL KEYWORD OUTPUTS
	cleanindex, dummy for historical reasons, no useful function.
	dat, returns input data or sxt_prep'd input data.
	dark1, returns darkframe used to determine std dev of noise.
RESTRICTIONS
 	THIS CODE ONLY HANDLES ONE IMAGE AT A TIME.
	For PFIs, FFI strips, or FR images only despike.
	Assumes noise obeys poisson statistics.
	sxt_clean should be run before registration.
	This program alters the data -- which is ALWAYS dangerous!
HISTORY
	04-Nov-96, LWA, Written
	01-Jan-98, LWA, Added satpix output.
	15-Dec-98, LWA, Temporary until goes online, fixed std screwup.
	16-Dec-98, LWA, removed dekanorm option.
	17-Dec-98, LWA, Corrected error in use of stdev and set nbound
			default to 0.5.  Tested on HR and QR images.
       18-Jan-99, LWA, Use flattened darkframe to identify spikes
			as a final step in cleaning process.
	06-Feb-99, LWA, Added hot column and SAA streak removal.
			Renamed program sxt_clean.pro.
	28-Oct-99, LWA, Edited header.
	 6-Jan-04, LWA, Commented out print statement.
	10-Jan-04, LWA, Clarified PROCEDURE step 8 in header.
	12-Jul-04, LWA, Added test for FR or non-square images.
	29-Jul-04, LWA, Mod to include despike of PFIs or FR images.
			Correction of program error that negated despike!
			Disabled 2nd pass despike based upon dark frame.
			Update header.
	30-Jul-04, LWA, Fixed problem if no noizimg.
			Added check for non-xray images.
 CALLS:
 CALLED BY
	sxt_kleen, sxt_prep [1], sxt_prep [2], sxt_prep [3]


sxt_clean [2] $SSW/yohkoh/sxt/idl/atest/sxt_clean.pro
[Previous] [Next]
NAME:
	sxt_clean
PURPOSE
	To remove spikes and holes from an SXT image.
PROCEDURE
	1. If data are byte-type run SXT_PREP on the data.
	2. If /xsaa is set and image is taken in SAA call sxt_xsaa to
	   attempt to remove "cosmic ray" streaks.
	3. Test for and repair persistent column blem in HR column 182.
	4. Use a dark frame to determine the expected variance.
	5. Use the standard deviation [sqrt(variance)] to decide which
	   parts of the image to handle as noise and which as signal.
	6. Use SIGMA_KLIP to despike the noisy parts of the image.
	   This assumes that these parts of the image are Poissonian.
	7. Use a median filter to despike the signal parts of the image.
	   Spike replacement level determined SXT PSF and experiment.
       8. Finally, replace all 4 sigma hot pixels in the dark image
	   with pixels from the median-smoothed cleaned image, just
	   to be sure they are corrected.
	9. Return the cleaned image.
CALLING SEQUENCE
	nice_img=sxt_clean(index,data,/timer)
	nice_img=sxt_clean(index,data,[cleanindex=cleanindex,$
          level=level,dat=dat,dark1=dark1,timer=timer,$
          nsmooth=nsmooth,nsigma=nsigma,nbound=nbound,debug=debug,$
	   xsaa=xsaa]
INPUTS
	index, SXT index structure
	data, either sxt_prep'd image or raw compressed SXT image
OPTIONAL KEYWORD INPUTS
	level, logarithmic spike threshold for signal parts of the image.
		[default = 1.125 (FR), 0.75 (HR), 0.375 (QR)]
	/timer, prints out how long it took program to run.
	nsmooth, median smoothing parameter [default = 3]
	nsigma, gaussian smoothing parameter [default = 3, sigma]
	nbound, sets boundary between noisy and signal parts of image.
		[default = 0.5, i.e., half the std dev of darkframe.]
	/xsaa, removes SAA streaks if image taken in saa.
	  *******WARNING: xsaa will affect small linear x-ray features!***
	/debug, stops program from time to time for debugging.
OPTIONAL OUTPUTS
	satpix, saturated pixels in byte-type input image.
OPTIONAL KEYWORD OUTPUTS
	cleanindex, index structure with exposure adjusted in .his
	    (Note: Flagging of cleaning not yet implemented in .his.)
	dat, returns input data or sxt_prep'd input data.
	dark1, returns darkframe used to determine std dev of noise.
RESTRICTIONS
 	THIS CODE ONLY HANDLES ONE IMAGE AT A TIME.
	Assumes noise obeys poisson statistics.
	sxt_clean should be run before registration.
	This program alters the data -- which is ALWAYS dangerous!
HISTORY
	04-Nov-96, LWA, Written
	01-Jan-98, LWA, Added satpix output.
	15-Dec-98, LWA, Temporary until goes online, fixed std screwup.
	16-Dec-98, LWA, removed dekanorm option.
	17-Dec-98, LWA, Corrected error in use of stdev and set nbound
			default to 0.5.  Tested on HR and QR images.
       18-Jan-99, LWA, Use flattened darkframe to identify spikes
			as a final step in cleaning process.
	06-Feb-99, LWA, Added hot column and SAA streak removal.
			Renamed program sxt_clean.pro.
	28-Oct-99, LWA, Edited header.
 CALLS:
 CALLED BY
	sxt_kleen, sxt_prep [1], sxt_prep [2], sxt_prep [3]


sxt_cmd_pnt $SSW/yohkoh/gen/idl/pointing/sxt_cmd_pnt.pro
[Previous] [Next]
NAME:
	sxt_cmd_pnt
PURPOSE:
	Given a set of input times, return the location of the center
	of the sun in SXT full resolution pixels based on S/C commanded
	pointing.
METHOD:
	The seasonal/mission long drift correction can be disabled
	the the IDL command: setenv,'ys_no_attcmd_corr=1'
SAMPLE CALLING SEQUENCE:
	xy = sxt_cmd_pnt(index)
       xy = sxt_cmd_pnt(index,rawcmd) ; dont apply seasonal correction

INPUT:
	times	- A set of times in an of the 3 standard formats
OUTPUT:
	returns a vector 2xN of location of the SXT sun center
		(0) = East/West with East negative
		(1) = North/South with South negative
	It does not take into account the 1 arcminute drift (S/C morning
	"nod") generally seen over an orbit.  Changes in the pointing 
	commanded bias value are taken into account.
 CALLS: ***
	ATTCMD_FUNCT1, ATTCMD_FUNCT2, get_del_pnt, gt_pix_size, int2secarr [1]
	int2secarr [2]
 CALLED BY:
	HXA_SUNCENTER, IRUHXA2SXT, IRUHXASCAN2SXT [1], IRUHXASCAN2SXT [2], sxt_cen [1]
	sxt_cen [2]
HISTORY:
	Written 5-Jun-93 by M.Morrison
	10-Jun-93 (MDM) - Minor change to documentation header
	 9-Mar-95 (MDM) - Modified to apply the correction required for
			  the seasonal/mission long drift between the 
			  commanded and actual.
       25-mar-95 (SLF) - add RAWCMD keyword 
	 8-May-95 (MDM) - Added Katsev secondary correction factor.


sxt_combine $SSW/yohkoh/ucon/idl/labonte/sxt_combine.pro
[Previous] [Next]
 From a time series of SXT images, assembles a movie that patches
 together the different spatial resolution and stepped exposure
 data into a matched set.

PRO sxt_combine, index, data, outmovie, memory=memory, subs=ssar


 Input:
	index, data = SXT index, data to be processed.

 Output:
	outmovie = assembled movie, float type.  Data
		is calibrated if input as byte.

 Optional Input Keywords:
	memory - if set, enforces memory on image to
		fill in blank parts of field.

 Optional Output Ketwords:
	subs = array of image indices actually used to make the
		combinations


 Procedure:
	Calibrates and registers images.
	Takes nearest neighbor set of images of different
	resolutions, stepped exposures, puts together.

 Routines called:
	 SXT_PREP

 CALLS: ***
	DERIV, UNIQ [1], UNIQ [2], UNIQ [3], gt_day [1], gt_day [2], gt_dpe, gt_res, gt_time [1]
	gt_time [2], sxt_prep [1], sxt_prep [2], sxt_prep [3]
 Restrictions:
	Because different images are taken at different times,
	result is not strictly consistent.  

  Written May 9, 1993  Barry LaBonte
	Modified May 21, 1993  Include stepped exposures, /subs  BJL
	Modified May 31, 1993  Include SATPIX, RAWDATA keywords.  BJL
	Rewritten, simplified, handle more cases  Feb 14, 1994  BJL


sxt_comp $SSW/yohkoh/sxt/idl/util/sxt_comp.pro
[Previous] [Next]
NAME:
	sxt_comp
PURPOSE:
	Re-compress an image from 12 bits to 8 bits
CALLING SEQUENCE:
	img = sxt_comp(data)
INPUT:
	data	- An SXT image that has already been decompressed
OUTPUT:
	returns	- A byte variable of the input re-compressed
 CALLED BY:
	ANDRIL_SXT, RD_AR, SXT_TEEM1 [1], SXT_TEEM1 [2], SXT_TEEM1 [3], ars_exp, change_res
	cur_teemcursor Te and EM, interp_img, mc_unc, mk_strip_file, pr_teem
HISTORY:
	Written 15-Nov-91 by M.Morrison using Acton's routine
	28-jan-93, JRL, Fixed bug for > 4096 case


sxt_comp_sharp $SSW/yohkoh/ucon/idl/foley/sxt_comp_sharp.pro
[Previous] [Next]
 NAME:
  sxt_comp_sharp.pro  
 PURPOSE
  An alternative routine to emphasise faint features in sxt images  

 CALLING SEQUENCE
  sh_image=sxt_comp_sharp(image)

 INPUT
  Image :  SXT desaturated uncompressed full frame image.

 OPTIONAL INPUT
 level : increase or decrease the scattered light normalisation. 

 OUTPUT
  sfd compressed image, to display with tvscl
  Image normalised to the background scatter field. 
  
 OPTIONAL OUTPUT
  scatt  : Default scatter halo as calculated using SXT_SCATTER

 OPTIONAL KEYWORD INPUT
  uncomp : To return uncompressed version of array.

 RESTRICTION
  Currently only > 15s exposures
  Works well with images recorded prior to filter hit.

 HISTORY
  Written CAF  2 MAY 96 : caf@mssl.ucl.ac.uk
          CAF  8-Oct-96 : added call to Spikes_off and uncomp keywords, 
                          and general cleaned up.
          CAF 25-Feb-97 : Replaced call to Spikes_off with de_spiker (LWA)
 CALLS:


sxt_composite [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_composite.pro
[Previous] [Next]

*************************************************************************
*******This version returns an uncertainty array, plus photon noise******
*******DMcK  12-Jan-2001*************************************************
*************************************************************************

 NAME:
   sxt_composite
 PURPOSE:
   Prepare a composite SXT image from 2 or 3 Half or Quarter Res images.
 CALLING SEQUENCE EXAMPLES:
   cimg = sxt_composite(index,data,comp_index)
   cimg = sxt_composite(index,data,[comp_index,unc=unc,sx=sx,           $
        satpix=satpix,plot=plot,nofill=nofill,sfd=sfd,                  $
        dc_interpolate=dc_interpolate,qtest=qtest,register=register,    $
        clean=clean,fillpix=fillpix,threshold=threshold,debug=debug])
 INPUTS:
   index = SXT index structure
   data  = 3-d data cube (at least 2 images)

  If data is byte and no dc_data then		leak_sub
  If data is byte and dc_data    then		decompress and data-dc_data
  If data is not byte type       then		assume already decompressed, 
						background subtracted, and
						FLOATING-POINT.
 OUTPUT:
  Function result is a 2-d long array (linear scaling) unless data is float
  type, then output is a 2-d float array.
 OPTIONAL OUTPUT:
    comp_index = index structure for composite image, made from index
	of longest exposure with history records appended.
 OPTIONAL KEYWORD OUTPUT:
   unc_out = array of 1-sigma uncertainties in each pixel.  Uses
            sxt_dn_uncert for a temperature of 3 MK.  If data are
	     byte type, then this array will come from an internal call
	     call to SXT_PREP.  If data are not byte type, and no UNC_IN
	     is passed in, then this will _only_ be the photon noise; if
	     data are not byte type and UNC_IN is passed in, then they
	     will be added in quadrature.
   fillpix = Boolean array showing interpolated pixels.o
   fillmap = fill map where 1: filled from short
                            2: filled from medium

 OPTIONAL INPUT KEYWORDS:
   dc_data = Dark frame data cube, use these rather than leak_sub.
   sx	   = Indices of the data array. If not supplied, compute values
	     that result in ==> sx = [short, medium, long exposure]
   sd     = Indices of the background array.  If not supplied, 
	     then must supply   sd = [short, medium, long exposure]
   satpix = Saturated pixel array (required if data are not byte type).
	     Must be 3-d and correspond to data(*,*,*).
   unc_in = Array of uncertainties of the input images, e.g., from
	     SXT_PREP.  It is assumed that this UNC_IN does _not_ come
            from SXT_DN_UNC.  (Only used if input data are not byte type).
   plot   = If set, plot the results as we go.  The results are displayed
	     on a logarithmic scale.
   nofill = set this keyword to PREVENT filling bleeds w/ interpolated data.
   sfd    = /sfd will cause the image to come back scaled as an sfd image
	     (per second/HR pixel, and scaled by sfd_comp).
   dc_interpolate = If set = 0 leak_sub will not use DC interpolation.
		[Default is to use DC interpolation.]
   register = If set, do a whole pixel registration of short exposures to 
	     the long exposure
   clean  = calls sxt_clean with defaults to despike output image.
   threshold = if data are byte type this is the signal level in the
	     shorter exposure below which the saturated regions of the
            longer exposures are filled in with interpolated data for
            statistical appearance sake.  (Default is 15 DN.)
   debug  = stops program at end for debugging purposes.
 CALLS: ***
	DOC_LIBRARY, WDEF [1], WDEF [2], gt_day [1], gt_day [2], gt_expdur [1]
	gt_expdur [2], gt_res, gt_time [1], gt_time [2], his_index, safe_log10, sfd_comp
	sxt_dn_unc, sxt_prep [1], sxt_prep [2], sxt_prep [3], sxt_suture [1]
	sxt_suture [2]
 CALLED BY:
	SXT_QLOOK, pfi_composite, sxt_sff_composite [1], sxt_sff_composite [2]
 RESTRICTIONS:
   Must be called separately for each composite output image.
   It is assumed that any input uncertainty comes from SXT_PREP, but
   _not_ from SXT_DN_UNC.  Photon noise will be added!
 METHOD:
 ---------------------------------------------------------------------------
1.  Replace the saturated pixels in the medium exposure with the
    corresponding above-threshold time-normalized pixels from the 
    short exposure.
2.  Replace the saturated pixels in the medium exposure having
    corresponding below-threshold pixels in the
    short exposure with sxt_suture..

    This is completes the process for the 2 image case.

3.  For the 3 image case replace the saturated pixels in the long exposure
    with the corresponding above-threshold time-normalized pixels from
    step 2.
4.  Replace saturated pixels in long exposure with interpolated
    corresponding below-threshold time-normalized pixels from step 2.
 ---------------------------------------------------------------------------
 MODIFICATION HISTORY:
    8-Nov-91, L. W. Acton (Wrote composite)
   19-May-92, LWA  (Several more mods in betwee)
   13-may-93, J. R. Lemen, Re-wrote.  Calls sxt_satpix
    1-Dec-93, MDM - Corrected error with the use of "s2" (when it is -1)
		- Modification on selection of replacement pixels.
		  It used to check (a) that it was high signal (ge 90)
				   (b) that it was not saturated
		  Added check so that it replaced pixels in the longer 
		  exposure only when the longer exposure was saturated
    15-Dec-93, SLF - Fixed typo (stapix->satpix)
    22-feb-94, JRL - Corrected the algorithm; 
		    - added smooth_factor, sfd, dc_interpolate, register keywords
    17-Apr-94, LWA - Fixed /sfd scaling option (1000.*  was needed)
		    - Changed /plot to plot raw input images.
		    - Added RESTRICTIONS statement to header.
		    - Added despike=despike keyword.
    23-jun-94, JRL - Output is floating if input is a fltarr;
		    - Call sfd_comp with index=index to normalize properly
    08-May-95, LWA - Fixed to return negative values.
    02-Nov-96, LWA - Added output of index with history record.
		    - Made dc_data a keyword intput.
		    - Made dc_interpolate the default is dc_data not input.
    04-Nov-96, LWA - Removed forgotten diagnostic.
    10-Jan-97, LWA - Corrected calling sequence examples.
    20-Apr-99, LWA - Added /float and /orbit_correct to leak_sub call.
                   - Version 3.01
    14-Jul-99, BNH - history record wasn't being updated from LEAK_SUB.
                   - Bumped version to 3.02.
    11-Apr-00, LWA - Complete rewrite and improvement of logic.
		    - Added unc, smoothpix and threshold keywords.
		    - Changed version to 4.00.
    11-Apr-00, LWA - Corrected typo and bumped version to 4.01.
                   - Added keyword debug and bumped version to 4.02.
    10-Oct-00, LWA - Replaced smoothing with sxt_suture.pro.
		    - Changed version to 5.00.
		    - This version does NOT return revised uncertainty.
    12-Jan-01, DMcK & LWA - Carried the uncertainties through the 
		      compositing process, and added option of input
		      UNC_IN.  Also cut out deadwood and fixed some typos,
		      and changed default threshold to 15.
		      Changed version to 6.00.
    15-Jan-01, SLF - add FILLMAP (flags for SSC uncertainty info storage)
    22-Sep-03, DMcK - Set temperature to 3MK in *all* calls to SXT_DN_UNC
		      (Had been inconsistent)
    17-Jan-06, LWA - Corrected description of process in header to 
		      refer to use of sxt_suture.


sxt_composite [2] $SSW/yohkoh/sxt/idl/atest/sxt_composite.pro
[Previous] [Next]

*************************************************************************
*******This version returns an uncertainty array, plus photon noise******
*******DMcK  12-Jan-2001*************************************************
*************************************************************************

 NAME:
   sxt_composite
 PURPOSE:
   Prepare a composite SXT image from 2 or 3 Half or Quarter Res images.
 CALLING SEQUENCE EXAMPLES:
   cimg = sxt_composite(index,data,comp_index)
   cimg = sxt_composite(index,data,[comp_index,unc=unc,sx=sx,           $
        satpix=satpix,plot=plot,nofill=nofill,sfd=sfd,                  $
        dc_interpolate=dc_interpolate,qtest=qtest,register=register,    $
        clean=clean,fillpix=fillpix,threshold=threshold,debug=debug])
 INPUTS:
   index = SXT index structure
   data  = 3-d data cube (at least 2 images)

  If data is byte and no dc_data then		leak_sub
  If data is byte and dc_data    then		decompress and data-dc_data
  If data is not byte type       then		assume already decompressed, 
						background subtracted, and
						FLOATING-POINT.
 OUTPUT:
  Function result is a 2-d long array (linear scaling) unless data is float
  type, then output is a 2-d float array.
 OPTIONAL OUTPUT:
    comp_index = index structure for composite image, made from index
	of longest exposure with history records appended.
 OPTIONAL KEYWORD OUTPUT:
   unc_out = array of 1-sigma uncertainties in each pixel.  Uses
            sxt_dn_uncert for a temperature of 2.3 MK.  If data are
	     byte type, then this array will come from an internal call
	     call to SXT_PREP.  If data are not byte type, and no UNC_IN
	     is passed in, then this will _only_ be the photon noise; if
	     data are not byte type and UNC_IN is passed in, then they
	     will be added in quadrature.
   fillpix = Boolean array showing interpolated pixels.o
   fillmap = fill map where 1: filled from short
                            2: filled from medium

 OPTIONAL INPUT KEYWORDS:
   dc_data = Dark frame data cube, use these rather than leak_sub.
   sx	   = Indices of the data array. If not supplied, compute values
	     that result in ==> sx = [short, medium, long exposure]
   sd     = Indices of the background array.  If not supplied, 
	     then must supply   sd = [short, medium, long exposure]
   satpix = Saturated pixel array (required if data are not byte type).
	     Must be 3-d and correspond to data(*,*,*).
   unc_in = Array of uncertainties of the input images, e.g., from
	     SXT_PREP.  It is assumed that this UNC_IN does _not_ come
            from SXT_DN_UNC.  (Only used if input data are not byte type).
   plot   = If set, plot the results as we go.  The results are displayed
	     on a logarithmic scale.
   nofill = set this keyword to PREVENT filling bleeds w/ interpolated data.
   sfd    = /sfd will cause the image to come back scaled as an sfd image
	     (per second/HR pixel, and scaled by sfd_comp).
   dc_interpolate = If set = 0 leak_sub will not use DC interpolation.
		[Default is to use DC interpolation.]
   register = If set, do a whole pixel registration of short exposures to 
	     the long exposure
   clean  = calls sxt_clean with defaults to despike output image.
   threshold = if data are byte type this is the signal level in the
	     shorter exposure below which the saturated regions of the
            longer exposures are filled in with interpolated data for
            statistical appearance sake.  (Default is 15 DN.)
   debug  = stops program at end for debugging purposes.
 CALLS: ***
	DOC_LIBRARY, WDEF [1], WDEF [2], gt_day [1], gt_day [2], gt_expdur [1]
	gt_expdur [2], gt_res, gt_time [1], gt_time [2], his_index, safe_log10, sfd_comp
	sxt_dn_unc, sxt_prep [1], sxt_prep [2], sxt_prep [3], sxt_suture [1]
	sxt_suture [2]
 CALLED BY:
	SXT_QLOOK, pfi_composite, sxt_sff_composite [1], sxt_sff_composite [2]
 RESTRICTIONS:
   Must be called separately for each composite output image.
   It is assumed that any input uncertainty comes from SXT_PREP, but
   _not_ from SXT_DN_UNC.  Photon noise will be added!
 METHOD:
 ---------------------------------------------------------------------------
1.  Replace the saturated pixels in the medium exposure with the
    corresponding above-threshold time-normalized pixels from the 
    short exposure.
2.  Replace the saturated pixels in the medium exposure with interpolated
    corresponding below-threshold time-normalized pixels from the
    short exposure.

    This is completes the process for the 2 image case.

3.  For the 3 image case replace the saturated pixels in the long exposure
    with the corresponding above-threshold time-normalized pixels from
    step 2.
4.  Replace saturated pixels in long exposure with interpolated
    corresponding below-threshold time-normalized pixels from step 2.
 ---------------------------------------------------------------------------
 MODIFICATION HISTORY:
    8-Nov-91, L. W. Acton (Wrote composite)
   19-May-92, LWA  (Several more mods in betwee)
   13-may-93, J. R. Lemen, Re-wrote.  Calls sxt_satpix
    1-Dec-93, MDM - Corrected error with the use of "s2" (when it is -1)
		- Modification on selection of replacement pixels.
		  It used to check (a) that it was high signal (ge 90)
				   (b) that it was not saturated
		  Added check so that it replaced pixels in the longer 
		  exposure only when the longer exposure was saturated
    15-Dec-93, SLF - Fixed typo (stapix->satpix)
    22-feb-94, JRL - Corrected the algorithm; 
		    - added smooth_factor, sfd, dc_interpolate, register keywords
    17-Apr-94, LWA - Fixed /sfd scaling option (1000.*  was needed)
		    - Changed /plot to plot raw input images.
		    - Added RESTRICTIONS statement to header.
		    - Added despike=despike keyword.
    23-jun-94, JRL - Output is floating if input is a fltarr;
		    - Call sfd_comp with index=index to normalize properly
    08-May-95, LWA - Fixed to return negative values.
    02-Nov-96, LWA - Added output of index with history record.
		    - Made dc_data a keyword intput.
		    - Made dc_interpolate the default is dc_data not input.
    04-Nov-96, LWA - Removed forgotten diagnostic.
    10-Jan-97, LWA - Corrected calling sequence examples.
    20-Apr-99, LWA - Added /float and /orbit_correct to leak_sub call.
                   - Version 3.01
    14-Jul-99, BNH - history record wasn't being updated from LEAK_SUB.
                   - Bumped version to 3.02.
    11-Apr-00, LWA - Complete rewrite and improvement of logic.
		    - Added unc, smoothpix and threshold keywords.
		    - Changed version to 4.00.
    11-Apr-00, LWA - Corrected typo and bumped version to 4.01.
                   - Added keyword debug and bumped version to 4.02.
    10-Oct-00, LWA - Replaced smoothing with sxt_suture.pro.
		    - Changed version to 5.00.
		    - This version does NOT return revised uncertainty.
    12-Jan-01, DMcK & LWA - Carried the uncertainties through the 
		      compositing process, and added option of input
		      UNC_IN.  Also cut out deadwood and fixed some typos,
		      and changed default threshold to 15.
		      Changed version to 6.00.
    15-Jan-01, SLF - add FILLMAP (flags for SSC uncertainty info storage)


sxt_composite [3] $SSW/yohkoh/sxt/idl/util/sxt_composite.pro
[Previous] [Next]
 NAME:
   sxt_composite
 PURPOSE:
   Prepare a composite SXT image from 2 or 3 Half or Quarter Res images.
 CALLING SEQUENCE EXAMPLES:
   cimg = sxt_composite(index,data,sx=[16,17],comp_index)
   cimg = sxt_composite(index,data,dc_data=dc_data,sx=[1,2,3],sd=[0,2,1])
   cimg = sxt_composite(index,data,satpix=satpix,despike=7)
   cimg = sxt_composite(index,data,satpix=satpix,/sfd,/dc_interp,/reg)
 INPUTS:
   index = SXT index structure
   data  = 3-d data cube (at least 2 images)

  If data is byte and no dc_data then		leak_sub
  If data is byte and dc_data    then		decompress and data-dc_data
  If data is not byte type       then		assume already decompressed, 
						-- and background subtracted
 OUTPUT:
  Function result is a 2-d long array (linear scaling) unless data is float
  type, then output is a 2-d float array.
 OPTIONAL OUTPUT:
    comp_index = index structure for composite image, made from index
	of longest exposure with history records appended.
 OPTIONAL INPUT KEYWORDS:
   dc_data = Dark frame data cube, use these rather than leak_sub.
   sx	   = Indices of the data array. If not supplied, compute values
	     that result in ==> sx = [short, medium, long exposure]
   sd     = Indices of the background array.  If not supplied, 
	     then must supply   sd = [short, medium, long exposure]
   satpix = Saturated pixel array (required if data is not byte type).
	     Must be 3-d and correspond to data(*,*,*).
   plot   = If set, plot the results as we go.  The results are displayed
	     on a logarithmic scale.
   smooth_factor = Boxcar smooth the bleed pixels.  If not defined, the
	     default is to smooth over 5 pixels.
   sfd    = /sfd will cause the image to come back scaled as an sfd image
	     (per second/HR pixel, and scaled by sfd_comp).
   dc_interpolate = If set = 0 leak_sub will not use DC interpolation.
		[Default is to use DC interpolation.]
   register = If set, do a whole pixel registration of short exposures to 
	     the long exposure
   despike = Calls de_spiker, despike=10 is a reasonable level in most cases.
 CALLS: ***
	DOC_LIBRARY, WDEF [1], WDEF [2], gt_day [1], gt_day [2], gt_expdur [1]
	gt_expdur [2], gt_res, gt_time [1], gt_time [2], his_index, safe_log10, sfd_comp
	sxt_dn_unc, sxt_prep [1], sxt_prep [2], sxt_prep [3], sxt_suture [1]
	sxt_suture [2]
 CALLED BY:
	SXT_QLOOK, pfi_composite, sxt_sff_composite [1], sxt_sff_composite [2]
 RESTRICTIONS:
   Must be called separately for each composite output image.
 MODIFICATION HISTORY:
    8-Nov-91, L. W. Acton (Wrote composite)
   19-May-92, LWA  (Several more mods in betwee)
   13-may-93, J. R. Lemen, Re-wrote.  Calls sxt_satpix
    1-Dec-93, MDM - Corrected error with the use of "s2" (when it is -1)
		- Modification on selection of replacement pixels.
		  It used to check (a) that it was high signal (ge 90)
				   (b) that it was not saturated
		  Added check so that it replaced pixels in the longer 
		  exposure only when the longer exposure was saturated
    15-Dec-93, SLF - Fixed typo (stapix->satpix)
    22-feb-94, JRL - Corrected the algorithm; 
		    - added smooth_factor, sfd, dc_interpolate, register keywords
    17-Apr-94, LWA - Fixed /sfd scaling option (1000.*  was needed)
		    - Changed /plot to plot raw input images.
		    - Added RESTRICTIONS statement to header.
		    - Added despike=despike keyword.
    23-jun-94, JRL - Output is floating if input is a fltarr;
		    - Call sfd_comp with index=index to normalize properly
    08-May-95, LWA - Fixed to return negative values.
    02-Nov-96, LWA - Added output of index with history record.
		    - Made dc_data a keyword intput.
		    - Made dc_interpolate the default is dc_data not input.
    04-Nov-96, LWA - Removed forgotten diagnostic.
    10-Jan-97, LWA - Corrected calling sequence examples.


SXT_COVERAGE $SSW/yohkoh/ucon/idl/hudson/sxt_coverage.pro
[Previous] [Next]
 NAME:
     SXT_COVERAGE 
 PURPOSE: 
     show SXT long exposures relative to GOES at an event
 CATEGORY:
     Yohkoh
 CALLING SEQUENCE:
     sxt_coverage, event_time, time_interval
 INPUTS:
     event_time, time of event
     time_duration, duration in hours (covers from 0.5 unit before to 
       1 unit after)
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     FLARE, also shows PFI's from flare mode
     CHARSIZE
 OUTPUTS:
     plot. Shows exposures with tick lengths ~ DPE
 CALLS: ***
	PLOT_GOES, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], evt_grid
	fem_grid [1], fem_grid [2], gt_dpe, gt_expmode, rd_gxd [1], rd_gxd [2], rd_gxd [3]
	rd_obs
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     8-jun-97, written to look for Moreton waves (HSH)
    14-jun-97, added /flare (HSH)
    21-jun-97, removed dark FFI images (HSH)
    13-aug-97, added charsize keyword (HSH)


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

 Picks up darks from the weekly files that match the inputs


PRO sxt_dark_sample, index, data, filter, binning, dpe, year, week1, week2, $
		 skip=skip, sdw=sdw


 INPUT PARAMETERS:
	filter = number of the x-ray analysis filter (GT_FILTB), integer.
	binning = number of the CCD binning (GT_RES), integer.
	dpe = DPE level (GT_DPE), integer.
	year = 2 digit year, integer.
	week1, week2 = start and end weeks to get data, integer.

 OPTIONAL INPUT KEYWORDS:
	skip = number of weeks to skip between samples. Default=0.
	sdw - If set, gather the darks with CCD warm.  Default=sdc, CCD cold.

 OUTPUT parameters:
	index = index of darks found
	data = dark image cube

 CALLS: ***
	RD_SDA [1], RD_SDA [2], RD_SDA [3], Rd_Roadmap [2], gt_dpe, gt_filtb, gt_res
	rd_roadmap [1], str_concat [1], str_concat [2]
 RESTRICTIONS:
	One year of darks is a lot of data.

 HISTORY:
	Written  June 30, 1994  Barry LaBonte


sxt_decomp [2] $SSW/yohkoh/sxt/idl/util/sxt_decomp.pro
[Previous] [Next]
  NAME:
       sxt_decomp
  PURPOSE:
       Decompress an SXT image
	Optionally return decompression uncertainty
  CALLING SEQUENCE:
	u_data = sxt_decomp(data,unc_data)
	u_data = sxt_decomp(data,unc_data)
	u_data = sxt_decomp(data,/silent)
	unc_data = sxt_decomp(data,/uncertainty)   ; return uncertainties only
  INPUT:
	data	= Compressed DN (byte-type)
		  data MUST be byte type.  If not, data is returned
		  and an informational message is displayed at tty.
  OPTIONAL INPUT PARAMETER:
	silent	= If set, don't send a message if data is not byte type
	uncertainty = If set, return uncertainties.
  OUTPUT:
	Returns decompressed data (integer type) 
	or      uncertainties (byte type) if the /uncertainty switch is set.
  OPTIONAL OUTPUT:
	unc_data= Decompression uncertainty
 CALLED BY:
	BONEHEAD_MASS_ESTIMATE, BOXLC_DISPLAY, COMPOSITE, FILT4_SIM, GLITCH_TRACKER
	GO_FIND_LIM2, GO_FIND_LIMB, LWA_TE, PFI_TOTALIZER, QUICKDARK [2], QUICKSTRAY [2]
	RD_AR, RESTORE_FFI, RESTORE_LOW8 [1], RESTORE_LOW8 [3], SDC_VERIFY, SXT_PREP0
	SXT_TE, SXT_TEEM1 [1], SXT_TEEM1 [2], SXT_TEEM1 [3], WL_CUBE_II, ars_exp, change_res
	dark_sub [1], dark_sub [2], dark_sub [3], deka_norm [1], deka_norm [2], dn2ph
	exp_norm [1], exp_norm [2], exp_norm2, fit_limb, get_dc_image [2]
	get_dc_image [3], get_sdl_avg, go_lasdisk golaserdisk, go_lasdisk2 golaserdisk
	go_nvs4, go_nvs5, interp_img, lwa_te_intact, mc_unc, mk_desat, mk_sdm, mk_sdmi
	mk_sfd [1], mk_sfd [2], mk_sfd [3], mk_sfd [4], mk_sl [1], mk_sl [2], mk_strip_file
	ocenter, ptv_sxt, rest_low8_cube [1], rest_low8_cube [2], rest_low8_ffi, rm_df
	sho_max, sxt_dn2ph, sxt_prep [1], sxt_prep [2], sxt_prep [3], unsharp_mask
  HISTORY:
	28-jan-93, J. Lemen, Added uncertainty code.  
			     Adapted from J. Mctiernan Spring '92 version
	22-feb-93, JRL, Force unc_data to be byte type
	 9-mar-93, JRL, Added the /uncertainty switch


sxt_decon [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_decon.pro
[Previous] [Next]

 Deconvolve PSF from an SXT image to get a cleaner image.  Default
	PSF is delta-function core plus scattering wings, but it's
	possible to use a Moffat core with/without wings too.


PRO sxt_decon, in_index, in_data, out_index, out_data, xc=xc, yc=yc, $
	spower=spower, log10T=log10T, moffat=moffat, no_scat=no_scat, $
	scat_fraction=scat_fraction, no_shadow=no_shadow, $
	noverbose=noverbose, qstop=qstop


 INPUT PARAMETERS:
	in_index = input index structure
	in_data = input image

 OPTIONAL INPUT PARAMETERS:
       XC,YC, the center of the FOV in CCD full-res coords (optional)
	LOG10T, estimate of temperature in the region.  In SXT_PSF,
		this will override the default scattering amplitude.
	NO_SCAT, sets PSF to be Moffat core only, no scattering.
		The default PSF for SXT_DECON is a delta function core
		plus scattering wings.  (Note, the default PSF for
		the program SXT_PSF is a Moffat core plus wings.)
		(Also note that /no_scat will override /moffat)
	MOFFAT, Uses a PSF comprising a Moffat core PLUS SCATTERING.
		If you don't want scattering, then use /no_scat. 
		Overrides the default mode, which is delta core plus wings.
	NO_SHADOW, The default mode is to use a scattering wing model
               that includes the "ray" shadows of the filter supports.
               This is currently our best fit to the scattering wing,
               with a slope of -2 in the radial dependence.
               Selecting NO_SHADOW will defeat this, and assume a 
               cylindrically symmetric, smooth scattering wing with
               no "rays".
       SPOWER = Slope of the scattering wing, with or without "rays",
               is set by SPOWER.  Default SPOWER is -2.
       SCAT_FRACTION = fraction of total signal to be attributed to the
               scattering wings.  The default values are based on
               McKenzie's analysis of May 2002; but with this optional
               parameter you can force X percent of the signal into
               the wings; e.g., scat_fraction=0.073 for 7.3% scattering

 CALLING SEQUENCE
	sxt_decon,in_index,in_img,out_index,out_img
       sxt_decon,in_ind,indata,out_ind,outdata,xc=144,yc=213,log10t=6.12
       sxt_decon,in_index,in_image,out_index,out_image,scat_fraction=.044

 OUTPUT PARAMETERS:
	out_index = history-revised index structure  (NOT YET!!)
	out_data = deconvolved image

 CALLS: ***
	BOX_MESSAGE, UNIQ [1], UNIQ [2], UNIQ [3], gt_filtb, gt_res, gt_shape, sxt_psf
	tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	mk_ssc [1], mk_ssc [2], sxt_ssc2sss
 RESTRICTIONS:
	Calls SXT_PSF for point spread function, and then uses Fourier
	transforms for convolution.
	USES BIG ARRAYS, TAKES TIME, USES MEMORY.
	As of May 2002, now allows data cubes (but actually treats
	only one image at a time).

 PROGRAMS CALLED:
	GT_FILTB, GT_RES, UNIQ, SORT, N_ELEMENTS, GT_SHAPE, 
	WHERE, SXT_PSF, FFT

 HISTORY:
	Written June 17, 1994   Barry LaBonte (as SXT_SCATTER)
	Cleaned up the code   June 21, 1994  BJL
	Default values are Acton's result for 6-Sep-92 image  June 23,1994 BJL
	30-Oct-96 [LWA]  Generalized method of determining pixel size.
			 (called LWA_SCATTER)
	08-Mar-99 DMcK   Revised deconvolution from LWA_SCATTER, 
			 incorporated SXT_PSF.  Renamed DMCK_DECON
	31-Mar-99 DMcK   Removed some unused code, renamed SXT_DECON
	01-Apr-99 DMcK   Added DOUBLE=1 to FFT calls
	07-Nov-99 DMcK   Added log10T optional input, for use in SXT_PSF.
	08-Feb-01 DMcK   Included /DELTA, SLEVEL, SPOWER, & SCAT_FRACTION
			 as optional inputs for SXT_PSF.  Included /WIENER
			 for optional Wiener (optimal) filtering.  The latter
			 calls Tom Metcalf's WIENER.PRO.
	09-APR-01 DMcK	 Added switch NO_SHADOW, made SXT_SCATWINGS the
			 default scattering-wing model.
V2.00  15-MAY-02 DMcK   Removed defunct SLEVEL and WIENER options; made
			 /DELTA the default PSF for deconvolution, but
			 allows deconvolution with Moffat core + wings;
			 now allows data cubes, and gets image size from
			 the input index.  Accelerated by calling SXT_PSF
			 only once per res/filt/size combination.  Force
			 total signal to be conserved.  Promoted to 
			 Version 2.00.  (Does not yet update history.)
V2.01  11-JUL-02 DMcK   Don't force total signal to be conserved.
v2.20  12-Jan-04 SLF    Update .HIS(tory) record to reflect deconvolution


sxt_decon [2] $SSW/yohkoh/sxt/idl/atest/sxt_decon.pro
[Previous] [Next]

 Deconvolve PSF from an SXT image to get a cleaner image.  Default
	PSF is delta-function core plus scattering wings, but it's
	possible to use a Moffat core with/without wings too.


PRO sxt_decon, in_index, in_data, out_index, out_data, xc=xc, yc=yc, $
	spower=spower, log10T=log10T, moffat=moffat, no_scat=no_scat, $
	scat_fraction=scat_fraction, no_shadow=no_shadow, $
	noverbose=noverbose, qstop=qstop


 INPUT PARAMETERS:
	in_index = input index structure
	in_data = input image

 OPTIONAL INPUT PARAMETERS:
       XC,YC, the center of the FOV in CCD full-res coords (optional)
	LOG10T, estimate of temperature in the region.  In SXT_PSF,
		this will override the default scattering amplitude.
	NO_SCAT, sets PSF to be Moffat core only, no scattering.
		The default PSF for SXT_DECON is a delta function core
		plus scattering wings.  (Note, the default PSF for
		the program SXT_PSF is a Moffat core plus wings.)
		(Also note that /no_scat will override /moffat)
	MOFFAT, Uses a PSF comprising a Moffat core PLUS SCATTERING.
		If you don't want scattering, then use /no_scat. 
		Overrides the default mode, which is delta core plus wings.
	NO_SHADOW, The default mode is to use a scattering wing model
               that includes the "ray" shadows of the filter supports.
               This is currently our best fit to the scattering wing,
               with a slope of -2 in the radial dependence.
               Selecting NO_SHADOW will defeat this, and assume a 
               cylindrically symmetric, smooth scattering wing with
               no "rays".
       SPOWER = Slope of the scattering wing, with or without "rays",
               is set by SPOWER.  Default SPOWER is -2.
       SCAT_FRACTION = fraction of total signal to be attributed to the
               scattering wings.  The default values are based on
               McKenzie's analysis of May 2002; but with this optional
               parameter you can force X percent of the signal into
               the wings; e.g., scat_fraction=0.073 for 7.3% scattering

 CALLING SEQUENCE
	sxt_decon,in_index,in_img,out_index,out_img
       sxt_decon,in_ind,indata,out_ind,outdata,xc=144,yc=213,log10t=6.12
       sxt_decon,in_index,in_image,out_index,out_image,scat_fraction=.044

 OUTPUT PARAMETERS:
	out_index = history-revised index structure  (NOT YET!!)
	out_data = deconvolved image

 CALLS: ***
	BOX_MESSAGE, UNIQ [1], UNIQ [2], UNIQ [3], gt_filtb, gt_res, gt_shape, sxt_psf
	tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	mk_ssc [1], mk_ssc [2], sxt_ssc2sss
 RESTRICTIONS:
	Calls SXT_PSF for point spread function, and then uses Fourier
	transforms for convolution.
	USES BIG ARRAYS, TAKES TIME, USES MEMORY.
	As of May 2002, now allows data cubes (but actually treats
	only one image at a time).

 PROGRAMS CALLED:
	GT_FILTB, GT_RES, UNIQ, SORT, N_ELEMENTS, GT_SHAPE, 
	WHERE, SXT_PSF, FFT

 HISTORY:
	Written June 17, 1994   Barry LaBonte (as SXT_SCATTER)
	Cleaned up the code   June 21, 1994  BJL
	Default values are Acton's result for 6-Sep-92 image  June 23,1994 BJL
	30-Oct-96 [LWA]  Generalized method of determining pixel size.
			 (called LWA_SCATTER)
	08-Mar-99 DMcK   Revised deconvolution from LWA_SCATTER, 
			 incorporated SXT_PSF.  Renamed DMCK_DECON
	31-Mar-99 DMcK   Removed some unused code, renamed SXT_DECON
	01-Apr-99 DMcK   Added DOUBLE=1 to FFT calls
	07-Nov-99 DMcK   Added log10T optional input, for use in SXT_PSF.
	08-Feb-01 DMcK   Included /DELTA, SLEVEL, SPOWER, & SCAT_FRACTION
			 as optional inputs for SXT_PSF.  Included /WIENER
			 for optional Wiener (optimal) filtering.  The latter
			 calls Tom Metcalf's WIENER.PRO.
	09-APR-01 DMcK	 Added switch NO_SHADOW, made SXT_SCATWINGS the
			 default scattering-wing model.
V2.00  15-MAY-02 DMcK   Removed defunct SLEVEL and WIENER options; made
			 /DELTA the default PSF for deconvolution, but
			 allows deconvolution with Moffat core + wings;
			 now allows data cubes, and gets image size from
			 the input index.  Accelerated by calling SXT_PSF
			 only once per res/filt/size combination.  Force
			 total signal to be conserved.  Promoted to 
			 Version 2.00.  (Does not yet update history.)
V2.01  11-JUL-02 DMcK   Don't force total signal to be conserved.


sxt_defroi $SSW/yohkoh/ucon/idl/linford/sxt_defroi.pro
[Previous] [Next]
	NAME: sxt_defroi

	Purpose: Selection and extract indices of a SXT image.

	CALLING SEQUENCE:
		region = sxt_defroi(data, [zoom=zoom, 
				xverts=xverts, yverts=yverts])
		data 	input SXT image
	maybe	xs	image x-size in pixels
	maybe	ys 	image y-size in pixels
		zoom	zoom factor for blow-up of input image.
			If not specified computes best value for
			current window.
		xverts	x-coordin. for selected contour outline.
		yverts  y-coordin. for xverts.

	How to use:
		a) Example for Decompressed data:
		IDL> tvscl, rebin(alog10(data(*,*,18)>0), 6*65, 6*65)
		where, data = intarr(65,65,n)
		IDL> region = sxt_defroi( data(*,*,18), zoom=6)
 CALLS: ***
	DEFROI [1], DEFROI [2], WDEF [1], WDEF [2], conroi, input [1], input [2]
	History: 
		written 17-Dec-92, GAL
		mod for better window manage...gal 30-Jan-93
		3-feb-93, minor mods, gal


sxt_deleak [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_deleak.pro
[Previous] [Next]

 PROGRAM NAME
	sxt_deleak
 PURPOSE
	Second order straylight correction.  Add/subtract enough
	of the SFC leak image to force the average signal in the
	corners of the sxt_prep'd FFI to become zero.
 SAMPLE CALLING SEQUENCE
	output = sxt_deleak(index,data,yn=yn)
 INPUT
       index, index structure of SSC datafile
       data, SSC floating point image array
 OPTIONAL KEYWORD INPUT
	/synsfc, causes use of synthetic SFCs for 2nd order correction
	/debug, stops program on each image processing cycle
	/timer, causes print to screen of time sxt_deleak took to run.
	xdata, array of raw SXT images for missing minor frame checks.
 OUTPUT
	Array of second-order leak corrected images.
 OPTIONAL INPUT/OUTPUT	
       lkind, the SFC index(s)
       lkdat, the SFC leak image(s)
       imap, vector relating which SFC goes with which SSC		 
 OPTIONAL KEYWORD OUTPUT
       yn, array flagging images to which 2nd order leak
	    correction has been applied or not needed.
	    	 0 if no correction
		 + or - value of average corner correction
		    in DN/pix if correction made.
	    Correction applied if residual corner signal 
	    greater than .01 DN/pix.
 PROCEDURE (For images taken without the NuDen filter.)
	Add/subtract enough of the SFC leak image, after correction
	for x-ray scattering, to force the average signal in the 
	periphery of the composite image to become zero.
     Details:
	1.  Compute DN/pix inside 1.1 Rsun of SSC, ds.
	2.  Approximate scattered light (DN/pix) outside of
		1.7 Rsun from the power-law expression
		sl = 0.00657*ds^0.962.
	3.  Determine SSC signal (DN/pix) outside of 1.7 Rsun
		in SSC image, dc, in DN/pix.
	4.  Subtract sl from dc to determine residual corner
		signal, rc, in DN/pix.
	5.  Subtact or add enough SFC to SSC to force rc ==> 0.
 PROCEDURE (For images taken WITH the NuDen filter.)
	Call NuDen_2nd.pro and subtract average of rows 12/res through 42/res
	from all rows of the leak-corrected image.  Sounds dumb but
	works quite well for normal pointing.
 PROGRAMS CALLED
	get_leak_image, sxt_cen, shift_res, get_rb0p, gt_pix_size, gt_res,
	blank_circle, gt_expdur, total, abs, NuDen_2nd
 HISTORY
	16-Aug-99 LWA, Mod. of cfix.pro to correct for x-ray scatter.
       10-Jan-2000 - S.L.Freeland - case where user supplied 
			(avoid get_leak_image call)
       07-Oct-2002 - T. Metcalf - Fixed indexing bug
	 2-Jan-2004 - L. Acton - Fixed errors in handling of QR images.
			Added capability to use SynSFCs.
	 5-Jan-2004 - LWA - Debugged synsfc keyword.
	10-Jan-2004 - LWA - Added keyword "timer" to quiet program.
	27-Jan-2004 - LWA - Added test for missing minor frames in data.
       29-Jan-2004 - S.L.Freeland - fix typo (strtrm->strtrim)
       30-Jan-2004 - LWA - Fixed case of missing minor frame at top of image.
        9-Feb-2004 - LWA - Fixed case of missing minor frame at bottom of image.
	24-Feb-2004 - LWA - Added protection against darks, cals, & optical filters.
       16-Mar-2004 - LWA - Corrected bug in filt_a test that prevent 2nd order correction.
	25-Mar-2004 - LWA - Deal with case of no SynSFC coefffile, get TermSFC.
	 1-Apr-2004 - LWA - Incorporated special correction for images using NuDen filter.
       16-Apr-2004 - SLF - change NuDen_2nd->nuden_2nd.pro     
	 3-Sep-2004 - LWA - Added step to remove Cosmic Ray spikes from second order
			background test areas beyond 1.7 Rsun.
	 1-May-2006 - LWA - Added code to discard saturated pixels in test areas
			if xdata array is available.
	 3-May-2006 - LWA - Removed old debug stop.
 CALLS:
 CALLED BY
	leak_sub [1], leak_sub [2], leak_sub [3], mk_ssc [1], mk_ssc [2], sxt_prep [1]
	sxt_prep [2], sxt_prep [3]


sxt_deleak [2] $SSW/yohkoh/sxt/idl/atest/sxt_deleak.pro
[Previous] [Next]

 PROGRAM NAME
	sxt_deleak
 PURPOSE
	Second order straylight correction.  Add/subtract enough
	of the SFC leak image to force the average signal in the
	corners of the sxt_prep'd FFI to become zero.
 SAMPLE CALLING SEQUENCE
	output = sxt_deleak(index,data,yn=yn)
 INPUT
       index, index structure of SSC datafile
       data, SSC floating point image array
 OPTIONAL KEYWORD INPUT
	/synsfc, causes use of synthetic SFCs for 2nd order correction
	/debug, stops program on each image processing cycle
	/timer, causes print to screen of time sxt_deleak took to run.
	xdata, array of raw SXT images for missing minor frame checks.
 OUTPUT
	Array of second-order leak corrected images.
 OPTIONAL INPUT/OUTPUT	
       lkind, the SFC index(s)
       lkdat, the SFC leak image(s)
       imap, vector relating which SFC goes with which SSC		 
 OPTIONAL KEYWORD OUTPUT
       yn, array flagging images to which 2nd order leak
	    correction has been applied or not needed.
	    	 0 if no correction
		 + or - value of average corner correction
		    in DN/pix if correction made.
	    Correction applied if residual corner signal 
	    greater than .01 DN/pix.
 PROCEDURE (For images taken without the NuDen filter.)
	Add/subtract enough of the SFC leak image, after correction
	for x-ray scattering, to force the average signal in the 
	periphery of the composite image to become zero.
     Details:
	1.  Compute DN/pix inside 1.1 Rsun of SSC, ds.
	2.  Approximate scattered light (DN/pix) outside of
		1.7 Rsun from the power-law expression
		sl = 0.00657*ds^0.962.
	3.  Determine SSC signal (DN/pix) outside of 1.7 Rsun
		in SSC image, dc, in DN/pix.
	4.  Subtract sl from dc to determine residual corner
		signal, rc, in DN/pix.
	5.  Subtact or add enough SFC to SSC to force rc ==> 0.
 PROCEDURE (For images taken WITH the NuDen filter.)
	Call NuDen_2nd.pro and subtract average of rows 12/res through 42/res
	from all rows of the leak-corrected image.  Sounds dumb but
	works quite well for normal pointing.
 PROGRAMS CALLED
	get_leak_image, sxt_cen, shift_res, get_rb0p, gt_pix_size, gt_res,
	blank_circle, gt_expdur, total, abs, NuDen_2nd
 HISTORY
	16-Aug-99 LWA, Mod. of cfix.pro to correct for x-ray scatter.
       10-Jan-2000 - S.L.Freeland - case where user supplied 
			(avoid get_leak_image call)
       07-Oct-2002 - T. Metcalf - Fixed indexing bug
	 2-Jan-2004 - L. Acton - Fixed errors in handling of QR images.
			Added capability to use SynSFCs.
	 5-Jan-2004 - LWA - Debugged synsfc keyword.
	10-Jan-2004 - LWA - Added keyword "timer" to quiet program.
	27-Jan-2004 - LWA - Added test for missing minor frames in data.
       29-Jan-2004 - S.L.Freeland - fix typo (strtrm->strtrim)
       30-Jan-2004 - LWA - Fixed case of missing minor frame at top of image.
        9-Feb-2004 - LWA - Fixed case of missing minor frame at bottom of image.
	24-Feb-2004 - LWA - Added protection against darks, cals, & optical filters.
       16-Mar-2004 - LWA - Corrected bug in filt_a test that prevent 2nd order correction.
	25-Mar-2004 - LWA - Deal with case of no SynSFC coefffile, get TermSFC.
	 1-Apr-2004 - LWA - Incorporated special correction for images using NuDen filter.
       16-Apr-2004 - SLF - change NuDen_2nd->nuden_2nd.pro     
 CALLS:
 CALLED BY
	leak_sub [1], leak_sub [2], leak_sub [3], mk_ssc [1], mk_ssc [2], sxt_prep [1]
	sxt_prep [2], sxt_prep [3]


sxt_deleak2 $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_deleak2.pro
[Previous] [Next]

 PROGRAM NAME
	sxt_deleak
 PURPOSE
	Second order straylight correction.  Add/subtract enough
	of the SFC leak image to force the average signal in the
	corners of the sxt_prep'd FFI to become zero.
 SAMPLE CALLING SEQUENCE
	output = sxt_deleak(index,data,yn=yn)
 INPUT
       index, index structure of SSC datafile
       data, SSC floating point image array
 OPTIONAL KEYWORD INPUT
	/synsfc, causes use of synthetic SFCs for 2nd order correction
	/debug, stops program on each image processing cycle
	/timer, causes print to screen of time sxt_deleak took to run.
	xdata, array of raw SXT images for missing minor frame checks.
 OUTPUT
	Array of second-order leak corrected images.
 OPTIONAL INPUT/OUTPUT	
       lkind, the SFC index(s)
       lkdat, the SFC leak image(s)
       imap, vector relating which SFC goes with which SSC		 
 OPTIONAL KEYWORD OUTPUT
       yn, array flagging images to which 2nd order leak
	    correction has been applied or not needed.
	    	 0 if no correction
		 + or - value of average corner correction
		    in DN/pix if correction made.
	    Correction applied if residual corner signal 
	    greater than .01 DN/pix.
 PROCEDURE (For images taken without the NuDen filter.)
	Add/subtract enough of the SFC leak image, after correction
	for x-ray scattering, to force the average signal in the 
	periphery of the composite image to become zero.
     Details:
	1.  Compute DN/pix inside 1.1 Rsun of SSC, ds.
	2.  Approximate scattered light (DN/pix) outside of
		1.7 Rsun from the power-law expression
		sl = 0.00657*ds^0.962.
	3.  Determine SSC signal (DN/pix) outside of 1.7 Rsun
		in SSC image, dc, in DN/pix.
	4.  Subtract sl from dc to determine residual corner
		signal, rc, in DN/pix.
	5.  Subtact or add enough SFC to SSC to force rc ==> 0.
 PROCEDURE (For images taken WITH the NuDen filter.)
	Call NuDen_2nd.pro and subtract average of rows 12/res through 42/res
	from all rows of the leak-corrected image.  Sounds dumb but
	works quite well for normal pointing.
 PROGRAMS CALLED
	get_leak_image, sxt_cen, shift_res, get_rb0p, gt_pix_size, gt_res,
	blank_circle, gt_expdur, total, abs, NuDen_2nd
 HISTORY
	16-Aug-99 LWA, Mod. of cfix.pro to correct for x-ray scatter.
       10-Jan-2000 - S.L.Freeland - case where user supplied 
			(avoid get_leak_image call)
       07-Oct-2002 - T. Metcalf - Fixed indexing bug
	 2-Jan-2004 - L. Acton - Fixed errors in handling of QR images.
			Added capability to use SynSFCs.
	 5-Jan-2004 - LWA - Debugged synsfc keyword.
	10-Jan-2004 - LWA - Added keyword "timer" to quiet program.
	27-Jan-2004 - LWA - Added test for missing minor frames in data.
       29-Jan-2004 - S.L.Freeland - fix typo (strtrm->strtrim)
       30-Jan-2004 - LWA - Fixed case of missing minor frame at top of image.
        9-Feb-2004 - LWA - Fixed case of missing minor frame at bottom of image.
	24-Feb-2004 - LWA - Added protection against darks, cals, & optical filters.
       16-Mar-2004 - LWA - Corrected bug in filt_a test that prevent 2nd order correction.
	25-Mar-2004 - LWA - Deal with case of no SynSFC coefffile, get TermSFC.
	 1-Apr-2004 - LWA - Incorporated special correction for images using NuDen filter.


SXT_DELINE $SSW/yohkoh/ucon/idl/hudson/sxt_deline.pro
[Previous] [Next]
 NAME:
     SXT_DELINE 
 PURPOSE:
     does cosmetic surgery on SXT images for hot-spike streaks
     e.g fixes the prominent hot spot at (182,66) in HR
 CATEGORY:
 CALLING SEQUENCE:
     sxt_deline, image, data
 INPUTS:
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
 CALLS: ***
	gt_res
 COMMON BLOCKS:
 SIDE EFFECTS:
     replaces the data array
 RESTRICTIONS:
 MODIFICATION HISTORY:
     HSH, written 10-May-97


sxt_dn2ph $SSW/yohkoh/sxt/idl/sensitivity/sxt_dn2ph.pro
[Previous] [Next]
  Name:
    sxt_dn2ph

  Purpose:
    Convert SXT DN into photon COUNTS.

  Calling Sequence:
    Photon = sxt_dn2ph(DN)
    Photon = sxt_dn2ph(DN,Energy=energy)
    Photon = sxt_dn2ph(DN,Energy=energy,gain=gain)
    Photon = sxt_dn2ph(DN,Wave=Wave,gain=gain)

  Inputs:
    DN	= scalar or array of compressed (byte-type) DN values
			or uncompressed (non-byte)  DN values

  Optional Input Keywords:
    Gain	= Sxt Gain constant (electrons/DN)
		  If not supplied, defaults to 100.
    Energy	= Photon energy (keV).  If not supplied, defaults to 1.5 keV.
    Wave	= Photon wavelength (Ang).  If not supplied, uses the 
		  Energy default.  Ignored if Energy keyword is supplied.

  Returns:
    Photon counts.

  Method:
	Assumes that 3.65 eV produces 1 electron-hole pair

	The equation is:
	# Photons = ( Wavelength (Ang) / 1.98648e-8 erg )
		    * 1.602192e-12 erg/eV * 3.65 eV/e * Gain (e/DN) * DN

 CALLS: ***
	sxt_decomp [1], sxt_decomp [2]
  Modification History:
   26-May-93, JRL, LPARL.


sxt_dn_int $SSW/yohkoh/ucon/idl/mctiernan/sxt_dn_int.pro
[Previous] [Next]
 NAME:
       sxt_dn_int
 CALLING SEQUENCE:
       y = sxt_dn_int(te, em, fb, dt=dt, date=date, init=init,
                     ph_flux=ph_flux, photons=photons)
 PURPOSE:
       Given Temperature and Emission measure, this will generate
       the data number, for the pixels in an SXT image.
 INPUT:
       te = Log(Temperature)
       em = log(EM)
       fb = filter number, fb=1 for open, 2 for Al.1, 3 for AlMg, 4 for Be119, 
	5 for Al12, and 6 for Mg3.
 OUTPUT:
       y = DN for the given temperature and emission measure.
 KEYWORDS:
       dt = exposure time in ms, default is 1000.0 ms
       date = date needed to obtain the right response fn. 
       init= if set you need to obtain the original photon spectrum,
       ph_flu= is passed out if init is set, this is the photon fluence at
                each energy for which we have a response. This refers to the
                photons which reach the CCD, so it includes the effective area.
       photons= outputs the number of photons
 CALLS: ***
	ADDTIME [1], ADDTIME [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	INTERPU_1D, concat_dir [4], mewe_spec [1], mewe_spec [2], restgen [1], restgen [2]
 CALLED BY:
	mc_unc
 COMMON BLOCKS:
       Common ph_pix, area_in, energy
              area_in, structure containing the effective area
               wave= wavelengths for which we have the spectrum
               entrance= entrance filter transmission
               ccd= ccd efficiency
               mirror= mirror effective area
               filter= filter transmission functions
               energy= 12.398/ area_in.wave
 HISTORY:
       10-jun-94, JMM
       4-Dec-95, jmm, altered to deal with degenerate wavelength bins


sxt_dn_unc $SSW/yohkoh/sxt/idl/sensitivity/sxt_dn_unc.pro
[Previous] [Next]
 NAME:
   sxt_dn_unc
 PURPOSE:
   Estimate the uncertainty intensity of an SXT pixel in DN
 CALLING SEQUENCE:
   unc = sxt_dn_unc(index,data)	; Assumes Te = alog10(3.e6)
   unc = sxt_dn_unc(index,data,te=te)
   unc = sxt_dn_unc(index,data,unc_in,te=te)

 INPUTS:
   index	- Must be an SXT index structure
   data	- decompressed DN values.  Can be a vector, or array.
		  If data is a 3-d cube, then length of index must match
		  the 3rd dimension of data:  index(N), data(M,K,N)
					 or:  index(N), data(N)
		  data may NOT be byte type.
 OPTIONAL INPUTS:
   unc_in	- Uncertainties to add to statistical uncertainties in quadrature.
		  unc_in can be a scalar or it must match the length of data.
		  Units of unc must match data.  For example, if data is normalized
		  to counts/sec, then unc_in must also be passed in as counts/sec.

		  Normally unc is the non-statistical error and it is provided
		  as an output variable from sxt_prep.  There are at least
		  three non-statistical errors:
		  	d_comp	= decompression error (sxt_decomp)
			d_dark	= dark subtraction error (dark_sub)
			d_reg	= Error from registration (align_prep)
		  sxt_prep returns sqrt(d_comp^2+d_dark^2+d_reg^2).


 OPTIONAL INPUT KEYWORD:
  te		- The log10 of electron temperature of the emitting plasma.  If omitted,
		  then Te = alog10(3.e6) is assumed.
  float	- Normally, the output array will be the same type as DATA.  If
		  /float is set, the output array will be floating.

 RETURNED:
  The statistical errors or sqrt(statistical_errors + unc^2) is returned.

 CALLS: ***
	gt_expdur [1], gt_expdur [2], gt_res, sxt_flux [1], sxt_flux [2], sxt_flux [3]
	tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	SXT_IMAGE_DECONVOLVE, mk_ssc [1], mk_ssc [2], sxt_composite [1]
	sxt_composite [2], sxt_composite [3]
 HISTORY:
  28-feb-95, J. R. Lemen, Written.
  24-mar-95, JRL, Fixed bug when n_elements(unc_in) = n_elements(data) (Thanks J. McT).


SXT_DRDT $SSW/yohkoh/ucon/idl/hudson/sxt_drdt.pro
[Previous] [Next]
 NAME:
 	SXT_DRDT	
 PURPOSE:
	calculates log derivatives of the filter efficiency functions
 CATEGORY:
 CALLING SEQUENCE:
	sxt_drdt, temps, derivs 
 CALLS: ***
	restgen [1], restgen [2]
 MODIFICATION HISTORY:
	HSH, 12-sep-93


sxt_dstreek $SSW/yohkoh/sxt/idl/atest/sxt_dstreek.pro
[Previous] [Next]
 NAME:
	sxt_dstreek
 PUPROSE:
	To remove bad pixels in streaks due to cosmic ray hits.
	The default parameters are optimized for prepared, compressed
	SXT images.
 CALLING SEQUENCE:
	result = sxt_dstreek(image [,sens=sens,thresh=thresh,pix=pix]
 INPUTS:
	image = 2-dimensional image
 OPTIONAL KEYWORD INPUTS:
   	sens = sensitivity to streaks
   		(sens = 10 is typical for "compressed" sxt image)
   	thresh = threshold for second-pass pixel map
   		(thresh = 20.0 is typical for "compressed" sxt image)
	pix = show good_pixmap and final sfd_compressed image.
 PROCEDURE:
	Image should be either:
		1) An SFD image, or
		2) An sxt_prep'd, sxt_kleen'd and, if desired an
			sxt_composite'd image.
	Program first prepares an SFD, then,

	Streaks at various angles are amplified and located using
	convolution and thresholding. This information is used to generate
	a map of good (undamaged) pixels. Bad pixels are replaced with a 
	weighted average of nearby good pixels. In a second pass, the
	result of this operation is subtracted from the original image.
	The good pixel map is revised based on the difference image,
	and pixel replacement is done again.

	If the input image was not an SFD (byte-type) then the streak
	pixels in the original image are replaced with sfd_decomp'd
	pixels from the destreaked SFD.
 CALLS: ***
	CONVOL_ENHANCE, WDEF [1], WDEF [2], ck_smooth, data_chk [1], data_chk [2], sfd_comp
	sfd_decomp
 RESTRICTIONS:
	The program does not work well on images which have not 
	been sxt_prep'd.
 HISTORY
	Original destreaking scheme invented by Charles Kankelborg.
	20-Apr-98, LWA	Genralized for use with non-SFD images.
       22-Sep-98, TRM  Added check that there are bad pixels before trying to
                       replace them.


SXT_ECLIPSE $SSW/yohkoh/ucon/idl/hudson/sxt_eclipse.pro
[Previous] [Next]
 NAME:
       SXT_ECLIPSE 
 PURPOSE:
	enter Soma-san's calculations for an eclipse
 CATEGORY:
	Yohkoh
 CALLING SEQUENCE:
       sxt_eclipse, eclipse, date=date, data_file=data_file, $
         plot=plot, skip=skip
       sxt_eclipse, eclipse, /plot
 INPUTS:
	data_file gives (string) file ID for Soma_san's data.
         Default is '/ys/ucon/soft/hudson/oct95_eclipse.dat'
       date is the date of the eclipse, default '24-oct-95'
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
       plot makes a plot of radial distance, with fem_grid
       skip is the number of lines to skip at the top of the
         data file, default 20
 OUTPUTS:
	structure with many things,
	among which eclipse.xx is the WEST departure
                   eclipse.yy is the NORTH departure
                   eclipse.daylight is a D/N flag
 WARNINGS
       Zaps your windows
       Soma_san's e-mail messages are used as input. They must be
         edited to leave 20 unused lines at the top, or 
         the actual number of lines to be skipped should be entered
       The Yohkoh ephemeris normally won't be available until 4 weeks
         before the fact
 CALLS: ***
	DAY_IN, ECLIPSE_PLOTTER, FMT_TIMER [1], FMT_TIMER [2], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], get_rb0p [1], get_rb0p [2], gt_day [1]
	gt_day [2], rd_fem, rd_tfile [1], rd_tfile [2]
 CALLED BY:
	ECL_FRAC
 MODIFICATION HISTORY:
	HSH written 8 April 1994
	HSH added d/n and saa 10 April 1994
	HSH updated to Nov eclipse 13-May-94
       HSH added /plot 28-Sep-94
       HSH hard-wired "final" Soma predictions from 18-Oct elements
       HSH converted to general use and tidied up some things 20-Sep-95
       HSH converted .xx from EAST departure to WEST departure
       HSH patched it up again for 17-18 April 1996
       HSH patched it up again for 7-Mar 1997. It is almost robust.


sxt_eff_area $SSW/yohkoh/sxt/idl/atest/sxt_eff_area.pro
[Previous] [Next]
 NAME: 
   sxt_eff_area 
 
 PURPOSE: 
  To return the SXT effective area function, i.e., effective area vs. 
  wavelength, for a given filter and date.  This is important because the
  spectral variation of effective area is changed with each entrance filter
  failure. 

 CALLING SEQUENCE ILLUSTRATIONS:
  Area = sxt_eff_area(filter,date=date[,wave=wave])
  Area = sxt_eff_area(2,date='1-Apr-95')
  Area = sxt_eff_area(index(0))
  Area = sxt_eff_area(3,open_fraction=0.5)

 INPUTS:
  filter = Filter B value (range is 1 to 6) or SXT index structure.
		String Output for GET_FILTB
		  1   Open 
		  2   Al.1 
		  3   AlMg 
		  4   Be119
		  5   Al12  
		  6   Mg3  

         Note:  FILTER can be a vector of filter numbers or an
           index array.  However, only a single date can be used
	    at a time.
         Note:  If FILTER is an SXT index structure, then
	    this is used to specify both the unique filter(s),
	    and the date -- unless overridden with with date=date.

 KEYWORD INPUT:
  date = the epoch for which the SXT effective area is wanted.

 OUTPUTS:
  SXT effective area for the specified filter(s) and date.

 OPTIONAL OUTPUT KEYWORD:
  wave=wave, the wavelength array used for computing and plotting
	the effective area.  This is the same for all filters and dates.
  open_fraction, use this keyword to put in an arbitrary open fraction
	of the entrance filter.  This overrides the value otherwise
	taken from get_yo_dates(/entrance,/value)

 CALLS: ***
	UNIQ [1], UNIQ [2], UNIQ [3], anytim2ints [1], anytim2ints [2], file_list [1]
	file_list [2], fmt_tim [1], fmt_tim [2], get_yo_dates [1], get_yo_dates [2]
	get_yo_dates [3], gt_filtb, restgen [1], restgen [2], tbeep [1], tbeep [2]
	tbeep [3]
 RESTRICTIONS:
  DATE can only be a single date, not an array.

 PROGRAMS CALALED:
  get_yo_dates

 HISTORY
  8-NOV-97 LWA Written for Jing Li.
 17-Jul-97 S.L.Freeland - fixed type in file_list call DIR_...->$DIR...


sxt_energy $SSW/yohkoh/ucon/idl/mctiernan/sxt_energy.pro
[Previous] [Next]
NAME:
	sxt_energy
PURPOSE:
	Calculates the plasma energy given temperature, emission measure
	and density, E=3*EM*kT/d
CALLING SEQUENCE:
	sxt_energy,te0,ute0,em0,uem0,d0,ud0,e0,ue0
INPUT:
	te0=Log(T)
	ute0=Uncertainty in TE0
	em0=Log(EM)
	uem0=Uncertainty in em0
	d0=Log(Density)
	ud0=Uncertainty in d0
OUTPUT:
	e0=Log(Plasma Energy) in ergs
	ue0=Uncertainty in e0
 CALLED BY:
	sxt_tfl, sxt_tflx
HISTORY:
	Written August '92 by JM
       switched units, 11-14-94, jmm


sxt_erg_per_dn $SSW/yohkoh/sxt/idl/sensitivity/sxt_erg_per_dn.pro
[Previous] [Next]
 NAME:
  sxt_erg_per_dn

 PURPOSE:
  Compute a table of erg/DN for a given SXT filter and wavelength band.

 CALLING SEQUENCE:
  erg_dn = sxt_erg_per_dn(Te,filter,date=date,short,long)
  erg_dn = sxt_erg_per_dn(Te,2,20,100)
  erg_dn = sxt_erg_per_dn(Te,filter,date='1-dec-92')  ; entrance filter changed

 INPUTS:
  filter = SXT analysis filter number (can be a vector)
	  1   Open       Op
	  2   Al.1       A1
	  3   AlMg       AM
	  4   Be119      Be
	  5   Al12       A2
	  6   Mg3        Mg
  Te = alog10(temperature)	Can be a vector

 ===========================================================================
 For example, the calling arguments might look like the following:

 IDL> Te = 5.5 + findgen(26)*.1 & pmm,te ; Generate a Temp vector 5.5 to 8.0
 IDL> out = sxt_erg_per_dn(Te,indgen(6)+1)       ; Compute for all filters
 IDL> help,Te,out
 TE              FLOAT     = Array(26)
 OUT             FLOAT     = Array(26, 6)
 ===========================================================================

 OPTIONAL INPUT:
       short = short wavelength (Angstrom), default = 1
       long  = long wavelength (Angstsrom), default = 300

 OPTIONAL INPUT KEYWORDS:
   date = 'date' in the standard format to account for change
	in entrance filter transmission in November 1992.

 OUTPUTS:
	Returns the alog10(erg/DN) for specified filters

 CALLS: ***
	DOC_LIBRARY, PMM [3], mewe_spec [1], mewe_spec [2], pmm [1], pmm [2], sxt_flux [1]
	sxt_flux [2], sxt_flux [3]
 RESTRICTIONS:
  If the dates of interest span the time of 17-nov-92, then separate
  calls must be made for data before and after this date.

  Te must be in the range 5.50 to 8.00

  Short must be 1 or greater and integral.
  Long must be 300 or smaller and ingegral.

 MODIFICATION HISTORY:
   23-jul-93, L. Acton, Written.
   27-jul-93, J. Lemen, Renamed to sxt_erg_per_dn.  Vectorized for speed.
   31-jul-93, JRL, Added noverbose in call to sxt_flux
   18-nov-93, JRL, Made the /noverbose switch in sxt_flux call explicit.
   30-jul-94, LWA, Added capability to compute flux for spectral bands.


sxt_etemp $SSW/yohkoh/ucon/idl/lemen/sxt_etemp.pro
[Previous] [Next]
  NAME:
    sxt_etemp
  PURPOSE:
    Read the SXT effective area file and convolve with the Mewe et al spectrum
    to generate the SXT response as a function of temperature.

    The results are written to a .genx file (fileout) unless /nofile is set.

  CALLING SEQUENCE:
    sxt_etemp,file_sxt_area
    sxt_etemp,file_sxt_area[, LogTe=LogTe, fileout = fileout]
  INPUTS:
    file_sxt_area	= Name of the genx file containing the SXT 
			  effective areas
  OPTIONAL INPUT KEYWORDS:
    LogTe		= Vector of the log10(temperatures) to calculate.
			  If omitted, LogTe = 5.5 + .05 * indgen((8-5.5)/.05+1)
    fileout		= Output filename.  If omitted, will search for
			  "srayymmdd" in the input filename and replace with
			  "sreyymmdd_01" to generate the output filename.
			  If the string is not matched, program will prompt for
			  a name.  The yymmdd = Year, month, day (eg., 930119)
    cosmic		= If set, use the cosmic abundances
    file_in		= To explicitly specify the line list data file.
    nofile		= If set, don't write an output sre (electron) file
    cwav_file		= If defined, write a .genx file with cwave results. 
			  Name should be the same as the sre except have "srw" 
			  as the prefix to work with sxt_mwave routine.
  OPTIONAL OUTPUT KEYWORDS:
    CWAVE		= Structure giving central wavelength as a function of
			  temperature and filter number.  
    cwav_text		= Text array describing the CWAVE results
    CAL_TEXT		= Contains information about the calculation.
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], FILE_EXIST [2], break_file [4]
	file_exist [1], file_exist [3], get_yo_dates [1], get_yo_dates [2]
	get_yo_dates [3], mewe_spec [1], mewe_spec [2], restgen [1], restgen [2]
	savegen [1], savegen [2], tbeep [1], tbeep [2], tbeep [3], wc_where [1]
	wc_where [2], yesnox [1], yesnox [2]
  RESTRICTIONS:
    Defaults to cosmic abundances (in the Mewe table).
  MODIFICATION HISTORY:
   25 Jan 93, J. R. Lemen, LPARL
   26-Feb-93, JRL, Mewe code updated to Coronal Abundances
    7-jul-93, JRL, Added cosmic and file_in keywords
   18-apr-94, JRL, Optimized slightly.  Added cwave, nofile keywords
   21-apr-95, JRL, Changed wave, dwave so that edges are specified in call to mewe_spec
		    This makes a less than   1% change for all filters except Mg3
		    This makes a less than 2.9% change for Mg3
   24-nov-95, JRL, Automatically calculate cwave for all get_yo_dates(/entrance) values


SXT_EXPOSURE_MAP $SSW/yohkoh/ucon/idl/sxt_co/sxt_exposure_map.pro
[Previous] [Next]
 NAME:
     SXT_EXPOSURE_MAP
 PURPOSE:
     use RD_OBS to make an image of where SXT was watching
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
 CALLS: ***
	OVER, WDEF [1], WDEF [2], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	fmt_tim [1], fmt_tim [2], get_rb0p [1], get_rb0p [2], gt_center, gt_dp_rate [1]
	gt_dp_rate [2], gt_pix_size, gt_res, rd_obs, sxt_cen [1], sxt_cen [2]
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     29-Jun-99, written by HSH
     21-Apr-00, fixed (x1 lt 0) bug


sxt_f2_to_f3 $SSW/yohkoh/ucon/idl/foley/sxt_f2_to_f3.pro
[Previous] [Next]
 NAME:
   sxt_f2_to_f3.pro 

 PURPOSE
   To obtain a best estimate of the SXT Dagwood flare image
   from the temperature and emission measures implied from a 
   filter ratio analysis of two of the other filter images.

 CALLING SEQUENCE
   sxt_f2_to_f3,te,em,sxt3

 INPUT
   te : Temperature Image cube obtained from sxt_teem
   em : Emission measure cube obtained from sxt_teem

 OUTPUT
   sxt3 : image cube of intensities DN/sec for Dagwood filter. 

 OPTIONAL OUTPUT
   none

 OPTIONAL KEYWORD INPUT
   none

 RESTRICTION
  Assumes isothermal plasmas.

 HISTORY
  Written CAF 12 NOV 95 : caf@mssl.ucl.ac.uk
 CALLS:


sxt_files $SSW/yohkoh/sxt/idl/atest/sxt_files.pro
[Previous] [Next]
   Name: sxt_files

   Purpose: return SXT file names between time0 and time0
  
   Input Parameters:
      time0  - start time or vector of times to match
      time1  - stop  time of range

 CALLS: ***
	BOX_MESSAGE, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2]
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], anytim2weekinfo
	concat_dir [4], file_exist [1], file_exist [3], file_list [1], file_list [2]
	get_logenv [1], get_logenv [2], reltime [1], reltime [2], sel_filetimes [1]
	sel_filetimes [2], timegrid
   History:
      7-November-1998 - S.L.Freeland - mimic eit_files/trace_files/cds_files   
      4-Feb-1999 - S.L.Freeland - allow sfd to reside in $SXT_SFD_DATA
      2-Nov-1999 - R.D.Bentley - only delault to sfd if $SXT_SFD_DATA is
                             defined, else defualt to sfr


sxt_fits_info $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_fits_info.pro
[Previous] [Next]
 NAME:
	sxt_fits_info
 PURPOSE
	Create an index structure from a fits-header structure that
	is compatible with get_info and SXT gt_xxx programs.
 CALLING SEQUENCE
	info = sxt_fits_info(fits_in,iout=iout)
 INPUT
	fits_in, the FITS header structure for SXT Legacy .fts files.
 OUTPUT
	info, a string array identical to the output of get_info.pro
 OPTIONAL KEYWORD OUTPUT
	iout, the limited SXT index structure.
 HISTORY
	13-Dec-2004 LWA  Created from get_info2.pro
 CALLS:


sxt_fl_anal $SSW/yohkoh/ucon/idl/mctiernan/sxt_fl_analx.pro
[Previous] [Next]
 NAME: 
	sxt_fl_anal
 PURPOSE:
	To generate Temperature, Emission Measure, and Density and energy
	For an SXT flare, as functions of time. You need to have obtained
	data using test_rd
 CALLING SEQUENCE:
	.run sxt_fl_anal	(this is a main program)
 INPUT:
	index= Image info from test_rd
	data= Images
	The program will prompt for filter numbers, 
	fb1 and fb2
	fb=1 for open, 2 for al1400, 3 for DAG, 4 for Be100, 
	5 for Al12, and 6 for mg3mu. 
 OUTPUT:
	subs1,subs2= subscripts of the two sets of images, which
	have the proper filters, and are in the same sequence loops.
       index1,index2= indexes for the images used
	te0= a fltarr of (ipix,jpix,nexp), Log(T)
	ute0= Uncertainty in te0
	em0= Log(EM)
	uem0= Uncertainty in em0
	utemx= Max. value of ute0 that we'll allow
 HISTORY:
	Written Sept '92 by JM
       Changed to use SXT_TEEM, SXT_PREP, etc 12-jul-94, jmm
       Added align_uncertainty, dropped density and pressure, 5-12-95, jmm


sxt_fl_analxpro $SSW/yohkoh/ucon/idl/mctiernan/sxt_fl_analxpro.pro
[Previous] [Next]
 NAME: 
	sxt_fl_analxpro
 PURPOSE:
	To generate Temperature and Emission Measure, 
	For an SXT flare, as functions of time. 
 CALLING SEQUENCE:
	sxt_fl_analxpro, index, data, time_array, te, em, ute, uem, subs1=subs1, subs2=subs2, $
                        fb1=fb1, fb2=fb2, utemx=utemx, sindex=sindex, sdata=sdata, $
                        sunc=sunc, ssat=ssat, quiet=quiet
 INPUT:
	index= Image info
	data= Images
 OUTPUT:
       time_array= an array of times for the measurements, the times
                   of index(subs2)
	te= a fltarr of (ipix,jpix,nexp), Log(T)
	em= Log(EM)
	ute= Uncertainty in te
	uem= Uncertainty in em
 KEYWORDS:
	utemx= Max. value of ute0 that we'll allow, the default is 0.20
       subs1, subs2= the subscripts of the images that you want
                     to use for the T measurements. Only gets used if
                     the data has been SXT_PREPPED. If not, then
                     these are obtained by SEQ_2FL. Note that both of these
                     keyowrds must be set for this to work.
	fb1, fb2= filter numbers, 
	fb=1 for open, 2 for al1400, 3 for DAG, 4 for Be100, 
	5 for Al12, and 6 for mg3mu.
       The defaults are fb1=4, fb2=5, al12, be119
       sindex, sdata= prepped index and data, so you need not do this every
                      time, note that subs1 and subs2 refer to sindex and
                      sdata
       sunc, ssat= uncertainty and saturation data for the sxt_prepped data.
       quiet= if set, no annoying messages from SXT_TEEM...
 CALLS: ***
	SXT_TEEM [1], SXT_TEEM [2], anytim2ints [1], anytim2ints [2], gt_filtb, sat_av_arr
	seq_2fl, strip_data, sxt_interp [1], sxt_interp [2], sxt_prep [1], sxt_prep [2]
	sxt_prep [3], ute_max
 HISTORY:
       from sxt_fl_analx.pro 26-jan-96, jmm


sxt_flux [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_flux.pro
[Previous] [Next]
 NAME:
  sxt_flux
 PURPOSE:
  Specify Te + filter + EM ==> compute DN or photon flux.
  Specify Te + filter + DN ==> compute EM

 CALLING SEQUENCE:
  Flux = sxt_flux(Te,filter_number)   ; DN/s for log10(EM) = 44
  Flux = sxt_flux(Te,index)           ; DN/get_expdur(index) for gt_filtb(index)
  Flux = sxt_flux(Te,index,/photons)  ; Photon/get_expdur(index) 
  EM   = sxt_flux(Te,index,DN=DN)     ; Supply DN and return Emission measure

 INPUTS:
  Te           = log10(Temp) (May be a vector: min = 5.5, max = 8.0)
  filter_number= Filter B value (range is 1 to 6) or SXT index structure.
 CALLED BY:
	BONEHEAD_MASS_ESTIMATE, HYDRO_ CORONA, PINCH_PLASMA, SXT_IMAGE_DECONVOLVE
	WITH_INT, WITH_INT_DISK, dem_tr_er, dem_tr_er0, lineofsight [1], lineofsight [2]
	lwa_dn_unc modified from sxt_dn_uncpro, mc_unc, sxl2radiance, sxt_dn_unc
	sxt_erg_per_dn, sxt_f2_to_f3, sxt_multi_teem, sxt_sig_per_dn_lwa, uncdn
                 Note:  If FILTER_NUMBER is an SXT index structure, then this 
                 will be used for Filter B, t1 (unless overridden with T1=T1) 
                 and date (unless overridden with DATE=DATE or 
                 FRAC_OPEN=FRAC_OPEN keywords).

  Either Te or filter_number may be vectors.  However, if both are vectors
  then their lengths must be the same.  In this case each element of the
  output vector, Flux(i), of SXT_FLUX will computed for Te(i) and
  filter_number(i).

 OUTPUTS:
   This function returns DN or Photon fluxes.
   If DN=DN keyword is set, will return Emission Measures.

 OPTIONAL INPUT KEYWORDS:
  em		= log10(Emission measure).  Default=44 (implies ==> 10^44 cm-3)
  DN		= SXT DN counts.  If specified, sxt_flux returns the log10(EM) 
		  instead of flux and the /photon and EM= keywords are ignored.
  t1		= Exposure time in msec (default = 1000 msec).  
		  Overrides exposure time specified by FILTER (index).
  date		= Time in any format (including structure). Used to
		  determine entrance filter transmission. 
		  Overrides date specified by FILTER (index).
  frac_open	= Fraction of open entrance filter.  0 = launch, 1 = no filter.
		  Overrides DATE and FILTER values.
  gain_ccd	= camera gain in e-/Dn.    (Default is 100).
  photons	= If set, return  photon flux (rather than DN).
  noverbose	= If set, suppress some of the informational messages
  file_db	= If provided, read the line spectral data from the specified
                 file instead of the default Mewe file.

 OPTIONAL OUTPUT KEYWORDS:
  version	= version number of SXT electron vs Te data base file

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DOC_LIBRARY, DSPLINE, STDEV, UNIQ [1], UNIQ [2], UNIQ [3]
	anytim2ints [1], anytim2ints [2], break_file [4], concat_dir [4], fastdoc [1]
	fastdoc [2], fmt_tim [1], fmt_tim [2], get_yo_dates [1], get_yo_dates [2]
	get_yo_dates [3], gt_expdur [1], gt_expdur [2], gt_filtb, interp1d [1]
	interp1d [2], interp1d [3], restgen [1], restgen [2], tbeep [1], tbeep [2]
	tbeep [3]
 RESTRICTIONS:
  DATE or FRAC_OPEN (if specified) must be length 1.  If the date is
  obtained from FILTER (= SXT index), the first time in the structure
  will be used to determine the entrance filter fraction.

  If the dates of interest span the time of 13-nov-92 16:50 UT, then 
  separate calls must be made for data before and after this date.

 MODIFICATION HISTORY:
   5-jul-93, J. R. Lemen, Written.
  21-jul-93, JRL Modified to allow date to come in in external format
  22-dec-93, JRL, Fixed an IDL V3.1 related bug
  25-jan-94, JRL, Call get_yo_dates to get date/value of entrance filter
  31-aug-94, JRL, Make sure sre data base has equally spaced temperatures
		   Use interp1d to do linear interpolation.
  14-mar-96, JRL, Include Loren Acton's header modifications.
  31-jul-97, JRL, Added file_db keyword
  15-nov-2004, S.L.Freeland - isolate sxt_teem common block in own routine


sxt_flux [2] $SSW/yohkoh/sxt/idl/atest/sxt_flux.pro
[Previous] [Next]
 NAME:
  sxt_flux
 PURPOSE:
  Specify Te + filter + EM ==> compute DN or photon flux.
  Specify Te + filter + DN ==> compute EM

 CALLING SEQUENCE:
  Flux = sxt_flux(Te,filter_number)   ; DN/s for log10(EM) = 44
  Flux = sxt_flux(Te,index)           ; DN/get_expdur(index) for gt_filtb(index)
  Flux = sxt_flux(Te,index,/photons)  ; Photon/get_expdur(index) 
  EM   = sxt_flux(Te,index,DN=DN)     ; Supply DN and return Emission measure

 INPUTS:
  Te           = log10(Temp) (May be a vector: min = 5.5, max = 8.0)
  filter_number= Filter B value (range is 1 to 6) or SXT index structure.
 CALLED BY:
	BONEHEAD_MASS_ESTIMATE, HYDRO_ CORONA, PINCH_PLASMA, SXT_IMAGE_DECONVOLVE
	WITH_INT, WITH_INT_DISK, dem_tr_er, dem_tr_er0, lineofsight [1], lineofsight [2]
	lwa_dn_unc modified from sxt_dn_uncpro, mc_unc, sxl2radiance, sxt_dn_unc
	sxt_erg_per_dn, sxt_f2_to_f3, sxt_multi_teem, sxt_sig_per_dn_lwa, uncdn
                 Note:  If FILTER_NUMBER is an SXT index structure, then this 
                 will be used for Filter B, t1 (unless overridden with T1=T1) 
                 and date (unless overridden with DATE=DATE or 
                 FRAC_OPEN=FRAC_OPEN keywords).

  Either Te or filter_number may be vectors.  However, if both are vectors
  then their lengths must be the same.  In this case each element of the
  output vector, Flux(i), of SXT_FLUX will computed for Te(i) and
  filter_number(i).

 OUTPUTS:
   This function returns DN or Photon fluxes.
   If DN=DN keyword is set, will return Emission Measures.

 OPTIONAL INPUT KEYWORDS:
  em		= log10(Emission measure).  Default=44 (implies ==> 10^44 cm-3)
  DN		= SXT DN counts.  If specified, sxt_flux returns the log10(EM) 
		  instead of flux and the /photon and EM= keywords are ignored.
  t1		= Exposure time in msec (default = 1000 msec).  
		  Overrides exposure time specified by FILTER (index).
  date		= Time in any format (including structure). Used to
		  determine entrance filter transmission. 
		  Overrides date specified by FILTER (index).
  frac_open	= Fraction of open entrance filter.  0 = launch, 1 = no filter.
		  Overrides DATE and FILTER values.
  gain_ccd	= camera gain in e-/Dn.    (Default is 100).
  photons	= If set, return  photon flux (rather than DN).
  noverbose	= If set, suppress some of the informational messages
  file_db	= If provided, read the line spectral data from the specified
                 file instead of the default Mewe file.

 OPTIONAL OUTPUT KEYWORDS:
  version	= version number of SXT electron vs Te data base file

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DOC_LIBRARY, DSPLINE, STDEV, UNIQ [1], UNIQ [2], UNIQ [3]
	anytim2ints [1], anytim2ints [2], break_file [4], concat_dir [4], fastdoc [1]
	fastdoc [2], fmt_tim [1], fmt_tim [2], get_yo_dates [1], get_yo_dates [2]
	get_yo_dates [3], gt_expdur [1], gt_expdur [2], gt_filtb, interp1d [1]
	interp1d [2], interp1d [3], restgen [1], restgen [2], tbeep [1], tbeep [2]
	tbeep [3]
 RESTRICTIONS:
  DATE or FRAC_OPEN (if specified) must be length 1.  If the date is
  obtained from FILTER (= SXT index), the first time in the structure
  will be used to determine the entrance filter fraction.

  If the dates of interest span the time of 13-nov-92 16:50 UT, then 
  separate calls must be made for data before and after this date.

 MODIFICATION HISTORY:
   5-jul-93, J. R. Lemen, Written.
  21-jul-93, JRL Modified to allow date to come in in external format
  22-dec-93, JRL, Fixed an IDL V3.1 related bug
  25-jan-94, JRL, Call get_yo_dates to get date/value of entrance filter
  31-aug-94, JRL, Make sure sre data base has equally spaced temperatures
		   Use interp1d to do linear interpolation.
  14-mar-96, JRL, Include Loren Acton's header modifications.
  31-jul-97, JRL, Added file_db keyword


sxt_flux [3] $SSW/yohkoh/sxt/idl/sensitivity/sxt_flux.pro
[Previous] [Next]
 NAME:
  sxt_flux
 PURPOSE:
  Specify Te + filter + EM ==> compute DN or photon flux.
  Specify Te + filter + DN ==> compute EM

 CALLING SEQUENCE:
  Flux = sxt_flux(Te,filter_number)   ; DN/s for log10(EM) = 44
  Flux = sxt_flux(Te,index)           ; DN/get_expdur(index) for gt_filtb(index)
  Flux = sxt_flux(Te,index,/photons)  ; Photon/get_expdur(index) 
  EM   = sxt_flux(Te,index,DN=DN)     ; Supply DN and return Emission measure

 INPUTS:
  Te           = log10(Temp) (May be a vector: min = 5.5, max = 8.0)
  filter_number= Filter B value (range is 1 to 6) or SXT index structure.
 CALLED BY:
	BONEHEAD_MASS_ESTIMATE, HYDRO_ CORONA, PINCH_PLASMA, SXT_IMAGE_DECONVOLVE
	WITH_INT, WITH_INT_DISK, dem_tr_er, dem_tr_er0, lineofsight [1], lineofsight [2]
	lwa_dn_unc modified from sxt_dn_uncpro, mc_unc, sxl2radiance, sxt_dn_unc
	sxt_erg_per_dn, sxt_f2_to_f3, sxt_multi_teem, sxt_sig_per_dn_lwa, uncdn
                 Note:  If FILTER_NUMBER is an SXT index structure, then this 
                 will be used for Filter B, t1 (unless overridden with T1=T1) 
                 and date (unless overridden with DATE=DATE or 
                 FRAC_OPEN=FRAC_OPEN keywords).

  Either Te or filter_number may be vectors.  However, if both are vectors
  then their lengths must be the same.  In this case each element of the
  output vector, Flux(i), of SXT_FLUX will computed for Te(i) and
  filter_number(i).

 OUTPUTS:
   This function returns DN or Photon fluxes.
   If DN=DN keyword is set, will return Emission Measures.

 OPTIONAL INPUT KEYWORDS:
  em		= log10(Emission measure).  Default=44 (implies ==> 10^44 cm-3)
  DN		= SXT DN counts.  If specified, sxt_flux returns the log10(EM) 
		  instead of flux and the /photon and EM= keywords are ignored.
  t1		= Exposure time in msec (default = 1000 msec).  
		  Overrides exposure time specified by FILTER (index).
  date		= Time in any format (including structure). Used to
		  determine entrance filter transmission. 
		  Overrides date specified by FILTER (index).
  frac_open	= Fraction of open entrance filter.  0 = launch, 1 = no filter.
		  Overrides DATE and FILTER values.
  gain_ccd	= camera gain in e-/Dn.    (Default is 100).
  photons	= If set, return  photon flux (rather than DN).
  noverbose	= If set, suppress some of the informational messages

 OPTIONAL OUTPUT KEYWORDS:
  version	= version number of SXT electron vs Te data base file

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DOC_LIBRARY, DSPLINE, STDEV, UNIQ [1], UNIQ [2], UNIQ [3]
	anytim2ints [1], anytim2ints [2], break_file [4], concat_dir [4], fastdoc [1]
	fastdoc [2], fmt_tim [1], fmt_tim [2], get_yo_dates [1], get_yo_dates [2]
	get_yo_dates [3], gt_expdur [1], gt_expdur [2], gt_filtb, interp1d [1]
	interp1d [2], interp1d [3], restgen [1], restgen [2], tbeep [1], tbeep [2]
	tbeep [3]
 RESTRICTIONS:
  DATE or FRAC_OPEN (if specified) must be length 1.  If the date is
  obtained from FILTER (= SXT index), the first time in the structure
  will be used to determine the entrance filter fraction.

  If the dates of interest span the time of 13-nov-92 16:50 UT, then 
  separate calls must be made for data before and after this date.

 MODIFICATION HISTORY:
   5-jul-93, J. R. Lemen, Written.
  21-jul-93, JRL Modified to allow date to come in in external format
  22-dec-93, JRL, Fixed an IDL V3.1 related bug
  25-jan-94, JRL, Call get_yo_dates to get date/value of entrance filter
  31-aug-94, JRL, Make sure sre data base has equally spaced temperatures
		   Use interp1d to do linear interpolation.
  14-mar-96, JRL, Include Loren Acton's header modifications.


SXT_FOV_CENTER $SSW/yohkoh/ucon/idl/metcalf/sxt_fov_center.pro
[Previous] [Next]
 NAME:
	SXT_FOV_CENTER
 PURPOSE:
	Give coordinates for SXT field-of-view center
 CALLING SEQUENCE:
	sxt_fov_center,index,sun_center,ww,nn
	  Input:  index(*) = reformatter index file
                 sun_center = fltarr(2,*) in full resolution SXT pixels
                              The first dimension is the x,y sun center pos.
	  Output: ww(*) is the location W of sun center, full res SXT pixels
	          nn(*) is the location N of sun center, full res SXT pixels
 METHOD:
 CALLED BY:
	ALIGN_AR, PFI_CENT, PFI_CENTER
 HISTORY:
	H. Hudson, G. Slater, Feb. 17, 1992.
       Copied from HXA_SXT by T. Metcalf  May 5, 1992
          Now uses get_pix_coor.pro to compute column positions
 CALLS: ***
	get_pix_coor, gt_corner_cmd, gt_res
 EXAMPLE:
       sxt_fov_center,index,get_suncenter(index=index),ww,nn
 WARNINGS:
   	Accuracy depends on the accuracy of sun_center


sxt_fsp $SSW/yohkoh/ucon/idl/mctiernan/sxt_fsp.pro
[Previous] [Next]
 NAME:
	sxt_fsp
 PURPOSE:
	To fit spectra for sxt, spectrometer style, using any_fsp.pro,
 CALLING SEQUENCE:
	sxt_fsp,index,data,fit_pars,sc_par,ch_dta,tyspec=tyspec,outfile=outfile,$
                  pfile=pfile,countfile=countfile,filt_no=filt_no, noplot=noplot, $
                  use_filters=use_filters,sindex=sindex,sdata=sdata,$
                  sys_err=sys_err,init_a=init_a, time_range=time_range, all=all
 INPUT:
	index= info. structure for SXT data from test_rd
       data= data, ALigned and uncompressed, byte type data will be SXT_PREPPED
 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= 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:
       tyspec= type of spectrum, the default is to prompt the user
	outfile= the output file, a keyword
	pfile= a file for spectral plots
       countfile= a file name for the accumulated counts which can 
                  be used as input to fsp_proc.pro, no fit is done
                  if you set this keyword.
       filt_no= filter no. to choose the time interval, if not set, the
                routine will prompt you.
       tim_array = a time array, for plotting purposes
       use_filters = an array of filter numbers, 2 is al.1, 3 is AlMG,
                     4 is Be119, 5 is Al12, 6 is Mg3, the default is
                     to use [2, 4, 5]. Be careful, SXT_INTERP is used,
                     so that if you tell it a filter that isn't used
                     near the time interval that you have, you may
                     get nonsense... This has been taken care of, jmm, 11-4-95
       sindex, sdata= prepped index and data, so you need not do this every time
       sys_err= a 'systematic error', pass in if you don't trust the
                errors you get from counting stats, or to arbitrarily
                push down chi^2 values, The default iz 0.0.
                This makes the error in the rate = sqrt(cps/dt)+sys_err*cps.
       init_a= initial values of fit parameters
       time_range = a time range, all of the points in this range are used
       All= if set, use all of the points...
       noplot= if set, no screen plot
 CALLS: ***
	any_fsp, anyrts, choose_interval, dude, gt_expdur [1], gt_expdur [2], gt_filtb
	int2secarr [1], int2secarr [2], strip_data, sxt_interp [1], sxt_interp [2]
	sxt_prep [1], sxt_prep [2], sxt_prep [3]
 CALLED BY:
	sxtth_hxt
 HISTORY:
	Written Mar, '93 by J.McTiernan
       changed to use of lcur_image 03-nov-93 (jmm)
       Added s_bck keyword, 7-apr-94, JMM
       All sorts of stuff, 12-may-95, jmm, added the ability to use prepped
           data, so the old way of using the loop variables will not work
           anymore, this is replaced by the USE_FILTERS keyword, to avoid
           weird extrapolations.
       sxt_fsp.pro is now just sxtbox_fsp, with the whole image as the box
       Added sys_err keyword, 24-jun-95, jmm
       New output formats, 28-jul-95, jmm
       Added init_a keyword, 27-oct-95, jmm
       Added time_range and all keywords, uses CHOOSE_INTERVAL for the
       time interval, 2-nov-95, jmm
       Added a check to see if the interval times are in between
       the start and end times for each filter, 4-nov-95, jmm


sxt_fsp_resp $SSW/yohkoh/ucon/idl/mctiernan/sxt_fsp_resp.pro
[Previous] [Next]
 NAME:
	sxt_fsp_resp
 PURPOSE:
       inputs filter response and outputs it into a file
       which can be used by fsp_*.pro.
 CALLING SEQUENCE:
       sxt_fsp_resp
 INPUT:
       reads the latest sxt response file $DIR_SXT_SENSITIVE/sra*
 OUTPUT:
       outputs the response files /ys/ucon/soft/mctiernan/sxt_fsp_resp_0.dta
       and /ys/ucon/soft/mctiernan/sxt_fsp_resp_1.dta
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], INTERPU_1D, concat_dir [4]
	restgen [1], restgen [2]
 HISTORY:
       Mar 7-8, '93
       Changed to interpret wavelengths as bin edges, and added
       the second file for dates after 1-nov-92, jmm 30-jul-94
       4-Dec-95, jmm, altered to deal with degenerate wavelength bins


sxt_get_grill [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_get_grill.pro
[Previous] [Next]
   Name: sxt_get_grill

   Purpose: return entrance-era dependent Al.1 Grill file

   Input Parameters:
      index - sxt index record (usually an SFC index)

   Output Paramters:
      status - return status  1=ok
                              0=found one but not in correct era
                             -1=problem (index not Al.1 for example)
   Keyword Parameters:
      no_normal - if set, do not normalize
      geny - if set, use final set (*geny extension)
             APODIZED, lwa email circa 28-May-2003
             (normalized to 1 second)
 CALLS: ***
	BOX_MESSAGE, FILE2TIME, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MORE [1], MORE [2]
	REVERSE, get_info [1], get_info [2], get_info [3], get_info [4], get_yo_dates [1]
	get_yo_dates [2], get_yo_dates [3], gt_expdur [1], gt_expdur [2], gt_filta
	gt_filtb, required_tags, ssw_strsplit, ssw_time_compare
 CALLED BY:
	leak_sub [1], leak_sub [2], leak_sub [3]
   History:
      8-Jan-2000 - S.L.Freeland - break code from sfc_prep 
                                  (since now may be applied to synthetic SFC)
      2-jun-2003 - S.L.Freeland - add /GENY keyword and function
     24-jul-2003 - S.L.Freeland - default return to fltarr(512,512)=0.
                                  don't print warning if non Al.1 input
                                  Use loc_file instead of file_list
                                  (intermittent problems with curdir?)


sxt_get_grill [2] $SSW/yohkoh/sxt/idl/atest/sxt_get_grill.pro
[Previous] [Next]
   Name: sxt_get_grill

   Purpose: return entrance-era dependent Al.1 Grill file

   Input Parameters:
      index - sxt index record (usually an SFC index)

   Output Paramters:
      status - return status  1=ok
                              0=found one but not in correct era
                             -1=problem (index not Al.1 for example)
   Keyword Parameters:
      no_normal - if set, do not normalize
      geny - if set, use final set (*geny extension)
             APODIZED, lwa email circa 28-May-2003
             (normalized to 1 second)
 CALLS: ***
	BOX_MESSAGE, FILE2TIME, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MORE [1], MORE [2]
	REVERSE, get_info [1], get_info [2], get_info [3], get_info [4], get_yo_dates [1]
	get_yo_dates [2], get_yo_dates [3], gt_expdur [1], gt_expdur [2], gt_filta
	gt_filtb, required_tags, ssw_strsplit, ssw_time_compare
 CALLED BY:
	leak_sub [1], leak_sub [2], leak_sub [3]
   History:
      8-Jan-2000 - S.L.Freeland - break code from sfc_prep 
                                  (since now may be applied to synthetic SFC)
      2-jun-2003 - S.L.Freeland - add /GENY keyword and function
     24-jul-2003 - S.L.Freeland - default return to fltarr(512,512)=0.
                                  don't print warning if non Al.1 input
                                  Use loc_file instead of file_list
                                  (intermittent problems with curdir?)


Sxt_goes_teem $SSW/yohkoh/ucon/idl/mctiernan/sxt_goes_teem.pro
[Previous] [Next]
NAME:
 Sxt_goes_teem
PURPOSE:
 Takes the teem_* file resulting from SXT_TFL.pro, finds the
 GOES data file for that flare, and generates the GOES temperature
 and Emission Measure.
CALLING SEQUENCE:
 sxt_goes_teem, sxt_teem_file, goes_teem_file, goes_data_in=goes_data_in, $
                goes_data_out=goes_data_out, dt_pre=dt_pre, dt_post=dt_post, $
                quiet=quiet, auto_bck=auto_bck, use_goes_bck=use_goes_bck, $
                pfile=pfile, schwartz=schwartz, auto_tim=auto_tim, nbcks=nbcks, $
                dt_resolution=dt_resolution, interactive=interactive, xxx=xxx, $
                goes_bck_time=goes_bck_time, goes_bck_dt=goes_bck_dt, $
                goes_st_times=goes_st_times, goes_int_times=goes_int_times,$
                goes7=goes7
INPUT:
 sxt_teem_file= the name of the input file
 goes_teem_file= the name of the output file
KEYWORDS:
 goes_data_in = GOES data, if this is passed in, the it does not need
                to be read in
 goes_data_out = GOES data, passed out
 dt_pre= the time before the SXT observations to include the GOES data,
         in minutes, the default is 30 minutes.
 dt_post= the time after the SXT observations to include the GOES data,
         in minutes, the default is 60 minutes.
 quiet= if set, work quietly
 auto_bck= Use AUTO_BCK_FIND to choose the preflare background level
 use_goes_bck= use GOES_BCK to get the true 'background'
 pfile= a file for plots, if you want hardcopies
 schwartz= if set, use RAS_GOES_TEM to get the temperature and EM,
           this interpolates on the ratio vs. temperature curve,
           and should be more robust.
       auto_tim= if set, the flare interval is obtained automatically
       FOR AUTOMATIC TIME SELECTION:
       nbcks = if set, the number of background levels above the
               background that the data within trange must be, 
               i.e., data - bck > nbcks*bck, the default is 1.0, 
               if not set. If both nbcks and nbsigmas are set,
               nbcks gets used.
       dt_resolution= The number of 3 second intervals per fit interval
                      If set to -1, use the whole interval.
 interactive= if set, the time interval for the GOES flare is chosen
              by the user from the GOES data between dt_pre and dt_post
 goes_bck_time= background st. time for GOES
 goes_bck_dt= background interval time for GOES
 goes_st_times= start times for GOES
 goes_int_times= interval times for goes
 goes7= if set use GOES-7 not GOES-6
 CALLS: ***
	ADDTIME [1], ADDTIME [2], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], LOADCT
	OUTPLOT [1], OUTPLOT [2], OUTPLOT [3], READ_GOES_FITS, UTPLOT [1], UTPLOT [2]
	UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6], YOU_REALLY_WANT_A_TBEEP
	anytim2ints [1], anytim2ints [2], choose_interval, delvarx [5], fmt_tim [1]
	fmt_tim [2], goes_teem, sel_timrange [1], sel_timrange [2], time_2_fileid
HISTORY:
 2-sep-95, jmm
 wow, added interactive keyword, 13-oct-95, jmjm
 Changed around to call GOES_TEEM, 12-feb-96, jmm


SXT_GRID [1] $SSW/yohkoh/sxt/idl/atest/sxt_grid.pro
[Previous] [Next]
 NAME:
       SXT_GRID
 CALLED BY:
	FAXABLE_SFD, LATEST_SFDS_GIF, STEPPER [3], STEPPER [4], ar_prep, gbo_obs_coord
	hxt_images2ps, lastspd, plot_ar_pfi, plot_nar [1], plot_nar [2], sxt_obs_coord [1]
	sxt_obs_coord [2], xsxt_prep_event
 EXAMPLES:
	SXT_GRID, INDEX(0)	; Draw a grid based on info from INDEX(0).
	SXT_GRID, INDEX(7), /NOGRID, LATLON=TRANSPOSE([[32,-13],[-70,17]])
				; Draw circles around points at heliographic
				  coordinates (32N,70E) and (13S,17W).
	SXT_GRID, INDEX(13), /NOGRID, /READ_OUT
				; Give continuous display of cursor
				; position in heliographic coordinates.
 PURPOSE:
	Overlay a Stonyhurst (heliographic) coordinate grid on an SXT
	full frame or partial frame image.
 CATEGORY:
	Image display.
 CALLING SEQUENCE:
	SXT_GRID,INDEX [,DATA,MAG=MAG,IMG_POS=IMG_POS,GRIDSEP=GRIDSEP, $
	RES=RES,NOERASE=NOERASE,CENTER=CENTER,GET_CENTER=GET_CENTER, $
	LATLON=LATLON,REFIT=REFIT , LAST_LATLON=LAST_LATLON
 REQUIRED INPUTS:
	INDEX	- SXT index record.
 OPTIONAL INPUTS:
   POSITIONAL PARAMETERS:
	DATA	- SXT image array (required for limb fit).
   KEYWORDS PARAMETERS:
	MAG =	     Magnification factor of image displayed over original
		     SXT image (def = 1)
	IMG_POS =    Position of lower left corner of image within display
		     window (def = [0,0])
	GRIDSEP =    Major latitude and longitude grid separation interval
		     in degrees (def = 15).
	MGRIDSEP =   Minor latitude and longitude grid separation interval
		     in degrees (def = 5). - NOTE: NOT YET IMPLEMENTED.
	NOERASE =    Determines whether window is erased prior to drawing
		     grid (def = 1 (no)).
	GET_CENTER = Forces limb fit determination of pointing even when
		     pointing data is available (def = 0).
	LATLON	   = [2,n] array of latitude and longitude coordinates
		     in degrees.  Circles will be drawn on the image at
		     these coordinates.
	SYMSIZE    = Symbol size (arbitrary) of LATLON circles (def=1).
	REFIT	     If present and non-zero, the refit option of GET_XYRAD
		     will be used.
	READ_OUT     If present and non-zero, the heliographic coordinates
		     of the cursor will be written to a window-let.
	FUDGE	     If present and non-zero, a standard fudge offset
		     will be included in the horizontal axis.
	XFUDGE	   = Horizontal fudge offset in displayed image pixels
		     (not necessarily full res pixels).
	YFUDGE	   = Vertical fudge offset in displayed image pixels
		     (not necessarily full res pixels).
	REDISP	     If present and non-zero and if DATA array supplied,
		     then the image is redisplayed before grid is drawn.
	NOGRID	     If present and non-zero, grid is not drawn.
	DRAW_LIMB    If present and non-zero, limb is drawn.
	DRAW_EQ	     If present and non-zero, equator is drawn.
	ANGLE	     If set, display the READ_OUT value in arcseconds
		     from sun center.
	TV2	     If set, does scaling for PS plotting
 OUTPUTS:
   POSITIONAL PARAMETERS:
	none.
   KEYWORDS PARAMETERS:
	CENTER	   = xy coordinates of center of image relative to center
		     of sun in fractions of the solar radius (I know, kinda
		     stupid).
	LAST_LATLON = last output [during /READ_OUT mode]
			[e/w, n/s] with east and south negative.
 CALLS: ***
	C2S, DRAW_GRID [1], DRAW_GRID [2], DRAW_GRID [3], WDEF [1], WDEF [2], get_rb0p [1]
	get_rb0p [2], get_xyrad, gt_corner, gt_pix_size, gt_res, gt_shape, restsys [1]
	restsys [2], savesys [1], savesys [2], sxt_cen [1], sxt_cen [2]
 COMMON BLOCKS:
	None.
 SIDE EFFECTS:
	None that I'm aware of.
 RESTRICTIONS:
	/READ_OUT mode does not work in PostScript mode.
	/REDISP   is not recommended in PostScript mode.
 PROCEDURE:
	Uses PNT data files when available.  Otherwise or on demand it
	calls JRL's GET_XYRAD to fit the limb.
 MODIFICATION HISTORY:
       October, 1992. - Written by GLS, LMSC.
	12-May-1993 (SLF) - use wdef for new window in /read_out code
			    (to avoid problem when existing window# > 32)
	 7-Jul-1993 (GLS) - Added calls to SLF's SAVESYS and RESTSYS
		to reset system variables
	 5-Aug-1993 (MDM) - Added a call to GT_CORNER so it will work
			    with history records
	 6-Aug-1993 (???) - Added DRAW_GRID keyword option
	 9-Aug-1993 (MDM) - Added ROLL keyword option
	18-Aug-1993 (SLF) - Added LAST_LATLON keyword (output)
	 7-Oct-1993 (MDM) - Correction to it would work with HR and QR PFI
			  - Modified to use SXT_CEN instead of GET_SUNCENTER
			    The modification made PDATA not valid as input
			    or output
	14-Oct-1993 (MDM) - Modified to use GT_SHAPE
	 1-Dec-1993 (MDM) - Added /ANGLE option for READ_OUT
	10-Dec-1993 (MDM) - Reversed the convention of the LAST_LATLON
			    value.
	23-Feb-1995 (RDB) - Added TV2 keyword and stuff associated with PS
                           plotted (see also ocontour, etc.)
	26-Jan-1996 (JRL) - Added draw_grid_blk common.  Added symsize. Fixed
			    /redisp option when img_pos is non-zero. 
	 7-Feb-1996 (GLS) - Added draw_eq keyword.
	25-Feb-1999 (GLS) - Reversed sign of roll from get_roll.


SXT_GRID [2] $SSW/yohkoh/sxt/idl/util/sxt_grid.pro
[Previous] [Next]
 NAME:
       SXT_GRID
 CALLED BY:
	FAXABLE_SFD, LATEST_SFDS_GIF, STEPPER [3], STEPPER [4], ar_prep, gbo_obs_coord
	hxt_images2ps, lastspd, plot_ar_pfi, plot_nar [1], plot_nar [2], sxt_obs_coord [1]
	sxt_obs_coord [2], xsxt_prep_event
 EXAMPLES:
	SXT_GRID, INDEX(0)	; Draw a grid based on info from INDEX(0).
	SXT_GRID, INDEX(7), /NOGRID, LATLON=TRANSPOSE([[32,-13],[-70,17]])
				; Draw circles around points at heliographic
				  coordinates (32N,70E) and (13S,17W).
	SXT_GRID, INDEX(13), /NOGRID, /READ_OUT
				; Give continuous display of cursor
				; position in heliographic coordinates.
 PURPOSE:
	Overlay a Stonyhurst (heliographic) coordinate grid on an SXT
	full frame or partial frame image.
 CATEGORY:
	Image display.
 CALLING SEQUENCE:
	SXT_GRID,INDEX [,DATA,MAG=MAG,IMG_POS=IMG_POS,GRIDSEP=GRIDSEP, $
	RES=RES,NOERASE=NOERASE,CENTER=CENTER,GET_CENTER=GET_CENTER, $
	LATLON=LATLON,REFIT=REFIT , LAST_LATLON=LAST_LATLON
 REQUIRED INPUTS:
	INDEX	- SXT index record.
 OPTIONAL INPUTS:
   POSITIONAL PARAMETERS:
	DATA	- SXT image array (required for limb fit).
   KEYWORDS PARAMETERS:
	MAG =	     Magnification factor of image displayed over original
		     SXT image (def = 1)
	IMG_POS =    Position of lower left corner of image within display
		     window (def = [0,0])
	GRIDSEP =    Major latitude and longitude grid separation interval
		     in degrees (def = 15).
	MGRIDSEP =   Minor latitude and longitude grid separation interval
		     in degrees (def = 5). - NOTE: NOT YET IMPLEMENTED.
	NOERASE =    Determines whether window is erased prior to drawing
		     grid (def = 1 (no)).
	GET_CENTER = Forces limb fit determination of pointing even when
		     pointing data is available (def = 0).
	LATLON	   = [2,n] array of latitude and longitude coordinates
		     in degrees.  Circles will be drawn on the image at
		     these coordinates.
	SYMSIZE    = Symbol size (arbitrary) of LATLON circles (def=1).
	REFIT	     If present and non-zero, the refit option of GET_XYRAD
		     will be used.
	READ_OUT     If present and non-zero, the heliographic coordinates
		     of the cursor will be written to a window-let.
	FUDGE	     If present and non-zero, a standard fudge offset
		     will be included in the horizontal axis.
	XFUDGE	   = Horizontal fudge offset in displayed image pixels
		     (not necessarily full res pixels).
	YFUDGE	   = Vertical fudge offset in displayed image pixels
		     (not necessarily full res pixels).
	REDISP	     If present and non-zero and if DATA array supplied,
		     then the image is redisplayed before grid is drawn.
	NOGRID	     If present and non-zero, grid is not drawn.
	DRAW_LIMB    If present and non-zero, limb is drawn.
	DRAW_EQ	     If present and non-zero, equator is drawn.
	ANGLE	     If set, display the READ_OUT value in arcseconds
		     from sun center.
	TV2	     If set, does scaling for PS plotting
 OUTPUTS:
   POSITIONAL PARAMETERS:
	none.
   KEYWORDS PARAMETERS:
	CENTER	   = xy coordinates of center of image relative to center
		     of sun in fractions of the solar radius (I know, kinda
		     stupid).
	LAST_LATLON = last output [during /READ_OUT mode]
			[e/w, n/s] with east and south negative.
 CALLS: ***
	C2S, DRAW_GRID [1], DRAW_GRID [2], DRAW_GRID [3], WDEF [1], WDEF [2], get_rb0p [1]
	get_rb0p [2], get_xyrad, gt_corner, gt_pix_size, gt_res, gt_shape, restsys [1]
	restsys [2], savesys [1], savesys [2], sxt_cen [1], sxt_cen [2]
 COMMON BLOCKS:
	None.
 SIDE EFFECTS:
	None that I'm aware of.
 RESTRICTIONS:
	/READ_OUT mode does not work in PostScript mode.
	/REDISP   is not recommended in PostScript mode.
 PROCEDURE:
	Uses PNT data files when available.  Otherwise or on demand it
	calls JRL's GET_XYRAD to fit the limb.
 MODIFICATION HISTORY:
       October, 1992. - Written by GLS, LMSC.
	12-May-1993 (SLF) - use wdef for new window in /read_out code
			    (to avoid problem when existing window# > 32)
	 7-Jul-1993 (GLS) - Added calls to SLF's SAVESYS and RESTSYS
		to reset system variables
	 5-Aug-1993 (MDM) - Added a call to GT_CORNER so it will work
			    with history records
	 6-Aug-1993 (???) - Added DRAW_GRID keyword option
	 9-Aug-1993 (MDM) - Added ROLL keyword option
	18-Aug-1993 (SLF) - Added LAST_LATLON keyword (output)
	 7-Oct-1993 (MDM) - Correction to it would work with HR and QR PFI
			  - Modified to use SXT_CEN instead of GET_SUNCENTER
			    The modification made PDATA not valid as input
			    or output
	14-Oct-1993 (MDM) - Modified to use GT_SHAPE
	 1-Dec-1993 (MDM) - Added /ANGLE option for READ_OUT
	10-Dec-1993 (MDM) - Reversed the convention of the LAST_LATLON
			    value.
	23-Feb-1995 (RDB) - Added TV2 keyword and stuff associated with PS
                           plotted (see also ocontour, etc.)
	26-Jan-1996 (JRL) - Added draw_grid_blk common.  Added symsize. Fixed
			    /redisp option when img_pos is non-zero. 
	 7-Feb-1996 (GLS) - Added draw_eq keyword.


SXT_GRID [3] $SSW/yohkoh/ucon/idl/slater/sxt_grid_2.pro
[Previous] [Next]
 NAME:
       SXT_GRID
 CALLED BY:
	FAXABLE_SFD, LATEST_SFDS_GIF, STEPPER [3], STEPPER [4], ar_prep, gbo_obs_coord
	hxt_images2ps, lastspd, plot_ar_pfi, plot_nar [1], plot_nar [2], sxt_obs_coord [1]
	sxt_obs_coord [2], xsxt_prep_event
 EXAMPLES:
	SXT_GRID, INDEX(0)	; Draw a grid based on info from INDEX(0).
	SXT_GRID, INDEX(7), /NOGRID, LATLON=TRANSPOSE([[32,-13],[-70,17]])
				; Draw circles around points at heliographic
				  coordinates (32N,70E) and (13S,17W).
	SXT_GRID, INDEX(13), /NOGRID, /READ_OUT
				; Give continuous display of cursor
				; position in heliographic coordinates.
 PURPOSE:
	Overlay a Stonyhurst (heliographic) coordinate grid on an SXT
	full frame or partial frame image.
 CATEGORY:
	Image display.
 CALLING SEQUENCE:
	SXT_GRID,INDEX [,DATA,MAG=MAG,IMG_POS=IMG_POS,GRIDSEP=GRIDSEP, $
	RES=RES,NOERASE=NOERASE,CENTER=CENTER,GET_CENTER=GET_CENTER, $
	LATLON=LATLON,REFIT=REFIT , LAST_LATLON=LAST_LATLON
 REQUIRED INPUTS:
	INDEX	- SXT index record.
 OPTIONAL INPUTS:
   POSITIONAL PARAMETERS:
	DATA	- SXT image array (required for limb fit).
   KEYWORDS PARAMETERS:
	MAG =	     Magnification factor of image displayed over original
		     SXT image (def = 1)
	IMG_POS =    Position of lower left corner of image within display
		     window (def = [0,0])
	GRID_SEP =   Major latitude and longitude grid separation interval
		     in degrees (def = 15).
	MGRID_SEP =  Minor latitude and longitude grid separation interval
		     in degrees (def = 5). - NOTE: NOT YET IMPLEMENTED.
	NOERASE =    Determines whether window is erased prior to drawing
		     grid (def = 1 (no)).
	GET_CENTER = Forces limb fit determination of pointing even when
		     pointing data is available (def = 0).
	LATLON	   = [2,n] array of latitude and longitude coordinates
		     in degrees.  Circles will be drawn on the image at
		     these coordinates.
	REFIT	     If present and non-zero, the refit option of GET_XYRAD
		     will be used.
	READ_OUT     If present and non-zero, the heliographic coordinates
		     of the cursor will be written to a window-let.
	FUDGE	     If present and non-zero, a standard fudge offset
		     will be included in the horizontal axis.
	XFUDGE	   = Horizontal fudge offset in displayed image pixels
		     (not necessarily full res pixels).
	YFUDGE	   = Vertical fudge offset in displayed image pixels
		     (not necessarily full res pixels).
	REDISP	     If present and non-zero and if DATA array supplied,
		     then the image is redisplayed before grid is drawn.
	NOGRID	     If present and non-zero, grid is not drawn.
	DRAW_LIMB    If present and non-zero, limb is drawn.
	ANGLE	     If set, display the READ_OUT value in arcseconds
		     from sun center.
 OUTPUTS:
   POSITIONAL PARAMETERS:
	none.
   KEYWORDS PARAMETERS:
	CENTER	   = xy coordinates of center of image relative to center
		     of sun in fractions of the solar radius (I know, kinda
		     stupid).
	LAST_LATLON = last output [during /READ_OUT mode]
			[e/w, n/s] with east and south negative.
 CALLS: ***
	C2S, DRAW_GRID_2, MAKVEC, SXT_GRID_2, TIM2CLON, WDEF [1], WDEF [2], get_rb0p [1]
	get_rb0p [2], get_xyrad, gt_corner, gt_res, gt_shape, restsys [1], restsys [2]
	savesys [1], savesys [2], sxt_cen [1], sxt_cen [2]
 COMMON BLOCKS:
	None.
 SIDE EFFECTS:
	None that I'm aware of.
 RESTRICTIONS:
	None.
 PROCEDURE:
	Uses PNT data files when available.  Otherwise or on demand it
	calls JRL's GET_XYRAD to fit the limb.
 MODIFICATION HISTORY:
       October, 1992. - Written by GLS, LMSC.
	12-May-1993 (SLF) - use wdef for new window in /read_out code
			    (to avoid problem when existing window# > 32)
	 7-Jul-1993 (GLS) - Added calls to SLF's SAVESYS and RESTSYS
		to reset system variables
	 5-Aug-1993 (MDM) - Added a call to GT_CORNER so it will work
			    with history records
	 6-Aug-1993 (???) - Added DRAW_GRID keyword option
	 9-Aug-1993 (MDM) - Added ROLL keyword option
	18-Aug-1993 (SLF) - Added LAST_LATLON keyword (output)
	 7-Oct-1993 (MDM) - Correction to it would work with HR and QR PFI
			  - Modified to use SXT_CEN instead of GET_SUNCENTER
			    The modification made PDATA not valid as input
			    or output
	14-Oct-1993 (MDM) - Modified to use GT_SHAPE
	 1-Dec-1993 (MDM) - Added /ANGLE option for READ_OUT
	10-Dec-1993 (MDM) - Reversed the convention of the LAST_LATLON
			    value.
	20-Jan-1994 (GAL) - Added a check for when the carr long is over 360 degrees
				and correction if so.


sxt_his2dbase $SSW/yohkoh/sxt/idl/atest/sxt_his2dbase.pro
[Previous] [Next]
   Name: sxt_his2dbase

   Purpose: use SXT history record to reference/return dbase "index [,data]"

   Input Parameters:
      indexin - index record(s), assumed to contain .HIS field

   Output Parameters:
     index_dbase - dbase index used in correction (.HIS->dbase mapping)
     data_dbase  - optional, the data array corresponding to index_dbase

   Keyword Parameters:
      LEAK (switch) - if set, output is from SFC dbase [DEFAULT]
      DARK (switch) - if set, output is from SDC dbase
      SHORT (switch) - if set, output is SHORT exposure DARK
      LONG (switch)  - if set, output is LONG exposure DARK
      filelist (output) - list of dbase files implied
      ss (output) - SS vector corresponding to dbase filelist

   Calling Sequence:
      IDL> sxt_his2dbase, index, dbindex [,dbdata] [,/leak] [,/dark] [,/short]  

   Calling Examples:
                            IN        OUT      OUT 
      IDL> sxt_his2dbase, sscindex, sfcindex, sfcdata, /LEAK          ; SFC
      IDL> sxt_his2dbase, sscindex, sdcindex, sdcdata, /DARK [,/LONG] ; SDC
      IDL> sxt_his2dbase, sscindex, sdcindex, sdcdata, /SHORT         ; SDC
  
   History:
      11-May-1999 - S.L.Freeland - simplify some dbase verification checks

 CALLS: ***
	BOX_MESSAGE, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], RD_XDA [1]
	RD_XDA [2], Rd_Roadmap [2], TIME2FILE, UNIQ [1], UNIQ [2], UNIQ [3], anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], anytim2weekinfo, concat_dir [4]
	file_list [1], file_list [2], rd_roadmap [1], required_tags, tim2dset [1]
	tim2dset [2]
   Restrictions:
      Assumes online DBASE is equivilent to the one where corrections
      were applied (Warning message printed if mismatch which implies
      correction files not available.


sxt_his_info [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_his_info2.pro
[Previous] [Next]
   Name: sxt_his_info

   Purpose: return info about SXT history record (index.HIS.xxx)

   Input Parameters:
      index - index vector assumed to contain .HIS

   Output:
      function output returns boolean or info as determined by KEYWORDS

   Keyword Parameters:
      COLUMN_CORRECT (switch) - if set, return boolean (1/true if corrected)
  
  
   History:
      3-Feb-2000 - S.L.Freeland - simplify interface 


sxt_his_info [2] $SSW/yohkoh/sxt/idl/atest/sxt_his_info.pro
[Previous] [Next]
   Name: sxt_his_info

   Purpose: return info about SXT history record (index.HIS.xxx)

   Input Parameters:
      index - index vector assumed to contain .HIS

   Output:
      function output returns boolean or info as determined by KEYWORDS

   Keyword Parameters:
      COLUMN_CORRECT (switch) - if set, return boolean (1/true if corrected)
  
  
 CALLS: ***
	BOX_MESSAGE, data_chk [1], data_chk [2], gt_tagval [1], gt_tagval [2]
   History:
      3-Feb-2000 - S.L.Freeland - simplify interface 


SXT_HOTPIX_FUDGE $SSW/yohkoh/sxt/idl/atest/sxt_hotpix_fudge.pro
[Previous] [Next]
 NAME:
     SXT_HOTPIX_FUDGE
 PURPOSE:
     Fix hot pixels and their streaks cosmetically. It is hard-wired
       to fix the SXT hot pixel at (182,66) HR automatically, or one
       can enter an address with the pix keyword (this has not been
       tested well).
 CATEGORY:
     Yohkoh
 CALLING SEQUENCE:
     data_out = hotpix_fudge(index_in,data_in)
 INPUTS:
     index and data
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     pix, address of hot pixel
     hotness, hot pixel DN count
     status, returns 1 if it did something, 0 if it didn't
     qdebug stops for debugging
 OUTPUTS:
     returns the input image, cleaned up by (a) replacing the hot pixel
       and its neighbor immediately above with the mean of the 23
       pixels surrounding it, if its value exceeds 5 sigma of this
       mean. Also replaces the column above with the mean of the two
       adjacent columns.
     in case the image is not square or has gaps, no fudging is 
       done.
 CALLS: ***
	KILL_INDEX [1], KILL_INDEX [2], STDEV, gt_percentd, gt_res
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
     only works on HR and QR full-frame data, but does any type (eg,
       bytes). Does not work on gapped or non-square images. 
 MODIFICATION HISTORY:
     29-Jan-98, written (HSH) (as HOTPIX_FUDGE)
     19-Dec-98, separated input, output variables and renamed (HSH) 


SXT_HYST $SSW/yohkoh/ucon/idl/hudson/sxt_hyst.pro
[Previous] [Next]
 NAME:
     SXT_HYST
 PURPOSE:
     Compute temperatures and emission measures for SXT, using
       the whole flux measured in the full resolution PFI's
     Method includes log interpolation of the two filters via SPLINE
 CATEGORY:
     Yohkoh
 CALLING SEQUENCE:
     sxt_hyst,infil,te,em,tt
     sxt_hyst,infil,te,em,tt,/plot
     sxt_hyst,infil,te,em,tt,ff=ff
 INPUTS:
     infil: file spec for the SPR with the flare data
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     /plot gives time histories of two fluxes, temp, em, and
       sqrt(em) vs T
     ff is the filter set desired ([soft, hard]). The filter 
       numbers are:
         2 = thin Al
         3 = Dag
         4 = Be (note that this is the "hardest" of the filters)
         5 = thick Al
       default filter choice is [5,4] 
 OUTPUTS:
     te, em from SXT_TEEM; tt the time array corresponding to them;
       note that te and em are base 10 logs
 CALLS: ***
	FMT_TIMER [1], FMT_TIMER [2], RD_XDA [1], RD_XDA [2], Rd_Roadmap [2], SPLINE
	SXT_TEEM [1], SXT_TEEM [2], UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4]
	UTPLOT [5], UTPLOT [6], fmt_tim [1], fmt_tim [2], gt_dp_mode [1], gt_dp_mode [2]
	gt_expdur [1], gt_expdur [2], gt_filtb, gt_percentd, gt_time [1], gt_time [2]
	rd_roadmap [1], sxt_prep [1], sxt_prep [2], sxt_prep [3]
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
     Pretty preliminary. Bombed here and there but worked on the Jan. 13
       "home run" event. Error bars are not given because (a) counting
       statistics are usually negligible, and (b) the Bornmann method
       can't easily be applied in the absence of pre-flare data. This
       could be done ad hoc in exceptional cases.
 MODIFICATION HISTORY:
     HSH, written 17 Dec. 1994
     HSH, added filter choice 18 Dec. 1994


SXT_IMAGE_DECONVOLVE $SSW/yohkoh/sxt/idl/atest/sxt_image_deconvolve.pro
[Previous] [Next]

function sxt_image_deconvolve,index,data,unc_data,satpix, $
                              psf=psf,nodecon=nodecon, $
                              delta=delta,moffat=moffat, $
                              slevel=slevel,spower=spower, $
                              no_shadow=no_shadow, $
                              log10t=log10t,totalunc=totalunc, $
                              fftguess=fftguess,scat_fraction=scat_fraction

NAME:
     SXT_IMAGE_DECONVOLVE
PURPOSE:
     Remove PSF from SXT data
CATEGORY:
CALLING SEQUENCE:
     out = sxt_image_deconvolve(index,data,unc_data,satpix)
INPUTS:
     index = SXT index
     data = SXT data cube
     unc_data = output from sxt_prep
     satpix = output from sxt_prep
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     /fftguess = Use the direct FFT inversion as the initial guess
     /moffat = Use only the moffat core, no scattering wings 
               (passed to sxt_psf)
     /delta = Do not use the moffat core, only the scattering wings 
                (passed to sxt_psf)
     log10t = Log10(temperature) passed to sxt_psf (def = log(3.e6)).
     scat_fraction, slevel, spower = passed to sxt_psf.pro.
     /totalunc = indicates the the uncertainty array passed in should be
                 used as is and not combined with the sxt_dn_unc program.
                 If the uncertainty array is taken straight from sxt_prep,
                 do *not* use this keyword.
     /nodecon = skips the deconvolution.  You really don't want to use
                this, it is only for testing.
     psf = returns with the PSF used in the deconvolution.
OUTPUTS:
     out = corrected data cube
 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], IMAGE_DECONVOLVE, delvarx [5]
	gt_center, gt_filtb, gt_res, sxt_dn_unc, sxt_flux [1], sxt_flux [2], sxt_flux [3]
	sxt_psf
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
     The data input must be corrected with sxt_prep first!
PROCEDURE:
     Uses image_deconvolve.pro (a simple MEM algorithm)
MODIFICATION HISTORY:
     T. Metcalf  2000-10-04
                 2001-01-15 Fixed minor indexing bug.
                 2001-01-16 Added check for sigma>1.0
                 2001-04-24 Fixed to work with the new sxt_psf


sxt_images2ps $SSW/yohkoh/ucon/idl/nitta/sxt_images2ps.pro
[Previous] [Next]
 Name: sxt_images2ps
 PURPOSE: Make a postscript file of SXT time sequence images
 CALLING SEQUENCE: sxt_images2ps, index, data, 4, 6
                      SXT images are shown in a format of  4 (X) x 6 (Y).
                   sxt_images2ps, index, data, 2, 6, /grid
                      SXT images are shown in a format of 2 (X) x 6 (Y) with
                      fiducial grids (10x10).
 INPUTs:  index, data  -  data should be normalized beforehand.
          nx, ny - how many frames to be displayed in X and Y directions.
 OUTPUTs: None
 Optional Input Keywords:
      sub:   subset of data to be displayed (such as 4+indgen(15)).
      a4:    for an A4 output (instead of letter).
      outfile:  Name of the output postscript file (default: ~/sxt_images.ps).
      color:  Makes a color postscript file.
      landscape: Makes the output in landscape orientation.
      reduce:  Makes a smaller file (the maximum is 18 cm in X and 24 cm in Y).
      encapsulate: Makes an encapsulated file.
      ccolor: Specify the color of the lettering and grid (default=1)
      grid: Number of grids per image (setting it simply as /grid creates 10x10).
      replace: a byte scaled image same size as data(*,*,0) - to be used to insert
              a different kind image.
      loc_new: the location (0, 1, ...) where the different kind of image is inserted.
      str_new: index of that image.  If not available, give time like "12:03:23".
      sx0, sy0: BLC of subimage (default=0)
      sx1, sy1: TRC of subimage (default=63)
 SIDE EFFECT: A postscript file is created.
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], clearplot [1], clearplot [2]
	draw_box_nn [1], draw_box_nn [2], gt_day [1], gt_day [2], gt_time [1], gt_time [2]
 HISTORY:  15-Feb-96, NN, written.
           10-Apr-96, NN, add capabilities of inserting a different kind of image.
           28-JUN-98, NN, added keywords for subimage.


sxt_imgtypes $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_imgtypes.pro
[Previous] [Next]
 CALLING EXAMPLE
	ff=sxt_imgtypes(index,al,dg,hr,qr,mnth='feb',yr=00)
 PURPOSE
	Given an index or roadmap structure, return the indices
	of the Al.1, AlMg, HR(AlMg) and QR(AlMg) exposures.  
	Specification of month or year will limit the return
	to those periods.
 INPUT
	index, SXT index or roadmap structure
 OPTIONAL KEYWORD INPUT
	mnth, 3-letter string specifying month (e.g., mnth='apr')
		or
             month number (1-12) 	
	yr, 2 character year specification (e.g., yr=00)
 OUTPUT
	ff is a list of indices for the given month
	al are the sub-indices for all Al.1 images.
	dg are the sub-indices for all AlMg images
	hr are the sub-indices for all HR images
	qr are the sub-indices for all QR images
	hrdg are the sub-indices for the HR AlMg images
	qrdg are the sub-indices for the QR AlMg images
	hral are the sub-indices for the HR Al.1 images
	qral are the sub-indices for the QR Al.1 images
 HISTORY
	8-Mar-2004, LWA
      21-Apr-2004, LWA  Changed name from get_month.pro
			 Added hrdg and qrdg variables
      22-Apr-2004, lwa  For generality, added hral and qral.
 CALLS:


sxt_interp [1] $SSW/yohkoh/sxt/idl/atest/sxt_interp.pro
[Previous] [Next]
 NAME:
   sxt_interp
 PURPOSE:
   Linearly interpolate two SXT images in time.

   WARNING:  sxt_interp overwrites the input variables:

 CALLING SEQUENCE:
   sxt_interp,index,data,ntimes
   sxt_interp,index,data,ntimes,unc_data
   sxt_interp,index,data,ntimes,/sfd

 INPUT/OUTPUT PARAMETERS:
   index   = SXT index structure
   data    = SXT data cube (must be 3-d)

 INPUT PARAMETERS:
   ntimes  = Vector of new times (can be any Yohkoh format or an
			index or roadmap structure)

 OPTIONAL INPUT/OUTPUT PARAMETERS:
  unc_data = Decompression uncertainties
  satpix   = Saturated pixel array
  sfd = if set, then the input are SFD images, and have 1000
        msec exposure times, don't use this routine on SFD's without /sfd

 If extrapolation is performed, any resulting negative values are set to 0.

 CALLS: ***
	Ex2Int [1], Ex2Int [2], anytim2ex [1], anytim2ex [2], anytim2ints [1]
	anytim2ints [2], fmt_tim [1], fmt_tim [2], gt_expdur [1], gt_expdur [2], gt_filtb
	gt_res, int2secarr [1], int2secarr [2], interp_arr [1], interp_arr [2]
	interp_arr [3], tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	SXT_PREP0, box_sxthxt_fsp, go_teem [1], go_teem [2], go_teem_nn, go_teem_t
	sxt_fl_analxpro, sxt_fsp, sxt_tfl, sxt_tflx, sxt_thfsp, sxtbox_fsp, sxtbox_teem
	sxthxt_fsp
 MODIFICATION HISTORY:
   8-mar-93, J. R. Lemen, LPARL
  16-mar-93, JRL, Fixed typo (fmt_tim); Fixed up round-off scheme
  29-sep-95, Jmm, fixed uncertainty calculation, uses new version
                  of INTERP_ARR
  12-oct-95, S.L.Freeland - restored first line (procedure definition line!)
  21-oct-95, JRL, Fixed a typo
  23-jun-1998, jmm, Added sfd keyword, to enable the interpolation of SFD
                    images, for which GT_EXPDUR returns something other
                    than 1000 msec for the exposure


sxt_interp [2] $SSW/yohkoh/sxt/idl/util/sxt_interp.pro
[Previous] [Next]
 NAME:
   sxt_interp
 PURPOSE:
   Linearly interpolate two SXT images in time.

   WARNING:  sxt_interp overwrites the input variables:

 CALLING SEQUENCE:
   sxt_interp,index,data,ntimes
   sxt_interp,index,data,ntimes,unc_data
   sxt_interp,index,data,ntimes,unc_data,satpix

 INPUT/OUTPUT PARAMETERS:
   index   = SXT index structure
   data    = SXT data cube (must be 3-d)

 INPUT PARAMETERS:
   ntimes  = Vector of new times (can be any Yohkoh format or an
			index or roadmap structure)

 OPTIONAL INPUT/OUTPUT PARAMETERS:
  unc_data = Decompression uncertainties
  satpix   = Saturated pixel array

 If extrapolation is performed, any resulting negative values are set to 0.

 CALLS: ***
	Ex2Int [1], Ex2Int [2], anytim2ex [1], anytim2ex [2], anytim2ints [1]
	anytim2ints [2], fmt_tim [1], fmt_tim [2], gt_expdur [1], gt_expdur [2], gt_filtb
	gt_res, int2secarr [1], int2secarr [2], interp_arr [1], interp_arr [2]
	interp_arr [3], tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	SXT_PREP0, box_sxthxt_fsp, go_teem [1], go_teem [2], go_teem_nn, go_teem_t
	sxt_fl_analxpro, sxt_fsp, sxt_tfl, sxt_tflx, sxt_thfsp, sxtbox_fsp, sxtbox_teem
	sxthxt_fsp
 MODIFICATION HISTORY:
   8-mar-93, J. R. Lemen, LPARL
  16-mar-93, JRL, Fixed typo (fmt_tim); Fixed up round-off scheme
  29-sep-95, Jmm, fixed uncertainty calculation, uses new version
                  of INTERP_ARR
  12-oct-95, S.L.Freeland - restored first line (procedure definition line!)
  21-oct-95, JRL, Fixed a typo


sxt_is_synsfc $SSW/yohkoh/sxt/idl/atest/sxt_is_synsfc.pro
[Previous] [Next]
   Name: sxt_is_synsfc

   Purpose: boolean - was synthetic correction applied?

   Input Parameters:
      index - one or more SXT index records

 CALLS: ***
	BOX_MESSAGE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	required_tags, ssw_deltat
   History:
      16-Jan-2002 - S.L.Freeland

   Method:
     Look for leak image time = image time, true only for synthetic


sxt_kleen $SSW/yohkoh/sxt/idl/atest/sxt_kleen.pro
[Previous] [Next]


function sxt_kleen,index,data,satpix,kleenindex=kleenindex,$
	level=level,dat=dat,dark1=dark1,timer=timer,$
	nsmooth=nsmooth,nsigma=nsigma,nbound=nbound,debug=debug

NAME
	sxt_kleen
PURPOSE
	Front-end program to call sxt_clean.pro to retain
	compatibility with earlier softwate.
	Removes spikes and holes from an SXT image.
CALLING SEQUENCE
	nice_img=sxt_kleen(index,data,timer)
	nice_img=sxt_kleen(index,data,[kleenindex=kleenindex,$
          level=level,dat=dat,dark1=dark1,timer=timer,$
          nsmooth=nsmooth,nsigma=nsigma,nbound=nbound,debug=debug]
INPUTS
	index, SXT index structure
	data, either sxt_prep'd image or raw compressed SXT image
OPTIONAL KEYWORD INPUTS
	level, logarithmic spike threshold for signal parts of the image.
		[default = 1.125 (FR), 0.75 (HR), 0.375 (QR)]
	/timer, prints out how long it took program to run.
	nsmooth, median smoothing parameter [default = 3]
	nsigma, gaussian smoothing parameter [default = 3, sigma]
	nbound, sets boundary between noisy and signal parts of image.
		[default = 0.5, i.e., half the std dev of darkframe.]
	/debug, stops program from time to time for debugging.
OPTIONAL OUTPUTS
	satpix, saturated pixels in byte-type input image.
OPTIONAL KEYWORD OUTPUTS
	kleenindex, index structure with exposure adjusted in .his
	    (Note: Flagging of kleening not yet implemented in .his.)
	dat, returns input data or sxt_prep'd input data.
	dark1, returns darkframe used to determine std dev of noise.
RESTRICTIONS
 	THIS CODE ONLY HANDLES ONE IMAGE AT A TIME.
	Assumes noise obeys poisson statistics.
	SXT_KLEEN should be run before registration.
	This program alters the data -- which is ALWAYS dangerous!
HISTORY
	10-Apr-00, LWA, Gutted sxt_kleen.pro
 CALLS:


sxt_lcur $SSW/yohkoh/sxt/idl/util/sxt_lcur.pro
[Previous] [Next]
NAME:
	sxt_lcur
PURPOSE:
	To return a vector giving DN/sec/FR pixel
CALLING SEQUENCE:
	y = sxt_lcur(roadmap)
	plot, sxtp, sxt_lcur(sxtp, filtb=2)
INPUT:
	struct	- The roadmap or observing log
		  FUTURE - can pass the index
 CALLS: ***
	gt_dpe, gt_res
 CALLED BY:
	ploty [1], ploty [2]
OPTIONAL KEYWORD INPUT:
	max	- If set, use "img_max" instead of "img_avg"
OUTPUT:
	Returns a floating vector the same length as the input
	structure with DN/sec/FR pixel.
HISTORY:
	Written 7-Jul-92 by M.Morrison


sxt_low8_match [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_low8_match.pro
[Previous] [Next]

 Identifies which Compressed optical image to use for
 restoring a Low8 image.


FUNCTION sxt_low8_match, index


 INPUT PARAMETERS:
	index = index of optical images, both Compressed and Low8

  OUTPUT:
	Array of subscripts, dimensioned 2 x n where n is the number 
	of elements in the index array.  All non-optical (e.g., NaBan,
	WdBan or diffuser) entries in the array are set=-1.  The (0,n) values
	are the subscripts of the Low8 images.  The (1,n) values
	are the subscripts of the Compressed image to use.
	If no valid Compressed image exists, (1,n) = -1.

 METHOD:
	Finds closest Compressed image in time with same pointing,
	size, and binning.  Must be within +/- 20 minutes of the
	low8 image.

 CALLS: ***
	UNIQ [1], UNIQ [2], UNIQ [3], gt_comp, gt_expmode, gt_filta, gt_res
 CALLED BY:
	rest_low8_ffi
 HISTORY:
	Written  June 28, 1994   Barry LaBonte
	 2-11-2004 LWA  Editted for general application.
	 1-20-2005 LWA  Return if no compressed or low8 images. 
	 2-10-2005 LWA  Adapted to handle diffuser images.


sxt_low8_match [2] $SSW/yohkoh/ucon/idl/labonte/sxt_low8_match.pro
[Previous] [Next]

 Identifies which Compressed optical image to use for
 restoring a Low8 image.


FUNCTION sxt_low8_match, index


 INPUT PARAMETERS:
	index = index of optical images, both Compressed and Low8

  OUTPUT:
	Array of subscripts, dimensioned 2 x n.  The (0,n) values
	are the subscripts of the Low8 images.  The (1,n) values
	are the subscripts of the Compressed image to use.
	If no valid Compressed image exists, (1,n) = -1.

 METHOD:
	Finds closest Compressed image in time with same pointing,
	size, and binning.

 CALLS: ***
	UNIQ [1], UNIQ [2], UNIQ [3], gt_comp, gt_expmode, gt_filta, gt_res
 CALLED BY:
	rest_low8_ffi
 HISTORY:
	Written  June 28, 1994   Barry LaBonte


sxt_mauna $SSW/yohkoh/ucon/idl/foley/sxt_mauna.pro
[Previous] [Next]
 NAME:
    sxt_mauna

 PURPOSE
    to produce image with sxt centre and monou outer

 CALLING SEQUENCE
    sxt_mauna,image_out, 1.1 ,1.5  

 INPUT
    ext  : radial extent of sxt image to be included in solar radi
    siz  : The size of the final image, 1 = 512X512 , 1.5=768X768

 OPTIONAL OUTPUT
    none

 OPTIONAL KEYWORD INPUT
    none

 RESTRICTION
    Requires the Mauna Loa Sun Raster Image be in the current 
    working directory. You can obtain these from the following url :

     http://www.hao.ucar.edu/public/research/mlso/mk3ftptree.html

 HISTORY
   writen CAF Sep 95

 
 CALLS:


sxt_mk3 mk3 index data [1] $SSW/yohkoh/gen/idl/atest/sxt_mk3.pro
[Previous] [Next]
   Name: sxt_mk3, mk3, index, data

   Purpose: embed an SXT image in an MLSO MarkIII coronograph image

   Input Parameters:
      index	- SXT index
      data     - SXT data

   Keyword Parameters;
      diameter - output size of composite (outer diameter of MK3 in device pix)
      outsize  - synonym for diameter

   Calling Sequnce:
      composite=sxt_mk3(index, data [diameter=diameter])

 CALLS: ***
	CONGRID [1], CONGRID [2], CONGRID [3], SXT_MK3, WDEF [1], WDEF [2], anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], fit_limb, get_mk3 [1], get_mk3 [2]
	set_back
   History:
      24-sep-1995 (SLF) (one optional replacement for Nobeyama)
      18-apr-1995 (SLF) annotation style updated
      22-dec-1997 (SLF) time->ECS

   Assumptions:
      more than I could possibly list here 


sxt_mk3 mk3 index data [2] $SSW/yohkoh/sxt/idl/util/sxt_mk3.pro
[Previous] [Next]
   Name: sxt_mk3, mk3, index, data

   Purpose: embed an SXT image in an MLSO MarkIII coronograph image

   Input Parameters:
      index	- SXT index
      data     - SXT data

   Keyword Parameters;
      diameter - output size of composite (outer diameter of MK3 in device pix)
      outsize  - synonym for diameter

   Calling Sequnce:
      composite=sxt_mk3(index, data [diameter=diameter])

 CALLS: ***
	CONGRID [1], CONGRID [2], CONGRID [3], SXT_MK3, WDEF [1], WDEF [2], anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], fit_limb, get_mk3 [1], get_mk3 [2]
	set_back
   History:
      24-sep-1995 (SLF) (one optional replacement for Nobeyama)
      18-apr-1995 (SLF) annotation style updated

   Assumptions:
      more than I could possibly list here 


sxt_mksdc_history $SSW/yohkoh/sxt/idl/atest/sxt_mksdc_history.pro
[Previous] [Next]
   Name: sxt_mksdc_history

   Purpose: save mk_sdc and sdc_verify

   Input Parameters:
      index - one or more SDC index records (with or without .HIS)
      sdc_quality - optional quality indicator (sdc_verify ouput)   

   Keyword Parameters:
      mk_sdc_version (INPUT)     - version number from mk_sdc
      sdc_verify_version (INPUT) - version number from sdc_verify 
      
   Calling Sequence: 
      sxt_mksdc_history, index, quality, mk_sdc_version=mk_sdc_version,$
                                  sdc_verify_version=sdc_verify_version

 CALLS: ***
	BOX_MESSAGE, his_index, required_tags
 CALLED BY:
	mk_sdc [2], mk_sdc [3], mk_sdc [4]
   Side Effects:
      adds .HIS and associated info to input index(ies)


sxt_mornint $SSW/yohkoh/sxt/idl/atest/sxt_mornint.pro
[Previous] [Next]
   Name: sxt_mornint

   Purpose: manage the SXT Morning Interval dbase

   Calling Sequence:
       IDL> sxt_mornint, dbase=dbase   ; return entire dbase
       IDL> sxt_morning,/append        ; update the dbase  
 CALLED BY:
	sxt_uvf_info [1], sxt_uvf_info [3]
   HIstory:
      28-jan-98 - S.L.Freeland (for SDC orbital correction)
      24-Feb-99 - S.L.Freeland (add /append, some documentation)

   Method:
      read common tables and extract morning interval{

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], BOX_MESSAGE, CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], FILE_EXIST [2], concat_dir [4], file_exist [1], file_exist [3]
	fmt_tim [1], fmt_tim [2], get_yo_dates [1], get_yo_dates [2], get_yo_dates [3]
	gt_tagval [1], gt_tagval [2], gtab_comm, restgen [1], restgen [2], savegen [1]
	savegen [2], strextract, tim2dset [1], tim2dset [2], timegrid, ut_time [1]
	ut_time [2]
   Restrictions:
      some values are known bad - filter applied downline...{


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

 Computes best isothermal temperature and emission measure from
 data with more than 2 SXT filters.


PRO sxt_multi_teem, filters, fluxes, te, em, iso,	$
		date=date,				$
		newflux=newflux,  tecoef=tecoef


 INPUT PARAMETERS:
	filters = vector of filter numbers.  Numbers are the
		same as GT_FILTB.  Filters must be in order, 
		thinnest first.
	fluxes = observed fluxes, ADU per millisecond.  May be
		2-D or 3-D; last dimension must be the same as
		filters.  Data must be in the same order as filters.

 OUTPUT PARAMETERS:
	te = log10 of temperature, K.
	em = log 10 of emission measure, cm^-3
	iso = "isothermality".  Vector dot product of observed
		residuals with isothermal residuals.  Noise-free
		isothermal values correspond to 1.

 OPTIONAL INPUT KEYWORDS:
	date = date of observation in any standard Yohkoh format.
		Used to account for the entrance filter failure on
		November 12, 1992.  Should be input for data after
		that date.  Default is earlier.

 OPTIONAL OUTPUT KEYWORDS:
	newflux = calculated fluxes based on the isothermal T, EM.
		Must be defined before use.
	tecoef = vector of weights for computing temperature scaler.
		

 METHOD:
	In n-dimensional space, the isothermal fluxes for isothermal
	gas describe a curve.  
	A crude principal components analysis is performed.  The
	emission measure is the scale factor.  A temperature
	vector is found from the isothermal fluxes and used to
	determine the observed temperatures.  The residuals are
	compared (vector dot product) with the isothermal
	vector residuals to determine the quality of the fit.

 CALLS: ***
	DSPLINE, POLY_FIT, sxt_flux [1], sxt_flux [2], sxt_flux [3]
 RESTRICTIONS:
	There is no weighting of the data.  If the data from the
	different filters have greatly different errors, the
	result is questionable.

 HISTORY:
	Written  March 17, 1994  Barry LaBonte


sxt_mwave $SSW/yohkoh/sxt/idl/sensitivity/sxt_mwave.pro
[Previous] [Next]
 NAME:
  sxt_mwave
 PURPOSE:
  Return the mean photon wavelength for a given SXT filter and 
  assumed plasma temperature.

 CALLING SEQUENCE:
  mwave = sxt_mwave(Te,filterN)	; mwave is in Angstroms
  mwave = sxt_mwave(Te,index)		; mwave is in Angstroms
  mwave = sxt_mwave(Te,filterN,date=date)

 INPUTS:
  TE           = log10(Temp) (May be a vector: min = 5.5, max = 8.0)
  FILTERN	= Filter B value (range is 1 to 6) or SXT index structure.
 CALLED BY:
	sxt_psf
                 Note:  If an SXT index structure is supplied, then this will
                 be used to specify the filter number and DATE.  The Date
                 will be overridden if the DATE=DATE keyword is supplied.

  TE and FILTERN may be vectors, but their lengths must match:
		  N_elements(TE)	N_elements(FILTERN)
			1			1
  These are the 	N			1
    valid options:	1			N
			N			N
 OUTPUTS:
   This function returns the mean wavlength (Ang) given an assumed 
   isothermal plasma temperature.

 OPTIONAL INPUT KEYWORDS:
  date		= Time in any format (including structure). Used to
		  determine entrance filter transmission. 
		  Overrides date specified by FILTERN (index).
  noverbose	= If set, suppress some of the informational messages

 OPTIONAL OUTPUT KEYWORDS:
  version	= version number of SXT mean wavelength data base file.

 PROCEDURE:
  The mean wavelength is determined by folding an isothermal spectrum
  through the SXT response function.  The mean wavelength of the emission
  that is integrated in the SXT CCD is computed and saved in a file.  The
  routine that calculates the SXT response function files (sre*genx) is
  also used to compute the mean wavelength data base.  Because the hole
  in the entrance filter affected the SXT response function, the mean 
  is a function of the entrance filter transmission.  Therefore, the
  DATE keyword is necessary to specify the time of interest.  If an SXT
  index is passed in, then the date will be taken from the index.

 CALLS: ***
	ADDTIME [1], ADDTIME [2], BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3]
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DOC_LIBRARY, DSPLINE, UNIQ [1]
	UNIQ [2], UNIQ [3], anytim2ints [1], anytim2ints [2], break_file [4]
	concat_dir [4], fastdoc [1], fastdoc [2], fmt_tim [1], fmt_tim [2]
	get_yo_dates [1], get_yo_dates [2], get_yo_dates [3], gt_expdur [1]
	gt_expdur [2], gt_filtb, int2secarr [1], int2secarr [2], restgen [1], restgen [2]
	tbeep [1], tbeep [2], tbeep [3]
 RESTRICTIONS:
  DATE must be of length 1.  If the date is obtained from an SXT 
  INDEX, the first time in the structure  will be used to determine 
  the entrance filter fraction.

  If the dates of interest span the time of 13-nov-92 16:50 UT, then 
  separate calls must be made for data before and after this date.

 MODIFICATION HISTORY:
  21-apr-95, J. R. Lemen, Written.
  24-nov-95, JRL, Renamed the "filter" variable to "filterN" to avoid a 
		   conflict with the filter function that is on-line.


sxt_obs_coord [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_obs_coord.pro
[Previous] [Next]
NAME:
	sxt_obs_coord
PURPOSE:
	To print out the OR table coordinate for a region clicked on 
	a HR FFI image
CALLING SEQUENCE:
	sxt_obs_coord, item1 [, item2, data, side=side, /nomark1, bin=bin]
	sxt_obs_coord, index
	sxt_obs_coord, index, index1, data=data,side=128  ; 2x2 OR
	sxt_obs_coord, index, index1, side=[64,128]	  ; 1x2 OR (NS x EW)
INPUT:
	item1	- Time of image in any format (index, etc)
                 If item1 is string a 512x512 image is assumed.
	item2	- Time in any format at which coordinates of chosen point
		  are desired (index, etc)
KEYWORDS (INPUT):
	data	- Image.  Only needed if image is to be re-displayed.
	suncenter - Center of sun in full res (IDL) pixels.  
		    Defaults to suncenter=sxt_cen(item1)
	sec_per_pix - Pixel size in arcsec.
	side	- Size of square in FR pixels to draw on image (def = 64). If 
		  side =[N,M], will draw a rectangle that is N (NS) by M (EW)
	bin	- Binning width if image is re-displayed (def is 1).
	res	- Summation mode.  Only needed if item1 is not an index
		  or roadmap record.
	grid	- If set, overlay heliographic coordinate grid
	nomark1	- If present, the location on the image which 
		  is selected is NOT marked (default is to mark it).
	nomark2	- If present, the location of the rotated position 
		  is NOT marked (default is to mark it).
	color1	- Color of ROI box (def = 192).
	color2	- Color of rotated ROI box (def = 255).
	qstop	- If set, stop execution without returning to calling program.
	query   - If set, query user for coordinate information
	helio   - Heliographic coordinates of chosen point
	date_helio - Epoch time of above coordinates in any format
KEYWORDS (OUTPUT):
	coords	- Output OR coordinates (TODO).
 CALLS: ***
	DOC_LIBRARY, SXT_GRID [1], SXT_GRID [2], SXT_GRID [3], conv_a2p [1], conv_a2p [2]
	conv_h2p [1], conv_h2p [2], conv_p2h [1], conv_p2h [2], draw_boxcorn [1]
	draw_boxcorn [2], fmt_tim [1], fmt_tim [2], gt_res, input [1], input [2]
	sxt_cen [1], sxt_cen [2], track_h2a [1], track_h2a [2], track_h2a [3]
 CALLED BY:
	gbo_obs_coord
HISTORY:
	20-Nov-91 - MDM - Written.
	 2-Apr-92 - LWA - Algorithm derived
	 3-aug-93 - GLS - Extensive re-write to make use of new pointing
			  and coordinate transformation routines.
       30-nov-93, JRL, side=[n,m] will now draw a rectangle.
			Added the epoch times and adjusted the message formats.
			Changed nomark= to nomark1 (nomark was ambiguous)
       22-dec-93, JRL, Fixed an IDL V3.1 related bug
	24-mar-94, JRL, Fixed case when input of suncenter correctly
       14-apr-94, LWA, Mod to handle case where item1 is a string (time).
	17-Jun-94, BNH, Added feature to choose coordinates manually
	30-Nov094, LWA, Changed color to color1 to avoid IDL ambiguity.
       02-Mar-06, DMcK Added epoch_time input to conv_p2h (otherwise
			uses today's date for b0-angle), and forced
			window size to be [nx,ny]


sxt_obs_coord [2] $SSW/yohkoh/sxt/idl/util/sxt_obs_coord.pro
[Previous] [Next]
NAME:
	sxt_obs_coord
PURPOSE:
	To print out the OR table coordinate for a region clicked on 
	a HR FFI image
CALLING SEQUENCE:
	sxt_obs_coord, item1 [, item2, data, side=side, /nomark1, bin=bin]
	sxt_obs_coord, index
	sxt_obs_coord, index, index1, data=data,side=128  ; 2x2 OR
	sxt_obs_coord, index, index1, side=[64,128]	  ; 1x2 OR (NS x EW)
INPUT:
	item1	- Time of image in any format (index, etc)
                 If item1 is string a 512x512 image is assumed.
	item2	- Time in any format at which coordinates of chosen point
		  are desired (index, etc)
KEYWORDS (INPUT):
	data	- Image.  Only needed if image is to be re-displayed.
	suncenter - Center of sun in full res (IDL) pixels.  
		    Defaults to suncenter=sxt_cen(item1)
	sec_per_pix - Pixel size in arcsec.
	side	- Size of square in FR pixels to draw on image (def = 64). If 
		  side =[N,M], will draw a rectangle that is N (NS) by M (EW)
	bin	- Binning width if image is re-displayed (def is 1).
	res	- Summation mode.  Only needed if item1 is not an index
		  or roadmap record.
	grid	- If set, overlay heliographic coordinate grid
	nomark1	- If present, the location on the image which 
		  is selected is NOT marked (default is to mark it).
	nomark2	- If present, the location of the rotated position 
		  is NOT marked (default is to mark it).
	color1	- Color of ROI box (def = 192).
	color2	- Color of rotated ROI box (def = 255).
	qstop	- If set, stop execution without returning to calling program.
	query   - If set, query user for coordinate information
	helio   - Heliographic coordinates of chosen point
	date_helio - Epoch time of above coordinates in any format
KEYWORDS (OUTPUT):
	coords	- Output OR coordinates (TODO).
 CALLS: ***
	DOC_LIBRARY, SXT_GRID [1], SXT_GRID [2], SXT_GRID [3], conv_a2p [1], conv_a2p [2]
	conv_h2p [1], conv_h2p [2], conv_p2h [1], conv_p2h [2], draw_boxcorn [1]
	draw_boxcorn [2], fmt_tim [1], fmt_tim [2], gt_res, input [1], input [2]
	sxt_cen [1], sxt_cen [2], track_h2a [1], track_h2a [2], track_h2a [3]
 CALLED BY:
	gbo_obs_coord
HISTORY:
	20-Nov-91 - MDM - Written.
	 2-Apr-92 - LWA - Algorithm derived
	 3-aug-93 - GLS - Extensive re-write to make use of new pointing
			  and coordinate transformation routines.
       30-nov-93, JRL, side=[n,m] will now draw a rectangle.
			Added the epoch times and adjusted the message formats.
			Changed nomark= to nomark1 (nomark was ambiguous)
       22-dec-93, JRL, Fixed an IDL V3.1 related bug
	24-mar-94, JRL, Fixed case when input of suncenter correctly
       14-apr-94, LWA, Mod to handle case where item1 is a string (time).
	17-Jun-94, BNH, Added feature to choose coordinates manually
	30-Nov094, LWA, Changed color to color1 to avoid IDL ambiguity.


SXT_OBSRPT $SSW/yohkoh/ucon/idl/sxt_co/sxt_obsrpt.pro
[Previous] [Next]
 NAME:
        SXT_OBSRPT
 PURPOSE:
        Provides a summary listing of the #s of FFIs and PFIs per
	 Yohkoh orbit, between input times. Further divides PFIs
	 by unique FOVs.
 CALLING SEQUENCE:
	 sxt_obsrpt, sttime	(Default: entime = sttime + 24 hrs)
	 sxt_obsrpt, sttime, entime
	 sxt_obsrpt, /hc	(DPRINTs output to printer AOT screen)
	 sxt_obsrpt, outfile=outfile    (Output to outfile AOT screen)
	 sxt_obsrpt, /outfile	(Default: outfile = 'obs_rpt.out')
	 sxt_obsrpt, /hc, /outfile
        sxt_obsrpt, ... , /html
 INPUTS:
	 sttime = Begin time for selected observational period.
	 entime = End time for selected observational period. Default
		  is sttime+24hrs.  May crash if interval is less than 2hrs.
 KEYWORD PARAMETERS:
        Keywords:
	 /HC -> Output goes to printer instead of screen. A temporary
		file 'obs_rpt.tmp' is created, printed with DPRINT,
		and then deleted.
	 OUTFILE=OUTFILE -> Output goes to OUTFILE instead of screen.
		Default value is 'obs_rpt.out'. If this keyword is
		enabled WITH /HC, then OUTFILE is DPRINTed, but NOT
		deleted.
        /html -> Generates html output.
	 /ffi_report -> Includes pointing and resolution of FFIs
        /noaa_no -> Includes listing of NOAA active region nearest PFI

 OUTPUTS:
	 Listing of Yohkoh orbits spanning timerange, from FEM files.
	 Per orbit, the following: total FFIs and PFIs, unique FOVs
	 with # PFIs for each (from RD_OBS and SXT_UNIQFOV).
 CALLS: ***
	DPRINT, FOV2NAR, KILL_INDEX [1], KILL_INDEX [2], SXT_UNIQFOV, anytim2ints [1]
	anytim2ints [2], gt_center, gt_day [1], gt_day [2], gt_expmode, gt_filta, gt_filtb
	gt_res, gt_shape, gt_time [1], gt_time [2], int2secarr [1], int2secarr [2], rd_fem
	rd_obs, sel_timrange [1], sel_timrange [2]
 COMMON BLOCKS:
	 Typically avoided.
 NOTES:
	 Originally written for Schmieder-June96 campaign.
	
 MODIFICATION HISTORY:
	 M. A. Weber, 19-Jun-96 --- Written. V1.00 (alpha!)
	 25/7/96  - (MAW) - Adjusted "feature" so now code can handle 
			    time spans greater than 24 hours. (V1.01)
	 97.6.10  - (MAW) - Fixed major bug with SXTP seconds array.
			    (V1.10)
        06/30/99 - (ARD) - Added option to generate html output.
	 07/02/99 - (DMcK)- Patched PFI counting problems.
	 07/16/99 - (DMcK)- Added FFI_REPORT option.
        09/14/99 - (DMcK)- Added NOAA_NO option, and trapped out
			    calibration FFIs. (V2.00)
	 09/07/00 - (DMcK)- Improved trapping of calibration FFIs,
			    and fixed bug whereby program crashed when
			    PFIs exist but all FFIs are calibrations.
			    Still crashes if interval is less than 2hrs.
        09/22/00 - (DMcK)- Adjusted patch of 7-sep-00 to fix case where
			    zero FFIs and zero PFIs were made during an
			    orbit.


sxt_off_axis $SSW/yohkoh/sxt/idl/util/sxt_off_axis.pro
[Previous] [Next]
 NAME:
   sxt_off_axis
 PURPOSE:
   Correct an SXT image for the X-ray vignette function.
   Corrected_image = image / Vignette_function
 CALLING SEQUENCE:
   data_out = sxt_off_axis(index, data, index_out)
   data_out = sxt_off_axis(index, data, /update_index)
 INPUTS:
   index	- The index structure for each image
   data	- The data array (NX x NY x N)
 OUTPUTS:
   data_out	- The Vignette-corrected image
   index_out	- The updated index struture (history records appended)
 OPTIONAL KEYWORD INPUTS:
   update_index- Update the input Index.
   vignette_only- If set, return the vignette function.
   force_energy- Two energy solutions are available.  The low-energy
		  result will by default be applied to all filters except
		  the Al12 and Be119 filters, which will have the high-
		  energy result.  Set force_energy=1 to force low-energy
				  Set force_energy=2 to force high-energy
 OPTIONAL KEYWORD OUTPUTS:
 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], HIS_EXIST, delvarx [5]
	gt_corner, gt_filtb, gt_res, gt_shape, his_index, sxt_vignette
 CALLED BY:
	STRAY_CORR, mk_ssc [1], mk_ssc [2], mk_sxh, sacpeak_image, sxt_av_teem, sxt_prep [1]
	sxt_prep [2], sxt_prep [3]
 RESTRICTIONS:
   This should only be run on background-subtracted data.
 METHOD:
   Call sxt_vignette to compute the appropriate vignette function.
   Note:  The calling order to sxt_vignette could use further optimization 
          to avoid calling sxt_vignette unnecessarily.
 DISCLAIMER:
   This routine will correct SXT images using either the WSMR1 calibration
   data for low-energy filters (from Al-K and C-K data) or high-energy
   (from Al-L data).  These corrections are only approximate and may not be
   the most appropriate way to treat this problem.  Try IDL> help_vignette to
   get an idea of the size of the correction.

 MODIFICATION HISTORY:
 V1.0   11-jan-94, J. R. Lemen LPARL, Written
	 20-mar-95, JRL   Commented out an unnecessary call to message


SXT_OLD_STRUCT $SSW/yohkoh/gen/idl/ref_access/sxt_old_struct.pro
[Previous] [Next]
       NAME:
               SXT_OLD_STRUCT
       PURPOSE:
               Define the following SXT specific database structures
                       * SXT_2301_Index_Rec 
                       * SXT_2302_Index_Rec 
                       * SXT_3011_Index_Rec
                       * SXT_3012_Index_Rec

       CALLING SEQUENCE:
               SXT_OLD_STRUCT
       HISTORY:
               written by Mons Morrison, Fall 90.


sxt_orhis $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_orhis.pro
[Previous] [Next]
   Name: sxt_orhis

   Purpose: collect per-PFI history info during OR assembly in sxt_prep

   Input Parameters:
      (3 positional parameters per sxt_prep.pro names & values)
      index_out_qr - PFI index w/.HIS following leak_sub calls
      index_out    - OR index (output from sxt_prep of 'spr' files, for examp)
      ser_map - uniq serial number map (one per OR)

   Output:
      Function returns structure vector, 1 element per assembled OR
      includes:
         Time&Day (from OR record)
         Version (of this routine)
         Serial Number (uniq for each OR)
         NPFI - number of PFIs in OR
         ORHIS - string array of supplemental PFI info (times, dark&leak, 
                 and PFI FOV_CENTER)  

   Calling Sequence:
      (expect only called from sxt_prep...)
      orhis=sxt_orhis(index_out_qr,index_out,ser_map)

 CALLS: ***
	ARR2STR [1], Arr2Str [2], BOX_MESSAGE, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], gt_tagval [1], gt_tagval [2], pr_his_index [1]
	pr_his_index [2], pr_his_index [3]
 CALLED BY:
	sxt_prep [1], sxt_prep [2], sxt_prep [3]
   History:
      1-may-2006 - S.L.Freeland - based on ages old review.


sxt_patch_att $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_patch_att.pro
[Previous] [Next]
   Name: sxt_patch_att

   Purpose: update an ATT file with user supplied ATT records

   Input Parameters:
      newatt_data - vector of modified ATT records to update

   Keyword Parameters:
      outdir - where to write modified ATT file
      append - if set and corresponding ATT file exists in OUTDIR, start w/that
               (default starts with copy of existing DIR_GEN_ATT version->OUTDIR)[
      quiet - if set, suppress status messages
      full_week - set this if NEWATT_DATA includes EVERY record for week
                  (skips time match so fast but buyer beware...)

   Calling Sequence:
      IDL> sxt_patch_att,newatt_data [,outdir=outdir] [,/APPEND]

 CALLS: ***
	BOX_MESSAGE, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DELVARX [1]
	DELVARX [2], DELVARX [3], DELVARX [4], FILE_EXIST [2], anytim2weekinfo
	concat_dir [4], curdir [1], curdir [2], delvarx [5], file_exist [1]
	file_exist [3], get_logenv [1], get_logenv [2], rd_att, rdwrt [1], rdwrt [2]
	rdwrt [3], set_logenv [1], set_logenv [2], ssw_strsplit, str2cols [1]
	str2cols [2], tim2dset [1], tim2dset [2], time_window
   Side effects:
      implied att weekly file in OUTDIR is generated or modified
      att.SPARE is set to 1 for modifed records

   History:
      29-Sep-2005 - S.L.Freeland - Yohkoh Legacy Project helper utility
       3-oct-2005 - S.L.Freeland - optimize for full week usage
   
   Restrictions:
      input/modified input att records may not span a week file boundry
      if /APPEND is set, assumes file already exists in OUTDIR


sxt_plan $SSW/yohkoh/sxt/idl/util/sxt_plan.pro
[Previous] [Next]
   Name: sxt_plan

   Purpose: show or return info about SXT table load plan.

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], anytim2weekid [1]
	anytim2weekid [2], concat_dir [4], data_chk [1], data_chk [2], fmt_tim [1]
	fmt_tim [2], pr_week2tim [1], pr_week2tim [2], prstr [1], prstr [2], rd_tfile [1]
	rd_tfile [2], remtab [1], remtab [2], str2cols [1], str2cols [2], str_replace [1]
	str_replace [2], strjustify, ut_time [1], ut_time [2]
 CALLED BY:
	show_contacts
   Restrictions:
      assume that table plans are in $ys/sxt/doc/
                  named: YY_WW.plan

   History:
      ~15-apr-95 proto for demo (show_contacts overlay, planning)
       16-may-95 generic


sxt_plot_fov $SSW/yohkoh/sxt/idl/atest/sxt_plot_fov.pro
[Previous] [Next]
NAME:
	sxt_plot_fov
PURPOSE:
	To plot the locations of the PFI fields of views (FOV).
	The routine accepts either ROADMAP or INDEX.SXT
CALLING SEQUENCE:
	sxt_plot_fov, index  
	sxt_plot_fov, roadmap, sel, ss
INPUT:
	struct	- Either the ROADMAP or INDEX structure
OPTIONAL OUTPUT:
	selfov	- If present, the user is prompted to mark a box
		  selecting the "window" of interest.  The value
		  returned is an array of the same length as
		  the input array with the selected datasets
		  having a "1".  The way to use this value is
		  something like the following:
			ss = where(selfov)
			ss = where(selfov and (struct.percentd eq 255))
	ss	- Return the list of indicies that were selected.
		  This should be used only if you do not want to 
		  do other searches using the "where" function.
OPTIONAL INPUT:
	box	- If present, draw the size of the field of view.  
		  The summation mode is reflected in the box size.
	qstop	- If present, stop at the end (for debugging)
	img	- If present, after plotting the line plot, display the
		  image and the location of the PFI images on the sun
		  It allows the user to check the offset being used.
	nocmd	- If set, use the actual pointing information from the
		  PNT file, not the S/C commanded value.
 CALLS: ***
	GET_BOXCORN, TVPLOT, draw_boxcensiz [1], draw_boxcensiz [2], draw_boxcorn [1]
	draw_boxcorn [2], get_rb0p [1], get_rb0p [2], gt_center, gt_res, gt_shape
	sxt_cen [1], sxt_cen [2]
HISTORY:
	Written Oct-91 by M.Morrison
	20-Oct-91 (MDM) - Added /box, /img, and /sun2 options
	12-Nov-91 (MDM) - Added "ss" parameter option
	16-Nov-91 (MDM) - Changed to use GT_FOV_CENTER so that index
			  can be passed directly
	20-Nov-91 (MDM) - Put a temporary fix in because of GETSXTFOV 
			  error in OR PFIs
	28-Jan-93 (MDM) - Modified to use the expanded GT_FOV_CENTER
			  which does corrections done here before, and
			  corrects now for commanded pointing changes.
			- Removed SUN2 option
	14-Jul-93 (MDM) - Corrected IMG option
			- Use GT_CENTER instead of GT_FOV_CENTER
			- Allowed NOCMD option to use PNT pointing info
			- Use GT_SHAPE instead of GT_SHAPE_CMD
			- Replaced fixed solar radius with a call to GET_RB0P
	21-Jul-93 (MDM) - Added /OBS_REGION switch to GT_SHAPE so that the
			  observing region shape is displayed
	12-Sep-93 (SLF) - added skipfirst - if img and skipfirst, just do the
			  second plot (img overlayed) and dont prompt
        7-Feb-99  SLF  - more ssw like plot_fov (merged eventually)


sxt_postprep_cen $SSW/yohkoh/sxt/idl/util/sxt_postprep_cen.pro
[Previous] [Next]

 NAME
	sxt_postprep_cen
 PURPOSE
	To return the IDL CCD coordinates of the center of the sun after
	realignment with SXT_PREP.  Needed because SXT_CEN only returns the
	original unshifted sun center coordinates.
 CALLING SEQUENCE
	xy = sxt_postprep_cen(iout)
 INPUT
	iout, index structure with history record returned by SXT_PREP
 OUTPUT
	xy, [x,y] vector with the coordinates of the re-aligned sun.
 HISTORY
	96-Jan-01 LWA, Simple, one-liner:  -gt_corner(index,/from_sc).

 CALLS:


SXT_POWL $SSW/yohkoh/ucon/idl/mctiernan/sxt_powl.pro
[Previous] [Next]
 NAME: 
     SXT_POWL
 CALLING SEQUENCE:
     DN = sxt_powl(powl, date=date, /xxx)
 PURPOSE:
     generate responses for all SXT filters for a given power law
 INPUTS:
     powl = (gamma, flux @ 1 kev) (can be an array of (2, ntimes))
 OUTPUTS:
     CCD e's resulting from this power law (*,5)
     desired filter identified by
	0	Thin Al
	1	Dag
	2	Mg
	3	Thick Al
	4	Be
 KEYWORDS:
     date= the time in any yohkoh format, to be aware of the
           hole in the entrance filter
     xxx= if set, use the fsp stuff to do this, 
          nobody is allowed to use /xxx except for me, jmm
 CALLS: ***
	ADDTIME [1], ADDTIME [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	INTERPU_1D, Responses [1], Responses [2], Responses [3], concat_dir [4], fx_1pl
	fx_1th_lo, restgen [1], restgen [2]
 HISTORY:
     HSH, written 29-nov-92
     HSH, updated 18-jan-92 (vector input)
     HSH, 10-feb-92 changed output to full set
     jmm, 7-Mar-93 changed output to CCD electrons
     jmm, 15-may-95, updated to use most recent area data,
          added the date keyword, response is now in DN's/sec,
          if the input is a flux.


SXT_POWL_EBAR $SSW/yohkoh/ucon/idl/hudson/sxt_powl_ebar.pro
[Previous] [Next]
 NAME:
     SXT_POWL_EBAR
 PURPOSE:
     generate mean energy of SXT response to powerlaw
 CALLING SEQUENCE:
     sxt_powl_ebar(gamm, i)
 INTPUTS:
     gamm = power-law index
     desired filter, from the map
       0       Thin Al
       1       Dag
       2       Mg
       3       Thick Al
       4       Be
 OUTPUTS:
      ebar in keV
 CALLS: ***
	restgen [1], restgen [2]
 HISTORY:
     HSH, written 7-feb-93


SXT_POWL_NN $SSW/yohkoh/ucon/idl/nitta/sxt_powl_nn.pro
[Previous] [Next]
 NAME: 
     SXT_POWL_NN
 PURPOSE:
     generate responses for all SXT filters for a given power law
 INPUTS:
     powl = (gamma, flux @ 1 kev) (can be array)
 OUTPUTS:
     CCD e's resulting from this power law (*,5)
     desired filter identified by
	0	Thin Al
	1	Dag
	2	Mg
	3	Thick Al
	4	Be
 CALLS: ***
	restgen [1], restgen [2]
 HISTORY:
     HSH, written 29-nov-92
     HSH, updated 18-jan-92 (vector input)
     HSH, 10-feb-92 changed output to full set
     jmm, 7-Mar-93 changed output to CCD electrons
     NN, 13-JUN-95, changed the response file


SXT_PREP0 $SSW/yohkoh/sxt/idl/util/sxt_prep0.pro
[Previous] [Next]
 NAME:
       SXT_PREP0
 PURPOSE:
       Prepare SXT images for further processing:
		decompression, background subtraction, saturated pix (+1 above/
		below), temporal interpolation, rebin, exposure normalization.

	Will set negative values (after subtraction) to 0.
	Saturated pixels are flagged in satpix

       sxt_prep0, index, data, new_index, new_data
       sxt_prep0, index, data, new_index, new_data[, unc_data, satpix, sum=2]
       sxt_prep0, index, data, new_index, new_data[, ntimes=ntimes, subs=subs]
       sxt_prep0, index, data, new_index, new_data[, unc_data, satpix, /sparse]
       sxt_prep0, index, data, new_index, new_data, /norm     ; Normalize to 1s
       sxt_prep0, index, data, new_index, new_data, /register ; Simple alignment

 INPUTS:
	index	= index (structure)
	data	= 2-d or cube of SXT images.
 OUTPUTS:
	new_index = New index (structure)
	new_data  = New 2-d or cube of SXT images.
 OPTIONAL OUTPUTS:
	unc_data = Compression error
	satpix	= byte array same size as new_data.   Set to 1 if pixel is 
		  saturated.  If sum=1 or greater, satpix = number of saturated
		  pixels in the macro pixel.  If /sparse is specified,
		  satpix is returned as a "sparse" data structure.
 OPTIONAL INPUT KEYWORDS:
	sum	= Sum over SUM X SUM pixels (if vector, sum = [sumx,sumy])
	subs	= Subarray of images to process.
	ntimes	= If data is a cube and there are at least 2 images, interpolate
		  to the times given in ntimes (can be any standard Yohkoh 
		  format).  If subs is not given, will interpolate using all
		  available images in data cube.  If subs is present, will use
		  only the images given by subs to interpolate.
	sparse	= If set, return satpix as a "sparse" data structure (see
		  the header of the routine sparse.pro for more information).
	upper_only = If set, only flag +1 pixels above (in a column) the 
		  saturated area (not the -1 pixels) [see call to sxt_satpix].
	normalize = If set, renormalize to 1 sec exposures.
	register  = If set, will perform simple registration of the data set.
 OPTIONAL OUTPUT KEYWORDS:
	error	= Set to 1 if sxt_prep0 returns with an error.
 CALLS: ***
	ALIGN_AR, DOC_LIBRARY, exp_norm [1], exp_norm [2], fastdoc [1], fastdoc [2]
	leak_sub [1], leak_sub [2], leak_sub [3], sparse [1], sparse [2], sparse [3]
	sxt_decomp [1], sxt_decomp [2], sxt_interp [1], sxt_interp [2], sxt_satpix [1]
	sxt_satpix [2], sxt_sumxy, tbeep [1], tbeep [2], tbeep [3]
 RESTRICTIONS:
 PROCEDURE:
	o Calls leak_sub, sxt_decomp, sxt_satpix, sxt_interp, sxt_sumxy, 
	        align_ar, exp_norm
       o The registration portion of this routine fairly preliminary.
 MODIFICATION HISTORY:
	22-feb-93, J. Lemen,  LPARL, Written.
	26-feb-93, JRL, Changed satpix to positional and added /sparse keyword.
	 9-mar-93, JRL, Modularized the various sections.
	15-mar-93, JRL, Added /norm keyword (exp_norm)
	25-mar-93, JRL, Added /register keyword (align_ar)
	31-mar-93, JRL, if /norm set, renormalize unc_data array
	20-apr-93, JRL, if /norm is set, check if unc is required or not
       19-nov-93, JRL, Renamed to sxt_prep0 (should no longer be used)  --
			use MDM's new sxt_prep instead.


sxt_prep [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_prep.pro
[Previous] [Next]
NAME:
	sxt_prep
SAMPLE CALLING SEQUENCE:
	sxt_prep, input1, input2, index_out, data_out
	sxt_prep, index, data, index_out, data_out
	sxt_prep, infil, dset_arr, index_out, data_out, unc_data, satpix, $
			helio=[-9.8,-20.3], date_helio='14-JUN-92  02:37:41')
	sxt_prep, index, data, index_out, data_out, /helio, ref_image=10)
	sxt_prep, index, data, index_out, data_out, ref_image=spr_index(0))
	sxt_prep, index, data, index_out, data_out, /roll
	sxt_prep, index, data, index_out, data_out, new_sdc_db='/1p/acton/new_db'
       sxt_prep,<sprfile>,-1,oii,odd,/save_orhis ; save OR History to file
       sxt_prep,<sprfile>,-1,oii,odd,/get_orhis,or_his=or_his ; return OR HIS

PURPOSE:
	This is a general purpose routine to prepare the SXT data for
	analysis.  The steps performed are:
		1. Flag the saturated pixels
		2. Decompress the data
		3. Subtract the dark current
		4. Subtract the pin hole leak
		5. Remove the spikes from the images
		6. Apply the vignette correction
		7. Align the images and build the observing region.  The
		   routine can extract subportions out of FFI images
		8. Fill in the horizontal gaps in the observing region
		9. Exposure normalize
	It does not do the following items which the earlier version of
	SXT_PREP did do:
		*. Temporal interpolation

	Image to image registration is only performed if one of the following
	keywords is used:
		REGISTER
		SUNCOORD
		HELIO
		CCDCOORD
	Use only ONE of the following at one time (SUNCOORD, HELIO, CCDCOORD)
INPUT:
		  ** There are two methods for calling SXT_PREP **
	input1	- A. The index structure for each of the input images
		  B. The names of the input files
	input2	- A. The input data array
		  B. The dataset numbers to extract and process
OUTPUTS:
	data_out - The output data array
	index_out- The index structure for each output image
OPTIONAL OUTPUTS:
       unc_data- The uncertainty array for each image.  These are NON-
                 STATISTICAL errors and are caused by decompression errors
                 in the data, background and straylight images (where
                 applicable).  NO statistical errors are included.
		  See the routine SXT_DN_UNC to add in the photon statistics.

		  There are at least three non-statistical errors:
                       d_comp  = decompression error (sxt_decomp)
                       d_dark  = dark subtraction error (dark_sub)
                       d_reg   = Error from registration (align_prep)
				  (which will be included in the future)
                 sxt_prep returns sqrt(d_comp^2+d_dark^2+d_reg^2).
	satpix	- The saturated pixel map for the data extracted.  It is
		  a boolean data array with non-zero values for pixels which
		  were saturated in the original image.
OPTIONAL KEYWORD INPUTS:
		-------------------- Calibration Parameters --------------------
	dc_scalar- If set, then a simple scalar value is used for dark current 
		  subtraction. Default is to take the image closest in exposure.
	dc_interpolate - If set, then perform interpolation on the dark frame
		  images to get a better backround subtraction.  Deafult is to
		  take the image closest in exposure.
       dc_orbit_correct - If set, apply SDC Orbital Variation Correction
	upper_only - If set, only flag +1 pixels above (in a column) the
		  saturated area (not the -1 pixels) [see call to sxt_satpix].
	sfd_corr - If set, then the input image is an SFD image.  Use the
		  SFD decompression, perform the registration, and recompress
		  using the SFD compression.
	rest_low8 - If set, then call the routines to restore low-8 data.  
		  You must pass in low-8 along with compressed data.  You
		  will get restored images AND simple single compressed 
		  images as the output.
	
		-------------------- Alignment Parameters --------------------
	register - If set, then perform the registration and correct only for
		the S/C jitter.  See the /FAST option if you do not want
		to have sub-pixel registration performed.
	fast	- If set, then perform the registration in "FAST" mode which
		is simple full pixel shifts instead of POLY2D.

	ref_image - A single roadmap or index structure which will be used 
		to define the sun or heliocentric coordinates for alignment.  
		It can be the image number (subscript) of the images being
		extracted which should be used (not the absolute dataset 
		number within the images listed in "infil") 

	helio - the reference latitude and longitude for the alignment.
		This should be the position of the active region at some 
		time, preferably near the time it crossed closest to the 
		center of the disk.  If a sub-image is to be extracted, 
		HELIO specifies the center of the sub-image.
			helio(0) = longitude E/W (E is negative)
			helio(1) = latitude N/S (S is negative)
		It can be a non-zero scalar value if REF_IMAGE is passed in.
		In this case, the heliocentric coordinates are derived
		from "REF_IMAGE".
		DO NOT USE WITH SUNCOORD AND CCDCOORD.
	date_helio - the reference date/time for the heliocentric input.

	suncoord - The coordinates of the center of the portion to extract
		   in angular arcseconds relative to sun center.
			suncoord(0) = E-W coordinate (E is negative)
			suncoord(1) = N-S coordinate (S is negative)
		   DO NOT USE WITH HELIO AND CCDCOORD.

       ffi_shift - Shift location of FFI on frame without altering
                   roll.  In angular arcseconds relative to sun center.
                       suncoord(0) = E-W coordinate (E is negative)
                       suncoord(1) = N-S coordinate (S is negative)
                  DO NOT USE WITH HELIO AND CCDCOORD.

       ccdcoord - The FRE (full resolution CCD pixel equivalent) of the
                  center of the portion to extract
		   DO NOT USE WITH SUNCOORD AND HELIO

	outres- The resolution of the output image (0=FR, 1=HR, 2=QR).
		If not set, and the input is not all FFI, then convert all 
		to full res.  If all FFI, then set outres to the highest
		resolution of the input images (typically half resolution)  
		Only relevant if registering the images.
	outsize- The dimention of the ouptut image [#col, #lin]
		If it is a scalar value, it will make the #lin = #col
		If not set, it will make it the largest size of the input
		field of views.  If PFI and FFI are mixed, it will take
		the largest PFI.

	fill_gap - A gap can exist between two PFI strips for a single
		   observing region because of a change in S/C pointing.
		   If this variable is set, then the gap between the PFI
		   strips is filled by interpolating the lines above and below
	trim_edge - Used with /FILL_GAP.  If set, then replace the edge 
		  line of pixels as well as the gaps.  Will set /FILL_GAP 
		  if /TRIM_EDG is set.
	noroll	- If set, then do not perform roll corrections.  Currently the
		  default
	roll_do	- If set, then perform the corrections for the roll offset
       interp  - If set, roll correction uses bilinear interpolation
                 (See Description in IDL poly_2D documentation header)
	cubic   - If set, roll correction uses cubic convolution interpolation
                 (See Description in IDL poly_2D documentation header)
       oride_pnt_chk - If set, then do not compare the ATT/GET_SUNCENTER
                 results to the commanded values to see that they are
                 truly valid points.  This is useful for times when the
                 commanded pointing history file is not updated properly
                 or for real time applications when the commanded pointing
                 history is not updated yet.
       align_unc  - The uncertainties in alignment coordinates, a pair of
                 (x,y) in FR pixels. If set to any scalar, this will use
                 TEST_POLY to determine these values.  TEST_POLY fits the 
		  corner coordinates obtained from ALIGN_PREP to a polynomial 
		  of degree bewteen 1 to 10, and estimates the mean uncertainty 
		  from the fluctuations of the pointing coordinates around the 
		  smoothed values. 
			*** ALIGN_UNC is not available right now ***
                 

		-------------------- Secondary Processing Parameters ----------
	sum	- Sum over SUM X SUM pixels.  It must be a scalar value.
	exp_normalize - If set, normalize the count rates in the output image
		  to DN/sec/full_res_pixels.
	normalize- Same as EXP_NORM
       ssc_norm - normalize to Dn/sec/Image_pix (instead of historical 
                  normalization to full resolution pixels)
	
	vignette - If set, then apply the correction for the vignette
		  loss in signal off axis.  The function SXT_OFF_AXIS
		  is called to peform the correction.  For certain applications
		  it is recommended to use /FLOAT with this /VIGNETTE option.

		-------------------- Image Filtering Parameters ----------
	despike_thresh - Call DE_SPIKER to remove spikes from the image.  
		  This step is done before sub-pixel registration.
		  The value set on the call is passed into the function
		  DE_SPIKER as "threshold" (the first parameter)
	width	- If DESPIKE_THRESH is set, then pass this value through
		  to DE_SPIKER.  If SIGMA_FILT is set, then pass this value
		  through to the SIGMA_FILTER function.
	sigma_filt - Call the SIGMA_FILTER function with SIGMA_FILT as
		  the "box_width" variable.
	n_sigma	- If SIGMA_FILT is set, then pass this value through to
		  the function SIGMA_FILTER
	sigma_iterate - If SIGMA_FILT is set, then pass this value through 
		  to the function SIGMA_FILTER as keyword input "iterate"
       sxt_kleenx - OBSOLETE - w/V1.61, /SXT_KLEENX NOW IMPLIES /SXT_CLEANX
       sxt_cleanx - if set, call sxt_clean (with defaults and N_SIGMA )
       destreak - if set, run LWA destreaker (sxt_xsaa via sxt_clean)
       suture - if set, call sxt_suture (post processing loop)

		-------------------- Miscellaneous Parameters ----------
	float	-  If set, then make the output floating point (REAL*4)
	force_read - If set, read all datasets at once even if input was 
		  specified with INFIL/DSET.  This is available because doing 
		  LEAK_SUB on all images at once if the input is PFI is more 
		  efficient
	outfil	- If specified, the data will not be passed back in INDEX_OUT and
		  DATA_OUT.  Instead, it will be saved in an SDA file with the
		  name specified by this parameter. 
		  If "uncert" and "satpix" are included in the procedure call,
		  they will be saved with the same file name with a "_unc"
		  and a "_sat" appended to the file name.
	qdebug	- If set, display some diagnostic messages
	qstop	- If set, stop execution inside this subroutine (for debugging)
	nocorrections- This keyword is intended for debugging purposes and should
		  not be used.  If set, then LEAK_SUB is not called.  LEAK_SUB
		  will automatically not be called if the input data is of
		  non-byte type.
	help	- If set, then display the help file /ys/sxt/doc/sxt_prep.txt
	allow_duplicates  - If set, then do not do the serial number check to
		  combine observing region PFIs into one image (ie: if the same
		  image comes in twice in the input, make it show up twice
		  in the output)
	new_sdc_db - Optionally pass the the directory where an alternate
		  dark current database reside.  RECOMMENDED FOR EXPERTS ONLY.
		  See the routine SET_NEW_DB for details.  SXT_PREP resets
		  to the official database directory before returning
	new_sfc_db - Same as "new_sdc_db" except for leak database
       
       loud/verbose (synonyms) - if set, generate lots of messages
       (6-mar-2003 - slf; changed defaults to be quieter)
	/quiet  - Don't print the 'SXT_PREP took:' message.
       get_orhis - (switch) - if set -and- spr/pfi input, return
                 pfi/OR history (1 record per assembled OR)
       save_orhis - if set, (implies /GET_ORHIS), save the OR info to
                  a genx file (pfi times, leak, and foc center info)
                  (if save_orhis is a string, assumed path for output)
       OR_HIS (output) - returns assembled OR history info, 1 struct/OR

OPTIONAL KEYWORD OUTPUTS:
	error	- Error information.  
			0 - No errors
			1 - "index" and "data" input parameters are undefined
			2 - "index" and "data" data types are incorrect
	run_time - The number of minutes that SXT_PREP took
	st_en_lin - The start/end line number where each PFI strip is inserted 
		    into the output array.  It is 2 x # PFI Strips x # output 
		    images.
METHOD
	When running YODAT, the user should NOT have the observing regions
	assembled.  This routine will perform dark subtraction on each 
	individual exposure and will align each PFI strip independently.

	-------------------- Calibration Options --------------------
	Decompression, dark_sub, leak_sub, sxt_deleak

	-------------------- Alignment Option --------------------
	To align the images.  User can specify
		(1) heliocentric coordinates for a given time/date
		    (corrects for solar differential rotation and S/C drift)
		(2) the fixed coordinates relative to sun center in arcmin
		    (corrects for S/C drift)
		(3) simple CCD coordinates (probably only used when
		    assembling observing regions, but want to do background
		    subtraction first) (would not take out S/C drift)
	The images are all changed to full resolution, and the signal is
	scaled accordingly (an image converted from HR to FR has the signal
	divided by 4 because there are 4 times more pixels now.  The total
	signal is preserved)

 CALLED BY:
	FIX_SFD, GET_LC, SFD_DIFF, SXT_HYST, SXT_QLOOK, SXT_TEEM1 [1], SXT_TEEM1 [2]
	SXT_TEEM1 [3], WL_CUBE_II, box_sxthxt_fsp, mk_spd, mk_ssc [1], mk_ssc [2]
	rest_low8_ffi, sacpeak_image, sxt_av_teem, sxt_average, sxt_clean [1]
	sxt_clean [2], sxt_combine, sxt_composite [1], sxt_composite [2]
	sxt_composite [3], sxt_fl_analxpro, sxt_fsp, sxt_mauna, sxt_prep2
	sxt_sff_composite [1], sxt_sff_composite [2], sxt_ssc2sss, sxt_ssc_rationalize
	sxt_ssn2fits [1], sxt_ssn2fits [2], sxt_tfl, sxt_tflx, sxt_thfsp, sxtbox_fsp
	sxtbox_teem, sxthxt_fsp
	NOTE: When using the registration options (/REG, /HELIO, SUNCOORD)
	  sub-pixel registration will be performed using POLY2D.  This could
	  cause the image to appear to be smeared.  For example, if there is
	  a single pixel bright spot (solar flare or dark spike).  If there
	  is a 0.5 pixel east/west shift to register it to other images, half 
	  of the pixel intensity is left in the original pixel and half is 
	  moved to the adjacent pixel.
 CALLS: ***
	BOX_MESSAGE, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1]
	CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], HIS_EXIST, RD_XDA [1], RD_XDA [2]
	ROT, TIME2FILE, align1img [1], align1img [2], align_prep [1], align_prep [2]
	align_prep [3], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	big_smooth [1], big_smooth [2], break_file [4], concat_dir [4], curdir [1]
	curdir [2], data_chk [1], data_chk [2], data_type [1], data_type [2]
	de_spiker [1], de_spiker [2], exp_norm [1], exp_norm [2], file_exist [1]
	file_exist [3], fmt_tim [1], fmt_tim [2], get_info [1], get_info [2], get_info [3]
	get_info [4], get_logenv [1], get_logenv [2], get_roll, get_yo_dates [1]
	get_yo_dates [2], get_yo_dates [3], gt_comp, gt_corner, gt_or_expnum, gt_pfi_ffi
	gt_pix_size, gt_res, gt_shape, gt_tagval [1], gt_tagval [2], his_index
	int2secarr [1], int2secarr [2], interp_or, leak_sub [1], leak_sub [2]
	leak_sub [3], mk_dset_str [1], mk_dset_str [2], mnr_frm_fix, prstr [1], prstr [2]
	rd_tfile [1], rd_tfile [2], rest_low8_cube [1], rest_low8_cube [2]
	rest_low8_ffi, sav_sda [1], sav_sda [2], sav_sda [3], savegenx, sel_leak_image [1]
	sel_leak_image [2], sel_leak_image [3], sel_leak_image [4], set_logenv [1]
	set_logenv [2], set_new_db, sfd_decomp, str_copy_tags [1], str_copy_tags [2]
	str_copy_tags [3], str_copy_tags [4], str_replace [1], str_replace [2]
	sxt_clean [1], sxt_clean [2], sxt_decomp [1], sxt_decomp [2], sxt_deleak [1]
	sxt_deleak [2], sxt_off_axis, sxt_orhis, sxt_satpix [1], sxt_satpix [2]
	sxt_suture [1], sxt_suture [2], tbeep [1], tbeep [2], tbeep [3], tim2dset [1]
	tim2dset [2], uniqo [1], uniqo [2]
RESTRICTIONS:

HISTORY:
	Written 16-Aug-93 by M.Morrison using and merging:
		ALIGN_PFI (which used  Metcalf ALIGN_AR as starting point)
		SXT_PREP (JRL 20-Apr-93 version)
V1.03	   Aug-93 (MDM)
V1.04	31-Aug-93 (MDM) - Various patches
			- Added RUN_TIME option
V1.05	 3-Sep-93 (MDM) - Adjusted the documentation header some
			- Changed the alignment code to always use ALIGN1IMG
			  for all combinations of PFI/FFI
			- Renamed keyword EXP_NORM to EXP_NORMALIZE
	 8-Sep-93 (SLF) - add append keyword (for sav_sda call)
V1.06	15-Sep-93 (MDM) - Added print statement on what version of SXT_PREP
			  is being run
			- Changed so that the sat pixel registration is
			  done properly (sub pixel, sub-DN problem)
			- Made the "uncert" data output type byte
	16-Sep-93 (MDM)	- Added NORM_FACT switch to ALIGN1IMG call for
			  satpix and uncert data.
V1.07	22-Sep-93 (MDM) - Corrected error in the /NORM option (it was not
			  working at all)
			- Corrected error in the /FILL_GAP option
V1.08	 1-Oct-93 (MDM) - Minor modification to recognize when registration
			  is requested.
V1.09	 6-Oct-93 (MDM) - Modified so that when not using the /REGISTER option
			  the output size is determined in originally summed
			  pixels (not Full res pixels)
V1.10	11-Oct-93 (MDM) - Corrected for the case where an OR is assembled but
			  /REGISTER is not used.  It was not saving the corner
			  or new shape properly.
V1.11	13-Oct-93 (MDM) - Enabled DC_INTERPOLATE and DC_SCALAR options
V1.12	15-Oct-93 (MDM) - Corrected for problem when registering the BYTE
			  uncertainty array
	15-Nov-93 (MDM) - Modified the header information 
V1.13	18-Nov-93 (MDM) - Patched an error in EXT_SUBIMG3 which was resulting in
			  poorly aligned images.  Problem was in rounding off
			  between integers and reals
	19-Nov-93 (MDM) - Modified to make the output data type BYTE when using
			  the /SFD_CORR option
V1.14	24-Nov-93 (MDM) - Corrected error with OR assembly.  The problem was
			  with EXT_SUBIMG3.  Added the /TRIM option inside
			  the ALIGN1IMG call.
			- Modified to record the actual percent of data present
			  when doing the observing region assembly.
V1.15	30-Nov-93 (MDM) - Renamed from SXT_PREP2 to SXT_PREP (Jim's original
			  SXT_PREP is renamed to SXT_PREP0)
	 1-Dec-93 (MDM) - Added /QMSTOP option (stop within the per image loop)
V1.16	 3-Dec-93 (MDM) - Modified so that when MOD_RES is called with an SFD
			  image, the signal is not changed.
			  Added "norm_fact=qsfd" to ALIGN1IMG call because the 
			  signal level of SFD images are all normalized to 
			  DN/sec/HR pixels
V1.17	 6-Dec-93 (MDM) - Protected against different index version numbers
			  when inserting into the INDEX_OUT array.
V1.18	 9-Dec-93 (MDM) - Modified so that when all input is FFI and /HELIO
			  option, and outsize is not specified, then default
			  to 128x128.
			- Modified "automatic forced reading" (which happens
			  if the input is a file, all SPR) so that it does not
			  occur if the amount of data is over 4 megabytes.
V1.19	10-Dec-93 (MDM) - Added /Q2STOP
			- Corrected V1.14 mod to properly record the actual 
			  percent of data present when doing the observing 
			  region assembly.
V1.20	 4-Jan-94 (MDM) - **** IMPORTANT MODIFICATIONS ****
			- Adjust the optical images to be aligned to the
			  x-ray images
			- Incorporated the S/C roll into the correction
V1.21	 5-Jan-94 (MDM) - Made the default not to perform the roll correction
			- Modifed roll correction to make the sun center the
			  pivot location instead of a fixed point
V1.22	14-Jan-94 (MDM) - Modified to do the roll correction outside of
			  ALIGN1IMG and to do it after all OR parts are
			  put together.
V1.23	17-Jan-94 (MDM) - Corrected roll option to only be done if asked for
V1.24	31-Jan-94 (MDM) - Corrected some of the /FILL_GAP capabilities
			- Added /TRIM_EDGE option
V1.25	 8-Feb-94 (MDM) - Corrected selection of the alignment location
			  Previously, the location took into account the
			  SXT roll, even if the roll correction was not
			  being selected.  It resulted in images not quite
			  filling the output data cube (there was a gap on
			  the edge with zero data).  The coordinates being
			  saved were correct though.
V1.26	21-Feb-94 (MDM) - Added /ORIDE_PNT_CHK to optionally not compare the
                         ATT/GET_SUNCENTER results to the commanded values to see
                         that they are truly valid points
V1.27	22-Feb-94 (SLF/MDM) - Reincorporated SLF changes of 15-Feb-94 which
			  added /INTERP and /CUBIC keywords and function
	22-Feb-94 (MDM) - Added /FAST options for simple pixel registration
V1.28	25-Feb-94 (MDM) - Added check to see what the resolutions are when
			  using the /NOCORR option.  It returns if they are
			  not all the same resolution, and sets OUTRES if
			  they are all the same resolution.
V1.29	 8-Mar-94 (MDM) - Added logging of the fact that roll corrections
			  were applied
V1.30	30-Mar-94 (MDM) - Modified to get the shape using GT_SHAPE with
			  the /OBS_REGION switch instead of using GT_SHAPE_CMD
			- Added information on "uncert" and "satpix" to the
			  header.
V1.31	31-Mar-94 (MDM) - Adjusted logic so that you could do a roll correction
			  without doing a registration correction
			- The 14-Jan-94 mod caused the roll correction logging
			  to not be done properly.  It was fixed.
			- Log the roll value in .SUN_CENTER even if registration
			  was not done
V1.32	20-Jun-94 (MDM) - Modified so that registration is done if /ROLL is set
	25-Jul-94 (MDM) - Modified the header document
			- Added check that only one of SUNCOORD, CCDCOORD and 
			  HELIO are used in the call.
V1.33	19-Sep-94 (MDM) - Corrected an error which was causing the images to be
			  shifted by 0.5 pixels when the ref_image option was 
			  being used.  Image to image registration is not 
			  affected and the absolute coordinate is not affected 
			  (it recorded the value 0.5 pixels off of what was 
			  really wanted).  SXT_PREP was doing sub-pixel shifts 
			  when not wanted which was causing the image to be 
			  smeared unncessarily.
			- Added header information (about sub-pixel image smear)
	14-Nov-94 (MDM) - Modified to set /REGISTER when CCDCOORD is passed in.
	15-Dec-94 (MDM) - Updated header information (discouraged use of
			  the /NOCORRECTIONS keyword)
       12-Feb-95 (JMM) - Added uncertainties obtained from LEAK_SUB/DARK_SUB
V1.40	27-Feb-95 (MDM) - Put McTiernan additions on-line
V1.41	 6-Mar-95 (MDM) - Made UNC_DATA floating if /NORM is set
V1.50	20-Mar-95 (MDM) - Added /VIGNETTE switch
			- Added /DESPIKE_THRESH switch
			- Added /SIGMA and /WIDTH switch
			- Made /DC_INTERPOLATE the Default *************
			- Added /FLOAT switch
			- Changed to make OUTRES equal to the highest
			  resolution of the input if OUTRES is not specified
			  and OUTSIZ is not specified
			- Added /HELP switch
V1.51	20-Mar-95 (MDM) - Pass the /FLOAT switch to LEAK_SUB
	22-Mar-95 (MDM) - Fixed typo /DC_INTREPOLATE versus /DC_INTERPOLATE
V1.52	23-Mar-95 (MDM) - Added /REST_LOW8 option to retore low-8 data.
	10-Apr-95 (MDM) - Added documentation header information (on UNC_DATA)
	11-Apr-95 (MDM) - Added typout=2 for low8 with /nocorr
	19-Apr-95 (MDM) - Modified the documenation header (on UNC_DATA)
V1.53	18-May-95 (MDM) - Added /ALLOW_DUPLICATES keyword
			- Added NEW_SDC_DB and NEW_SFC_DB keywords
V1.54	22-Jun-95 (MDM) - Trap and dis-allow /ROLL_DO with CCDCOORD
V1.55	 1-Sep-95 (MDM) - Fixed the UNC_DATA rotated results be saved in 
			  "udata0" temporarily instead of directly into 
			  "unc_data" array so that OUTFIL option works properly
V1.56   1-Feb-98 (SLF) - add DC_ORBIT_CORRECT and NO_DC_ORBIT_CORRECT (->leak_sub)
V1.57  19-Feb-98 (SLF) - make 1-feb change work for file input option
V1.58  16-Sep-98 (SLF) - add /sxt_kleenx 
V1.58  20-Nov-98 (DMcK)- put in odd/even test of outsize, in Alignment
                       section, in derivation of xc,yc. Intended to
                       make patch of 19-Sep-94 work for all values of
                       OUTSIZE.
V1.59  28-Jan-99 (SLF) - merged SLF and DMcK divergent V1.58 mods
V1.60  21-Mar-99 (SLF) - add /sxt_cleanx (recommended over SXT_KLEEN)
                         /destreak (pass->sxt_clean,/xsaa)
V1.61  14-Jun-99 (SLF) - made /sxt_kleen obsolete (now implies /sxt_clean)
V1.62  26-Oct-99 (SLF) - add /NOLEAK keyword and function
V1.63  10-Jan-2000 (SLF) - add /SECOND_ORDER_LEAK (call sxt_deak)
V1.64  25-Apr-2001 (SLF) - add /SUTURE (call sxt_suture)
V1.65   6-mar-2003 (SLF) - add /LOUD & /VERBOSE and made default quieter
V1.66   6-Jan-2004 (LWA) - made sxt_clean message subject to /loud.
V1.67  10-Jan-2004 (LWA) - Commented out second_order_leak from leak_sub and
			put it after sxt_clean.
V1.68  12-Jan-2004 (LWA) - Do not do sxt_deleak if before filter fail epochs.
V1.69  16-Jan-2004 (LWA) - Revise satpix with med_smooth if sxt_clean.
	20-Jan-2004 (LWA) - Only revise satpix if qsatpix is set.
V1.70  27-Jan-2004 (LWA) - Added minor frame missing test to call of sxt_clean.
V1.71  29-Jan-2004 (SLF) - remove extraneous leak sub history and set
                           second-order history flag as appropriate     
V1.72  26-Mar-2004 (SLF) - check sxt_deleak status (YN keyword) to 
                           set or NOT-set 2nd order leak correction flag 
V1.73  14-Jul-2004 (SLF) - add /SSC_NORM keyword+function
V1.74	30-Jul-2004 (LWA) - Set 170 DN missing minor frames to 0 DN.
       30-Aug-2004 (LWA) - Corrected bug that caused loud=0 to prevent
			    automatic setting of dc_interoplate.
       17-Sep-2004 (Aki Takeda) - Fixed erroneous calls to rest_low8.
	 2-Nov-2004 (LWA) - Added /quiet to eliminate 'SXT_PREP took:' message.
V1.75   2-Nov-2004 (LWA) - Added code to handle low8 restoration for FFIs.
	20-Jan-2005 (LWA) - Test for leak image before doing sxt_deleak.
	24-Feb-2005 (Aki T) - Low8: avoid returning for data with only low8s.  
       11-Apr-2005 (SLF) - alter low8 logic (ie, make it work...)
V1.80  13-Apr-2005 (SLF) - more low8 madness - this time for sure
       11-Nov-2005 (LWA) - Improved satpix for /sxt_cleanx (Line 971).
V1.81  12-Nov-2005 (LWA) - Added keyword ffi_shift and incremented version.
        7-Feb-2006 (LWA) - Now set qreg when ffi_shift (dumb blunder).
       16-May-2006 (LWA) - Line 999:  pver = pver + (2^15 * (second_done ne 0))
                           Removed troublesome dot (15. --> 15).
V1.80   2-May-2006 (SLF) - add /GET_ORHIS, /SAVE_ORHIS & OR_HIS keywords
                           and function (based on previous investigation)
                           Calls to sxt_orhis.pro function
V1.81   8-May-2006(SLF) - use $ydb/orhis/ for /SAVE_ORHIS if not otherwise
                          specified
V2.0    7-Jun-2006 (SLF) - merge OR-HIST mods -> divergent versions
	13-Jul-2006 (Aki T) - Exposure normalizaion : uncertainty arrays
                               should be float type. (FIX(...+0.5) removed.)


sxt_prep [2] $SSW/yohkoh/sxt/idl/atest/sxt_prep.pro
[Previous] [Next]
NAME:
	sxt_prep
SAMPLE CALLING SEQUENCE:
	sxt_prep, input1, input2, index_out, data_out
	sxt_prep, index, data, index_out, data_out
	sxt_prep, infil, dset_arr, index_out, data_out, unc_data, satpix, $
			helio=[-9.8,-20.3], date_helio='14-JUN-92  02:37:41')
	sxt_prep, index, data, index_out, data_out, /helio, ref_image=10)
	sxt_prep, index, data, index_out, data_out, ref_image=spr_index(0))
	sxt_prep, index, data, index_out, data_out, /roll
	sxt_prep, index, data, index_out, data_out, new_sdc_db='/1p/acton/new_db'
PURPOSE:
	This is a general purpose routine to prepare the SXT data for
	analysis.  The steps performed are:
		1. Flag the saturated pixels
		2. Decompress the data
		3. Subtract the dark current
		4. Subtract the pin hole leak
		5. Remove the spikes from the images
		6. Apply the vignette correction
		7. Align the images and build the observing region.  The
		   routine can extract subportions out of FFI images
		8. Fill in the horizontal gaps in the observing region
		9. Exposure normalize
	It does not do the following items which the earlier version of
	SXT_PREP did do:
		*. Temporal interpolation

	Image to image registration is only performed if one of the following
	keywords is used:
		REGISTER
		SUNCOORD
		HELIO
		CCDCOORD
	Use only ONE of the following at one time (SUNCOORD, HELIO, CCDCOORD)
INPUT:
		  ** There are two methods for calling SXT_PREP **
	input1	- A. The index structure for each of the input images
		  B. The names of the input files
	input2	- A. The input data array
		  B. The dataset numbers to extract and process
OUTPUTS:
	data_out - The output data array
	index_out- The index structure for each output image
OPTIONAL OUTPUTS:
       unc_data- The uncertainty array for each image.  These are NON-
                 STATISTICAL errors and are caused by decompression errors
                 in the data, background and straylight images (where
                 applicable).  NO statistical errors are included.
		  See the routine SXT_DN_UNC to add in the photon statistics.

		  There are at least three non-statistical errors:
                       d_comp  = decompression error (sxt_decomp)
                       d_dark  = dark subtraction error (dark_sub)
                       d_reg   = Error from registration (align_prep)
				  (which will be included in the future)
                 sxt_prep returns sqrt(d_comp^2+d_dark^2+d_reg^2).
	satpix	- The saturated pixel map for the data extracted.  It is
		  a boolean data array with non-zero values for pixels which
		  were saturated in the original image.
OPTIONAL KEYWORD INPUTS:
		-------------------- Calibration Parameters --------------------
	dc_scalar- If set, then a simple scalar value is used for dark current 
		  subtraction. Default is to take the image closest in exposure.
	dc_interpolate - If set, then perform interpolation on the dark frame
		  images to get a better backround subtraction.  Deafult is to
		  take the image closest in exposure.
       dc_orbit_correct - If set, apply SDC Orbital Variation Correction
	upper_only - If set, only flag +1 pixels above (in a column) the
		  saturated area (not the -1 pixels) [see call to sxt_satpix].
	sfd_corr - If set, then the input image is an SFD image.  Use the
		  SFD decompression, perform the registration, and recompress
		  using the SFD compression.
	rest_low8 - If set, then call the routines to restore low-8 data.  
		  You must pass in low-8 along with compressed data.  You
		  will get restored images AND simple single compressed 
		  images as the output.
	
		-------------------- Alignment Parameters --------------------
	register - If set, then perform the registration and correct only for
		the S/C jitter.  See the /FAST option if you do not want
		to have sub-pixel registration performed.
	fast	- If set, then perform the registration in "FAST" mode which
		is simple full pixel shifts instead of POLY2D.

	ref_image - A single roadmap or index structure which will be used 
		to define the sun or heliocentric coordinates for alignment.  
		It can be the image number (subscript) of the images being
		extracted which should be used (not the absolute dataset 
		number within the images listed in "infil") 

	helio - the reference latitude and longitude for the alignment.
		This should be the position of the active region at some 
		time, preferably near the time it crossed closest to the 
		center of the disk.  If a sub-image is to be extracted, 
		HELIO specifies the center of the sub-image.
			helio(0) = longitude E/W (E is negative)
			helio(1) = latitude N/S (S is negative)
		It can be a non-zero scalar value if REF_IMAGE is passed in.
		In this case, the heliocentric coordinates are derived
		from "REF_IMAGE".
		DO NOT USE WITH SUNCOORD AND CCDCOORD.
	date_helio - the reference date/time for the heliocentric input.

	suncoord - The coordinates of the center of the portion to extract
		   in angular arcseconds relative to sun center.
			suncoord(0) = E-W coordinate (E is negative)
			suncoord(1) = N-S coordinate (S is negative)
		   DO NOT USE WITH HELIO AND CCDCOORD.

       ccdcoord - The FRE (full resolution CCD pixel equivalent) of the
                  center of the portion to extract
		   DO NOT USE WITH SUNCOORD AND HELIO

	outres- The resolution of the output image (0=FR, 1=HR, 2=QR).
		If not set, and the input is not all FFI, then convert all 
		to full res.  If all FFI, then set outres to the highest
		resolution of the input images (typically half resolution)  
		Only relevant if registering the images.
	outsize- The dimention of the ouptut image [#col, #lin]
		If it is a scalar value, it will make the #lin = #col
		If not set, it will make it the largest size of the input
		field of views.  If PFI and FFI are mixed, it will take
		the largest PFI.

	fill_gap - A gap can exist between two PFI strips for a single
		   observing region because of a change in S/C pointing.
		   If this variable is set, then the gap between the PFI
		   strips is filled by interpolating the lines above and below
	trim_edge - Used with /FILL_GAP.  If set, then replace the edge 
		  line of pixels as well as the gaps.  Will set /FILL_GAP 
		  if /TRIM_EDG is set.
	noroll	- If set, then do not perform roll corrections.  Currently the
		  default
	roll_do	- If set, then perform the corrections for the roll offset
       interp  - If set, roll correction uses bilinear interpolation
                 (See Description in IDL poly_2D documentation header)
	cubic   - If set, roll correction uses cubic convolution interpolation
                 (See Description in IDL poly_2D documentation header)
       oride_pnt_chk - If set, then do not compare the ATT/GET_SUNCENTER
                 results to the commanded values to see that they are
                 truly valid points.  This is useful for times when the
                 commanded pointing history file is not updated properly
                 or for real time applications when the commanded pointing
                 history is not updated yet.
       align_unc  - The uncertainties in alignment coordinates, a pair of
                 (x,y) in FR pixels. If set to any scalar, this will use
                 TEST_POLY to determine these values.  TEST_POLY fits the 
		  corner coordinates obtained from ALIGN_PREP to a polynomial 
		  of degree bewteen 1 to 10, and estimates the mean uncertainty 
		  from the fluctuations of the pointing coordinates around the 
		  smoothed values. 
			*** ALIGN_UNC is not available right now ***
                 

		-------------------- Secondary Processing Parameters ----------
	sum	- Sum over SUM X SUM pixels.  It must be a scalar value.
	exp_normalize - If set, normalize the count rates in the output image
		  to DN/sec/full_res_pixels.
	normalize- Same as EXP_NORM
	
	vignette - If set, then apply the correction for the vignette
		  loss in signal off axis.  The function SXT_OFF_AXIS
		  is called to peform the correction.  For certain applications
		  it is recommended to use /FLOAT with this /VIGNETTE option.

		-------------------- Image Filtering Parameters ----------
	despike_thresh - Call DE_SPIKER to remove spikes from the image.  
		  This step is done before sub-pixel registration.
		  The value set on the call is passed into the function
		  DE_SPIKER as "threshold" (the first parameter)
	width	- If DESPIKE_THRESH is set, then pass this value through
		  to DE_SPIKER.  If SIGMA_FILT is set, then pass this value
		  through to the SIGMA_FILTER function.
	sigma_filt - Call the SIGMA_FILTER function with SIGMA_FILT as
		  the "box_width" variable.
	n_sigma	- If SIGMA_FILT is set, then pass this value through to
		  the function SIGMA_FILTER
	sigma_iterate - If SIGMA_FILT is set, then pass this value through 
		  to the function SIGMA_FILTER as keyword input "iterate"
       sxt_kleenx - OBSOLETE - w/V1.61, /SXT_KLEENX NOW IMPLIES /SXT_CLEANX
       sxt_cleanx - if set, call sxt_clean (with defaults and N_SIGMA )
       destreak - if set, run LWA destreaker (sxt_xsaa via sxt_clean)
       suture - if set, call sxt_suture (post processing loop)

		-------------------- Miscellaneous Parameters ----------
	float	-  If set, then make the output floating point (REAL*4)
	force_read - If set, read all datasets at once even if input was 
		  specified with INFIL/DSET.  This is available because doing 
		  LEAK_SUB on all images at once if the input is PFI is more 
		  efficient
	outfil	- If specified, the data will not be passed back in INDEX_OUT and
		  DATA_OUT.  Instead, it will be saved in an SDA file with the
		  name specified by this parameter. 
		  If "uncert" and "satpix" are included in the procedure call,
		  they will be saved with the same file name with a "_unc"
		  and a "_sat" appended to the file name.
	qdebug	- If set, display some diagnostic messages
	qstop	- If set, stop execution inside this subroutine (for debugging)
	nocorrections- This keyword is intended for debugging purposes and should
		  not be used.  If set, then LEAK_SUB is not called.  LEAK_SUB
		  will automatically not be called if the input data is of
		  non-byte type.
	help	- If set, then display the help file /ys/sxt/doc/sxt_prep.txt
	allow_duplicates  - If set, then do not do the serial number check to
		  combine observing region PFIs into one image (ie: if the same
		  image comes in twice in the input, make it show up twice
		  in the output)
	new_sdc_db - Optionally pass the the directory where an alternate
		  dark current database reside.  RECOMMENDED FOR EXPERTS ONLY.
		  See the routine SET_NEW_DB for details.  SXT_PREP resets
		  to the official database directory before returning
	new_sfc_db - Same as "new_sdc_db" except for leak database
       
       loud/verbose (synonyms) - if set, generate lots of messages
       (6-mar-2003 - slf; changed defaults to be quieter)
OPTIONAL KEYWORD OUTPUTS:
	error	- Error information.  
			0 - No errors
			1 - "index" and "data" input parameters are undefined
			2 - "index" and "data" data types are incorrect
	run_time - The number of minutes that SXT_PREP took
	st_en_lin - The start/end line number where each PFI strip is inserted 
		    into the output array.  It is 2 x # PFI Strips x # output 
		    images.
METHOD
	When running YODAT, the user should NOT have the observing regions
	assembled.  This routine will perform dark subtraction on each 
	individual exposure and will align each PFI strip independently.

	-------------------- Calibration Options --------------------
	Decompression, dark_sub, leak_sub, sxt_deleak

	-------------------- Alignment Option --------------------
	To align the images.  User can specify
		(1) heliocentric coordinates for a given time/date
		    (corrects for solar differential rotation and S/C drift)
		(2) the fixed coordinates relative to sun center in arcmin
		    (corrects for S/C drift)
		(3) simple CCD coordinates (probably only used when
		    assembling observing regions, but want to do background
		    subtraction first) (would not take out S/C drift)
	The images are all changed to full resolution, and the signal is
	scaled accordingly (an image converted from HR to FR has the signal
	divided by 4 because there are 4 times more pixels now.  The total
	signal is preserved)

 CALLED BY:
	FIX_SFD, GET_LC, SFD_DIFF, SXT_HYST, SXT_QLOOK, SXT_TEEM1 [1], SXT_TEEM1 [2]
	SXT_TEEM1 [3], WL_CUBE_II, box_sxthxt_fsp, mk_spd, mk_ssc [1], mk_ssc [2]
	rest_low8_ffi, sacpeak_image, sxt_av_teem, sxt_average, sxt_clean [1]
	sxt_clean [2], sxt_combine, sxt_composite [1], sxt_composite [2]
	sxt_composite [3], sxt_fl_analxpro, sxt_fsp, sxt_mauna, sxt_prep2
	sxt_sff_composite [1], sxt_sff_composite [2], sxt_ssc2sss, sxt_ssc_rationalize
	sxt_ssn2fits [1], sxt_ssn2fits [2], sxt_tfl, sxt_tflx, sxt_thfsp, sxtbox_fsp
	sxtbox_teem, sxthxt_fsp
	NOTE: When using the registration options (/REG, /HELIO, SUNCOORD)
	  sub-pixel registration will be performed using POLY2D.  This could
	  cause the image to appear to be smeared.  For example, if there is
	  a single pixel bright spot (solar flare or dark spike).  If there
	  is a 0.5 pixel east/west shift to register it to other images, half 
	  of the pixel intensity is left in the original pixel and half is 
	  moved to the adjacent pixel.
 CALLS: ***
	BOX_MESSAGE, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1]
	CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], HIS_EXIST, RD_XDA [1], RD_XDA [2]
	ROT, TIME2FILE, align1img [1], align1img [2], align_prep [1], align_prep [2]
	align_prep [3], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	big_smooth [1], big_smooth [2], break_file [4], concat_dir [4], curdir [1]
	curdir [2], data_chk [1], data_chk [2], data_type [1], data_type [2]
	de_spiker [1], de_spiker [2], exp_norm [1], exp_norm [2], file_exist [1]
	file_exist [3], fmt_tim [1], fmt_tim [2], get_info [1], get_info [2], get_info [3]
	get_info [4], get_logenv [1], get_logenv [2], get_roll, get_yo_dates [1]
	get_yo_dates [2], get_yo_dates [3], gt_comp, gt_corner, gt_or_expnum, gt_pfi_ffi
	gt_pix_size, gt_res, gt_shape, gt_tagval [1], gt_tagval [2], his_index
	int2secarr [1], int2secarr [2], interp_or, leak_sub [1], leak_sub [2]
	leak_sub [3], mk_dset_str [1], mk_dset_str [2], mnr_frm_fix, prstr [1], prstr [2]
	rd_tfile [1], rd_tfile [2], rest_low8_cube [1], rest_low8_cube [2]
	rest_low8_ffi, sav_sda [1], sav_sda [2], sav_sda [3], savegenx, sel_leak_image [1]
	sel_leak_image [2], sel_leak_image [3], sel_leak_image [4], set_logenv [1]
	set_logenv [2], set_new_db, sfd_decomp, str_copy_tags [1], str_copy_tags [2]
	str_copy_tags [3], str_copy_tags [4], str_replace [1], str_replace [2]
	sxt_clean [1], sxt_clean [2], sxt_decomp [1], sxt_decomp [2], sxt_deleak [1]
	sxt_deleak [2], sxt_off_axis, sxt_orhis, sxt_satpix [1], sxt_satpix [2]
	sxt_suture [1], sxt_suture [2], tbeep [1], tbeep [2], tbeep [3], tim2dset [1]
	tim2dset [2], uniqo [1], uniqo [2]
RESTRICTIONS:

HISTORY:
	Written 16-Aug-93 by M.Morrison using and merging:
		ALIGN_PFI (which used  Metcalf ALIGN_AR as starting point)
		SXT_PREP (JRL 20-Apr-93 version)
V1.03	   Aug-93 (MDM)
V1.04	31-Aug-93 (MDM) - Various patches
			- Added RUN_TIME option
V1.05	 3-Sep-93 (MDM) - Adjusted the documentation header some
			- Changed the alignment code to always use ALIGN1IMG
			  for all combinations of PFI/FFI
			- Renamed keyword EXP_NORM to EXP_NORMALIZE
	 8-Sep-93 (SLF) - add append keyword (for sav_sda call)
V1.06	15-Sep-93 (MDM) - Added print statement on what version of SXT_PREP
			  is being run
			- Changed so that the sat pixel registration is
			  done properly (sub pixel, sub-DN problem)
			- Made the "uncert" data output type byte
	16-Sep-93 (MDM)	- Added NORM_FACT switch to ALIGN1IMG call for
			  satpix and uncert data.
V1.07	22-Sep-93 (MDM) - Corrected error in the /NORM option (it was not
			  working at all)
			- Corrected error in the /FILL_GAP option
V1.08	 1-Oct-93 (MDM) - Minor modification to recognize when registration
			  is requested.
V1.09	 6-Oct-93 (MDM) - Modified so that when not using the /REGISTER option
			  the output size is determined in originally summed
			  pixels (not Full res pixels)
V1.10	11-Oct-93 (MDM) - Corrected for the case where an OR is assembled but
			  /REGISTER is not used.  It was not saving the corner
			  or new shape properly.
V1.11	13-Oct-93 (MDM) - Enabled DC_INTERPOLATE and DC_SCALAR options
V1.12	15-Oct-93 (MDM) - Corrected for problem when registering the BYTE
			  uncertainty array
	15-Nov-93 (MDM) - Modified the header information 
V1.13	18-Nov-93 (MDM) - Patched an error in EXT_SUBIMG3 which was resulting in
			  poorly aligned images.  Problem was in rounding off
			  between integers and reals
	19-Nov-93 (MDM) - Modified to make the output data type BYTE when using
			  the /SFD_CORR option
V1.14	24-Nov-93 (MDM) - Corrected error with OR assembly.  The problem was
			  with EXT_SUBIMG3.  Added the /TRIM option inside
			  the ALIGN1IMG call.
			- Modified to record the actual percent of data present
			  when doing the observing region assembly.
V1.15	30-Nov-93 (MDM) - Renamed from SXT_PREP2 to SXT_PREP (Jim's original
			  SXT_PREP is renamed to SXT_PREP0)
	 1-Dec-93 (MDM) - Added /QMSTOP option (stop within the per image loop)
V1.16	 3-Dec-93 (MDM) - Modified so that when MOD_RES is called with an SFD
			  image, the signal is not changed.
			  Added "norm_fact=qsfd" to ALIGN1IMG call because the 
			  signal level of SFD images are all normalized to 
			  DN/sec/HR pixels
V1.17	 6-Dec-93 (MDM) - Protected against different index version numbers
			  when inserting into the INDEX_OUT array.
V1.18	 9-Dec-93 (MDM) - Modified so that when all input is FFI and /HELIO
			  option, and outsize is not specified, then default
			  to 128x128.
			- Modified "automatic forced reading" (which happens
			  if the input is a file, all SPR) so that it does not
			  occur if the amount of data is over 4 megabytes.
V1.19	10-Dec-93 (MDM) - Added /Q2STOP
			- Corrected V1.14 mod to properly record the actual 
			  percent of data present when doing the observing 
			  region assembly.
V1.20	 4-Jan-94 (MDM) - **** IMPORTANT MODIFICATIONS ****
			- Adjust the optical images to be aligned to the
			  x-ray images
			- Incorporated the S/C roll into the correction
V1.21	 5-Jan-94 (MDM) - Made the default not to perform the roll correction
			- Modifed roll correction to make the sun center the
			  pivot location instead of a fixed point
V1.22	14-Jan-94 (MDM) - Modified to do the roll correction outside of
			  ALIGN1IMG and to do it after all OR parts are
			  put together.
V1.23	17-Jan-94 (MDM) - Corrected roll option to only be done if asked for
V1.24	31-Jan-94 (MDM) - Corrected some of the /FILL_GAP capabilities
			- Added /TRIM_EDGE option
V1.25	 8-Feb-94 (MDM) - Corrected selection of the alignment location
			  Previously, the location took into account the
			  SXT roll, even if the roll correction was not
			  being selected.  It resulted in images not quite
			  filling the output data cube (there was a gap on
			  the edge with zero data).  The coordinates being
			  saved were correct though.
V1.26	21-Feb-94 (MDM) - Added /ORIDE_PNT_CHK to optionally not compare the
                         ATT/GET_SUNCENTER results to the commanded values to see
                         that they are truly valid points
V1.27	22-Feb-94 (SLF/MDM) - Reincorporated SLF changes of 15-Feb-94 which
			  added /INTERP and /CUBIC keywords and function
	22-Feb-94 (MDM) - Added /FAST options for simple pixel registration
V1.28	25-Feb-94 (MDM) - Added check to see what the resolutions are when
			  using the /NOCORR option.  It returns if they are
			  not all the same resolution, and sets OUTRES if
			  they are all the same resolution.
V1.29	 8-Mar-94 (MDM) - Added logging of the fact that roll corrections
			  were applied
V1.30	30-Mar-94 (MDM) - Modified to get the shape using GT_SHAPE with
			  the /OBS_REGION switch instead of using GT_SHAPE_CMD
			- Added information on "uncert" and "satpix" to the
			  header.
V1.31	31-Mar-94 (MDM) - Adjusted logic so that you could do a roll correction
			  without doing a registration correction
			- The 14-Jan-94 mod caused the roll correction logging
			  to not be done properly.  It was fixed.
			- Log the roll value in .SUN_CENTER even if registration
			  was not done
V1.32	20-Jun-94 (MDM) - Modified so that registration is done if /ROLL is set
	25-Jul-94 (MDM) - Modified the header document
			- Added check that only one of SUNCOORD, CCDCOORD and 
			  HELIO are used in the call.
V1.33	19-Sep-94 (MDM) - Corrected an error which was causing the images to be
			  shifted by 0.5 pixels when the ref_image option was 
			  being used.  Image to image registration is not 
			  affected and the absolute coordinate is not affected 
			  (it recorded the value 0.5 pixels off of what was 
			  really wanted).  SXT_PREP was doing sub-pixel shifts 
			  when not wanted which was causing the image to be 
			  smeared unncessarily.
			- Added header information (about sub-pixel image smear)
	14-Nov-94 (MDM) - Modified to set /REGISTER when CCDCOORD is passed in.
	15-Dec-94 (MDM) - Updated header information (discouraged use of
			  the /NOCORRECTIONS keyword)
       12-Feb-95 (JMM) - Added uncertainties obtained from LEAK_SUB/DARK_SUB
V1.40	27-Feb-95 (MDM) - Put McTiernan additions on-line
V1.41	 6-Mar-95 (MDM) - Made UNC_DATA floating if /NORM is set
V1.50	20-Mar-95 (MDM) - Added /VIGNETTE switch
			- Added /DESPIKE_THRESH switch
			- Added /SIGMA and /WIDTH switch
			- Made /DC_INTERPOLATE the Default *************
			- Added /FLOAT switch
			- Changed to make OUTRES equal to the highest
			  resolution of the input if OUTRES is not specified
			  and OUTSIZ is not specified
			- Added /HELP switch
V1.51	20-Mar-95 (MDM) - Pass the /FLOAT switch to LEAK_SUB
	22-Mar-95 (MDM) - Fixed typo /DC_INTREPOLATE versus /DC_INTERPOLATE
V1.52	23-Mar-95 (MDM) - Added /REST_LOW8 option to retore low-8 data.
	10-Apr-95 (MDM) - Added documentation header information (on UNC_DATA)
	11-Apr-95 (MDM) - Added typout=2 for low8 with /nocorr
	19-Apr-95 (MDM) - Modified the documenation header (on UNC_DATA)
V1.53	18-May-95 (MDM) - Added /ALLOW_DUPLICATES keyword
			- Added NEW_SDC_DB and NEW_SFC_DB keywords
V1.54	22-Jun-95 (MDM) - Trap and dis-allow /ROLL_DO with CCDCOORD
V1.55	 1-Sep-95 (MDM) - Fixed the UNC_DATA rotated results be saved in 
			  "udata0" temporarily instead of directly into 
			  "unc_data" array so that OUTFIL option works properly
V1.56   1-Feb-98 (SLF) - add DC_ORBIT_CORRECT and NO_DC_ORBIT_CORRECT (->leak_sub)
V1.57  19-Feb-98 (SLF) - make 1-feb change work for file input option
V1.58  16-Sep-98 (SLF) - add /sxt_kleenx 
V1.58  20-Nov-98 (DMcK)- put in odd/even test of outsize, in Alignment
                       section, in derivation of xc,yc. Intended to
                       make patch of 19-Sep-94 work for all values of
                       OUTSIZE.
V1.59  28-Jan-99 (SLF) - merged SLF and DMcK divergent V1.58 mods
V1.60  21-Mar-99 (SLF) - add /sxt_cleanx (recommended over SXT_KLEEN)
                         /destreak (pass->sxt_clean,/xsaa)
V1.61  14-Jun-99 (SLF) - made /sxt_kleen obsolete (now implies /sxt_clean)
V1.62  26-Oct-99 (SLF) - add /NOLEAK keyword and function
V1.63  10-Jan-2000 (SLF) - add /SECOND_ORDER_LEAK (call sxt_deak)
V1.64  25-Apr-2001 (SLF) - add /SUTURE (call sxt_suture)
V1.65   6-mar-2003 (SLF) - add /LOUD & /VERBOSE and made default quieter
V1.66   6-Jan-2004 (LWA) - made sxt_clean message subject to /loud.
V1.67  10-Jan-2004 (LWA) - Commented out second_order_leak from leak_sub and
			put it after sxt_clean.
V1.68  12-Jan-2004 (LWA) - Do not do sxt_deleak if before filter fail epochs.
V1.69  16-Jan-2004 (LWA) - Revise satpix with med_smooth if sxt_clean.
	20-Jan-2004 (LWA) - Only revise satpix if qsatpix is set.
V1.70  27-Jan-2004 (LWA) - Added minor frame missing test to call of sxt_clean.
V1.71  29-Jan-2004 (SLF) - remove extraneous leak sub history and set
                           second-order history flag as appropriate     
V1.72  26-Mar-2004 (SLF) - check sxt_deleak status (YN keyword) to 
                           set or NOT-set 2nd order leak correction flag 


sxt_prep [3] $SSW/yohkoh/sxt/idl/util/sxt_prep.pro
[Previous] [Next]
NAME:
	sxt_prep
SAMPLE CALLING SEQUENCE:
	sxt_prep, input1, input2, index_out, data_out
	sxt_prep, index, data, index_out, data_out
	sxt_prep, infil, dset_arr, index_out, data_out, unc_data, satpix, $
			helio=[-9.8,-20.3], date_helio='14-JUN-92  02:37:41')
	sxt_prep, index, data, index_out, data_out, /helio, ref_image=10)
	sxt_prep, index, data, index_out, data_out, ref_image=spr_index(0))
	sxt_prep, index, data, index_out, data_out, /roll
	sxt_prep, index, data, index_out, data_out, new_sdc_db='/1p/acton/new_db'
PURPOSE:
	This is a general purpose routine to prepare the SXT data for
	analysis.  The steps performed are:
		1. Flag the saturated pixels
		2. Decompress the data
		3. Subtract the dark current
		4. Subtract the pin hole leak
		5. Remove the spikes from the images
		6. Apply the vignette correction
		7. Align the images and build the observing region.  The
		   routine can extract subportions out of FFI images
		8. Fill in the horizontal gaps in the observing region
		9. Exposure normalize
	It does not do the following items which the earlier version of
	SXT_PREP did do:
		*. Temporal interpolation

	Image to image registration is only performed if one of the following
	keywords is used:
		REGISTER
		SUNCOORD
		HELIO
		CCDCOORD
	Use only ONE of the following at one time (SUNCOORD, HELIO, CCDCOORD)
INPUT:
		  ** There are two methods for calling SXT_PREP **
	input1	- A. The index structure for each of the input images
		  B. The names of the input files
	input2	- A. The input data array
		  B. The dataset numbers to extract and process
OUTPUTS:
	data_out - The output data array
	index_out- The index structure for each output image
OPTIONAL OUTPUTS:
       unc_data- The uncertainty array for each image.  These are NON-
                 STATISTICAL errors and are caused by decompression errors
                 in the data, background and straylight images (where
                 applicable).  NO statistical errors are included.
		  See the routine SXT_DN_UNC to add in the photon statistics.

		  There are at least three non-statistical errors:
                       d_comp  = decompression error (sxt_decomp)
                       d_dark  = dark subtraction error (dark_sub)
                       d_reg   = Error from registration (align_prep)
				  (which will be included in the future)
                 sxt_prep returns sqrt(d_comp^2+d_dark^2+d_reg^2).
	satpix	- The saturated pixel map for the data extracted.  It is
		  a boolean data array with non-zero values for pixels which
		  were saturated in the original image.
OPTIONAL KEYWORD INPUTS:
		-------------------- Calibration Parameters --------------------
	dc_scalar- If set, then a simple scalar value is used for dark current 
		  subtraction. Default is to take the image closest in exposure.
	dc_interpolate - If set, then perform interpolation on the dark frame
		  images to get a better backround subtraction.  Deafult is to
		  take the image closest in exposure.
       dc_orbit_correct - If set, apply SDC Orbital Variation Correction
	upper_only - If set, only flag +1 pixels above (in a column) the
		  saturated area (not the -1 pixels) [see call to sxt_satpix].
	sfd_corr - If set, then the input image is an SFD image.  Use the
		  SFD decompression, perform the registration, and recompress
		  using the SFD compression.
	rest_low8 - If set, then call the routines to restore low-8 data.  
		  You must pass in low-8 along with compressed data.  You
		  will get restored images AND simple single compressed 
		  images as the output.
	
		-------------------- Alignment Parameters --------------------
	register - If set, then perform the registration and correct only for
		the S/C jitter.  See the /FAST option if you do not want
		to have sub-pixel registration performed.
	fast	- If set, then perform the registration in "FAST" mode which
		is simple full pixel shifts instead of POLY2D.

	ref_image - A single roadmap or index structure which will be used 
		to define the sun or heliocentric coordinates for alignment.  
		It can be the image number (subscript) of the images being
		extracted which should be used (not the absolute dataset 
		number within the images listed in "infil") 

	helio - the reference latitude and longitude for the alignment.
		This should be the position of the active region at some 
		time, preferably near the time it crossed closest to the 
		center of the disk.  If a sub-image is to be extracted, 
		HELIO specifies the center of the sub-image.
			helio(0) = longitude E/W (E is negative)
			helio(1) = latitude N/S (S is negative)
		It can be a non-zero scalar value if REF_IMAGE is passed in.
		In this case, the heliocentric coordinates are derived
		from "REF_IMAGE".
		DO NOT USE WITH SUNCOORD AND CCDCOORD.
	date_helio - the reference date/time for the heliocentric input.

	suncoord - The coordinates of the center of the portion to extract
		   in angular arcseconds relative to sun center.
			suncoord(0) = E-W coordinate (E is negative)
			suncoord(1) = N-S coordinate (S is negative)
		   DO NOT USE WITH HELIO AND CCDCOORD.

       ccdcoord - The FRE (full resolution CCD pixel equivalent) of the
                  center of the portion to extract
		   DO NOT USE WITH SUNCOORD AND HELIO

	outres- The resolution of the output image (0=FR, 1=HR, 2=QR).
		If not set, and the input is not all FFI, then convert all 
		to full res.  If all FFI, then set outres to the highest
		resolution of the input images (typically half resolution)  
		Only relevant if registering the images.
	outsize- The dimention of the ouptut image [#col, #lin]
		If it is a scalar value, it will make the #lin = #col
		If not set, it will make it the largest size of the input
		field of views.  If PFI and FFI are mixed, it will take
		the largest PFI.

	fill_gap - A gap can exist between two PFI strips for a single
		   observing region because of a change in S/C pointing.
		   If this variable is set, then the gap between the PFI
		   strips is filled by interpolating the lines above and below
	trim_edge - Used with /FILL_GAP.  If set, then replace the edge 
		  line of pixels as well as the gaps.  Will set /FILL_GAP 
		  if /TRIM_EDG is set.
	noroll	- If set, then do not perform roll corrections.  Currently the
		  default
	roll_do	- If set, then perform the corrections for the roll offset
       interp  - If set, roll correction uses bilinear interpolation
                 (See Description in IDL poly_2D documentation header)
	cubic   - If set, roll correction uses cubic convolution interpolation
                 (See Description in IDL poly_2D documentation header)
       oride_pnt_chk - If set, then do not compare the ATT/GET_SUNCENTER
                 results to the commanded values to see that they are
                 truly valid points.  This is useful for times when the
                 commanded pointing history file is not updated properly
                 or for real time applications when the commanded pointing
                 history is not updated yet.
       align_unc  - The uncertainties in alignment coordinates, a pair of
                 (x,y) in FR pixels. If set to any scalar, this will use
                 TEST_POLY to determine these values.  TEST_POLY fits the 
		  corner coordinates obtained from ALIGN_PREP to a polynomial 
		  of degree bewteen 1 to 10, and estimates the mean uncertainty 
		  from the fluctuations of the pointing coordinates around the 
		  smoothed values. 
			*** ALIGN_UNC is not available right now ***
                 

		-------------------- Secondary Processing Parameters ----------
	sum	- Sum over SUM X SUM pixels.  It must be a scalar value.
	exp_normalize - If set, normalize the count rates in the output image
		  to DN/sec/full_res_pixels.
	normalize- Same as EXP_NORM
	
	vignette - If set, then apply the correction for the vignette
		  loss in signal off axis.  The function SXT_OFF_AXIS
		  is called to peform the correction.  For certain applications
		  it is recommended to use /FLOAT with this /VIGNETTE option.

		-------------------- Image Filtering Parameters ----------
	despike_thresh - Call DE_SPIKER to remove spikes from the image.  
		  This step is done before sub-pixel registration.
		  The value set on the call is passed into the function
		  DE_SPIKER as "threshold" (the first parameter)
	width	- If DESPIKE_THRESH is set, then pass this value through
		  to DE_SPIKER.  If SIGMA_FILT is set, then pass this value
		  through to the SIGMA_FILTER function.
	sigma_filt - Call the SIGMA_FILTER function with SIGMA_FILT as
		  the "box_width" variable.
	n_sigma	- If SIGMA_FILT is set, then pass this value through to
		  the function SIGMA_FILTER
	sigma_iterate - If SIGMA_FILT is set, then pass this value through 
		  to the function SIGMA_FILTER as keyword input "iterate"

		-------------------- Miscellaneous Parameters ----------
	float	-  If set, then make the output floating point (REAL*4)
	force_read - If set, read all datasets at once even if input was 
		  specified with INFIL/DSET.  This is available because doing 
		  LEAK_SUB on all images at once if the input is PFI is more 
		  efficient
	outfil	- If specified, the data will not be passed back in INDEX_OUT and
		  DATA_OUT.  Instead, it will be saved in an SDA file with the
		  name specified by this parameter. 
		  If "uncert" and "satpix" are included in the procedure call,
		  they will be saved with the same file name with a "_unc"
		  and a "_sat" appended to the file name.
	qdebug	- If set, display some diagnostic messages
	qstop	- If set, stop execution inside this subroutine (for debugging)
	nocorrections- This keyword is intended for debugging purposes and should
		  not be used.  If set, then LEAK_SUB is not called.  LEAK_SUB
		  will automatically not be called if the input data is of
		  non-byte type.
	help	- If set, then display the help file /ys/sxt/doc/sxt_prep.txt
	allow_duplicates  - If set, then do not do the serial number check to
		  combine observing region PFIs into one image (ie: if the same
		  image comes in twice in the input, make it show up twice
		  in the output)
	new_sdc_db - Optionally pass the the directory where an alternate
		  dark current database reside.  RECOMMENDED FOR EXPERTS ONLY.
		  See the routine SET_NEW_DB for details.  SXT_PREP resets
		  to the official database directory before returning
	new_sfc_db - Same as "new_sdc_db" except for leak database
OPTIONAL KEYWORD OUTPUTS:
	error	- Error information.  
			0 - No errors
			1 - "index" and "data" input parameters are undefined
			2 - "index" and "data" data types are incorrect
	run_time - The number of minutes that SXT_PREP took
	st_en_lin - The start/end line number where each PFI strip is inserted 
		    into the output array.  It is 2 x # PFI Strips x # output 
		    images.
METHOD
	When running YODAT, the user should NOT have the observing regions
	assembled.  This routine will perform dark subtraction on each 
	individual exposure and will align each PFI strip independently.

	-------------------- Calibration Options --------------------
	Decompression, dark_sub, leak_sub

	-------------------- Alignment Option --------------------
	To align the images.  User can specify
		(1) heliocentric coordinates for a given time/date
		    (corrects for solar differential rotation and S/C drift)
		(2) the fixed coordinates relative to sun center in arcmin
		    (corrects for S/C drift)
		(3) simple CCD coordinates (probably only used when
		    assembling observing regions, but want to do background
		    subtraction first) (would not take out S/C drift)
	The images are all changed to full resolution, and the signal is
	scaled accordingly (an image converted from HR to FR has the signal
	divided by 4 because there are 4 times more pixels now.  The total
	signal is preserved)

 CALLED BY:
	FIX_SFD, GET_LC, SFD_DIFF, SXT_HYST, SXT_QLOOK, SXT_TEEM1 [1], SXT_TEEM1 [2]
	SXT_TEEM1 [3], WL_CUBE_II, box_sxthxt_fsp, mk_spd, mk_ssc [1], mk_ssc [2]
	rest_low8_ffi, sacpeak_image, sxt_av_teem, sxt_average, sxt_clean [1]
	sxt_clean [2], sxt_combine, sxt_composite [1], sxt_composite [2]
	sxt_composite [3], sxt_fl_analxpro, sxt_fsp, sxt_mauna, sxt_prep2
	sxt_sff_composite [1], sxt_sff_composite [2], sxt_ssc2sss, sxt_ssc_rationalize
	sxt_ssn2fits [1], sxt_ssn2fits [2], sxt_tfl, sxt_tflx, sxt_thfsp, sxtbox_fsp
	sxtbox_teem, sxthxt_fsp
	NOTE: When using the registration options (/REG, /HELIO, SUNCOORD)
	  sub-pixel registration will be performed using POLY2D.  This could
	  cause the image to appear to be smeared.  For example, if there is
	  a single pixel bright spot (solar flare or dark spike).  If there
	  is a 0.5 pixel east/west shift to register it to other images, half 
	  of the pixel intensity is left in the original pixel and half is 
	  moved to the adjacent pixel.
 CALLS: ***
	BOX_MESSAGE, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1]
	CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], HIS_EXIST, RD_XDA [1], RD_XDA [2]
	ROT, TIME2FILE, align1img [1], align1img [2], align_prep [1], align_prep [2]
	align_prep [3], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	big_smooth [1], big_smooth [2], break_file [4], concat_dir [4], curdir [1]
	curdir [2], data_chk [1], data_chk [2], data_type [1], data_type [2]
	de_spiker [1], de_spiker [2], exp_norm [1], exp_norm [2], file_exist [1]
	file_exist [3], fmt_tim [1], fmt_tim [2], get_info [1], get_info [2], get_info [3]
	get_info [4], get_logenv [1], get_logenv [2], get_roll, get_yo_dates [1]
	get_yo_dates [2], get_yo_dates [3], gt_comp, gt_corner, gt_or_expnum, gt_pfi_ffi
	gt_pix_size, gt_res, gt_shape, gt_tagval [1], gt_tagval [2], his_index
	int2secarr [1], int2secarr [2], interp_or, leak_sub [1], leak_sub [2]
	leak_sub [3], mk_dset_str [1], mk_dset_str [2], mnr_frm_fix, prstr [1], prstr [2]
	rd_tfile [1], rd_tfile [2], rest_low8_cube [1], rest_low8_cube [2]
	rest_low8_ffi, sav_sda [1], sav_sda [2], sav_sda [3], savegenx, sel_leak_image [1]
	sel_leak_image [2], sel_leak_image [3], sel_leak_image [4], set_logenv [1]
	set_logenv [2], set_new_db, sfd_decomp, str_copy_tags [1], str_copy_tags [2]
	str_copy_tags [3], str_copy_tags [4], str_replace [1], str_replace [2]
	sxt_clean [1], sxt_clean [2], sxt_decomp [1], sxt_decomp [2], sxt_deleak [1]
	sxt_deleak [2], sxt_off_axis, sxt_orhis, sxt_satpix [1], sxt_satpix [2]
	sxt_suture [1], sxt_suture [2], tbeep [1], tbeep [2], tbeep [3], tim2dset [1]
	tim2dset [2], uniqo [1], uniqo [2]
RESTRICTIONS:

HISTORY:
	Written 16-Aug-93 by M.Morrison using and merging:
		ALIGN_PFI (which used  Metcalf ALIGN_AR as starting point)
		SXT_PREP (JRL 20-Apr-93 version)
V1.03	   Aug-93 (MDM)
V1.04	31-Aug-93 (MDM) - Various patches
			- Added RUN_TIME option
V1.05	 3-Sep-93 (MDM) - Adjusted the documentation header some
			- Changed the alignment code to always use ALIGN1IMG
			  for all combinations of PFI/FFI
			- Renamed keyword EXP_NORM to EXP_NORMALIZE
	 8-Sep-93 (SLF) - add append keyword (for sav_sda call)
V1.06	15-Sep-93 (MDM) - Added print statement on what version of SXT_PREP
			  is being run
			- Changed so that the sat pixel registration is
			  done properly (sub pixel, sub-DN problem)
			- Made the "uncert" data output type byte
	16-Sep-93 (MDM)	- Added NORM_FACT switch to ALIGN1IMG call for
			  satpix and uncert data.
V1.07	22-Sep-93 (MDM) - Corrected error in the /NORM option (it was not
			  working at all)
			- Corrected error in the /FILL_GAP option
V1.08	 1-Oct-93 (MDM) - Minor modification to recognize when registration
			  is requested.
V1.09	 6-Oct-93 (MDM) - Modified so that when not using the /REGISTER option
			  the output size is determined in originally summed
			  pixels (not Full res pixels)
V1.10	11-Oct-93 (MDM) - Corrected for the case where an OR is assembled but
			  /REGISTER is not used.  It was not saving the corner
			  or new shape properly.
V1.11	13-Oct-93 (MDM) - Enabled DC_INTERPOLATE and DC_SCALAR options
V1.12	15-Oct-93 (MDM) - Corrected for problem when registering the BYTE
			  uncertainty array
	15-Nov-93 (MDM) - Modified the header information 
V1.13	18-Nov-93 (MDM) - Patched an error in EXT_SUBIMG3 which was resulting in
			  poorly aligned images.  Problem was in rounding off
			  between integers and reals
	19-Nov-93 (MDM) - Modified to make the output data type BYTE when using
			  the /SFD_CORR option
V1.14	24-Nov-93 (MDM) - Corrected error with OR assembly.  The problem was
			  with EXT_SUBIMG3.  Added the /TRIM option inside
			  the ALIGN1IMG call.
			- Modified to record the actual percent of data present
			  when doing the observing region assembly.
V1.15	30-Nov-93 (MDM) - Renamed from SXT_PREP2 to SXT_PREP (Jim's original
			  SXT_PREP is renamed to SXT_PREP0)
	 1-Dec-93 (MDM) - Added /QMSTOP option (stop within the per image loop)
V1.16	 3-Dec-93 (MDM) - Modified so that when MOD_RES is called with an SFD
			  image, the signal is not changed.
			  Added "norm_fact=qsfd" to ALIGN1IMG call because the 
			  signal level of SFD images are all normalized to 
			  DN/sec/HR pixels
V1.17	 6-Dec-93 (MDM) - Protected against different index version numbers
			  when inserting into the INDEX_OUT array.
V1.18	 9-Dec-93 (MDM) - Modified so that when all input is FFI and /HELIO
			  option, and outsize is not specified, then default
			  to 128x128.
			- Modified "automatic forced reading" (which happens
			  if the input is a file, all SPR) so that it does not
			  occur if the amount of data is over 4 megabytes.
V1.19	10-Dec-93 (MDM) - Added /Q2STOP
			- Corrected V1.14 mod to properly record the actual 
			  percent of data present when doing the observing 
			  region assembly.
V1.20	 4-Jan-94 (MDM) - **** IMPORTANT MODIFICATIONS ****
			- Adjust the optical images to be aligned to the
			  x-ray images
			- Incorporated the S/C roll into the correction
V1.21	 5-Jan-94 (MDM) - Made the default not to perform the roll correction
			- Modifed roll correction to make the sun center the
			  pivot location instead of a fixed point
V1.22	14-Jan-94 (MDM) - Modified to do the roll correction outside of
			  ALIGN1IMG and to do it after all OR parts are
			  put together.
V1.23	17-Jan-94 (MDM) - Corrected roll option to only be done if asked for
V1.24	31-Jan-94 (MDM) - Corrected some of the /FILL_GAP capabilities
			- Added /TRIM_EDGE option
V1.25	 8-Feb-94 (MDM) - Corrected selection of the alignment location
			  Previously, the location took into account the
			  SXT roll, even if the roll correction was not
			  being selected.  It resulted in images not quite
			  filling the output data cube (there was a gap on
			  the edge with zero data).  The coordinates being
			  saved were correct though.
V1.26	21-Feb-94 (MDM) - Added /ORIDE_PNT_CHK to optionally not compare the
                         ATT/GET_SUNCENTER results to the commanded values to see
                         that they are truly valid points
V1.27	22-Feb-94 (SLF/MDM) - Reincorporated SLF changes of 15-Feb-94 which
			  added /INTERP and /CUBIC keywords and function
	22-Feb-94 (MDM) - Added /FAST options for simple pixel registration
V1.28	25-Feb-94 (MDM) - Added check to see what the resolutions are when
			  using the /NOCORR option.  It returns if they are
			  not all the same resolution, and sets OUTRES if
			  they are all the same resolution.
V1.29	 8-Mar-94 (MDM) - Added logging of the fact that roll corrections
			  were applied
V1.30	30-Mar-94 (MDM) - Modified to get the shape using GT_SHAPE with
			  the /OBS_REGION switch instead of using GT_SHAPE_CMD
			- Added information on "uncert" and "satpix" to the
			  header.
V1.31	31-Mar-94 (MDM) - Adjusted logic so that you could do a roll correction
			  without doing a registration correction
			- The 14-Jan-94 mod caused the roll correction logging
			  to not be done properly.  It was fixed.
			- Log the roll value in .SUN_CENTER even if registration
			  was not done
V1.32	20-Jun-94 (MDM) - Modified so that registration is done if /ROLL is set
	25-Jul-94 (MDM) - Modified the header document
			- Added check that only one of SUNCOORD, CCDCOORD and 
			  HELIO are used in the call.
V1.33	19-Sep-94 (MDM) - Corrected an error which was causing the images to be
			  shifted by 0.5 pixels when the ref_image option was 
			  being used.  Image to image registration is not 
			  affected and the absolute coordinate is not affected 
			  (it recorded the value 0.5 pixels off of what was 
			  really wanted).  SXT_PREP was doing sub-pixel shifts 
			  when not wanted which was causing the image to be 
			  smeared unncessarily.
			- Added header information (about sub-pixel image smear)
	14-Nov-94 (MDM) - Modified to set /REGISTER when CCDCOORD is passed in.
	15-Dec-94 (MDM) - Updated header information (discouraged use of
			  the /NOCORRECTIONS keyword)
       12-Feb-95 (JMM) - Added uncertainties obtained from LEAK_SUB/DARK_SUB
V1.40	27-Feb-95 (MDM) - Put McTiernan additions on-line
V1.41	 6-Mar-95 (MDM) - Made UNC_DATA floating if /NORM is set
V1.50	20-Mar-95 (MDM) - Added /VIGNETTE switch
			- Added /DESPIKE_THRESH switch
			- Added /SIGMA and /WIDTH switch
			- Made /DC_INTERPOLATE the Default *************
			- Added /FLOAT switch
			- Changed to make OUTRES equal to the highest
			  resolution of the input if OUTRES is not specified
			  and OUTSIZ is not specified
			- Added /HELP switch
V1.51	20-Mar-95 (MDM) - Pass the /FLOAT switch to LEAK_SUB
	22-Mar-95 (MDM) - Fixed typo /DC_INTREPOLATE versus /DC_INTERPOLATE
V1.52	23-Mar-95 (MDM) - Added /REST_LOW8 option to retore low-8 data.
	10-Apr-95 (MDM) - Added documentation header information (on UNC_DATA)
	11-Apr-95 (MDM) - Added typout=2 for low8 with /nocorr
	19-Apr-95 (MDM) - Modified the documenation header (on UNC_DATA)
V1.53	18-May-95 (MDM) - Added /ALLOW_DUPLICATES keyword
			- Added NEW_SDC_DB and NEW_SFC_DB keywords
V1.54	22-Jun-95 (MDM) - Trap and dis-allow /ROLL_DO with CCDCOORD
V1.55	 1-Sep-95 (MDM) - Fixed the UNC_DATA rotated results be saved in 
			  "udata0" temporarily instead of directly into 
			  "unc_data" array so that OUTFIL option works properly
V1.56   1-Feb-98 (SLF) - add DC_ORBIT_CORRECT and NO_DC_ORBIT_CORRECT (->leak_sub)
V1.57  19-Feb-98 (SLF) - make 1-feb change work for file input option
V1.58  20-Nov-98 (DMcK)- put in odd/even test of outsize, in Alignment 
			  section, in derivation of xc,yc. Intended to 
			  make patch of 19-Sep-94 work for all values of
			  OUTSIZE.


sxt_prep2 $SSW/yohkoh/sxt/idl/util/sxt_prep2.pro
[Previous] [Next]
NAME:
	sxt_prep2
SAMPLE CALLING SEQUENCE:
	sxt_prep2, input1, input2, index_out, data_out
	sxt_prep2, index, data, index_out, data_out
	sxt_prep2, infil, dset_arr, index_out, data_out, $
			helio=[-9.8,-20.3], date_helio='14-JUN-92  02:37:41')
	sxt_prep2, index, data, index_out, data_out, /helio, ref_image=10)
	sxt_prep2, index, data, index_out, data_out, ref_image=spr_index(0))
PURPOSE:
	This is a general purpose routine to prepare the SXT data for
	analysis.  The steps performed are:
		1. Flag the saturated pixels
		2. Decompress the data
		3. Subtract the dark current
		4. Subtract the pin hole leak
		5. Align the images and build the observing region.  The
		   routine can extract subportions out of FFI images
		6. Fill in the horizontal gaps in the observing region
		7. Exposure normalize
	It does not do the following items which the earlier version of
	SXT_PREP did do:
		*. Re-bin the data to a lower resolution
		*. Temporal interpolation
	In the future modifications (** NOT AVAILABLE RIGHT NOW **), it will:
		*. De-spike the image
		*. Perform leak subtraction with different reference image
		   for images taken with ND filter
		*. Perform leak subtraction with adjustments for S/C pointing
		   changes
INPUT:
		  ** There are two methods for calling SXT_PREP2 **
	input1	- A. The index structure for each of the input images
		  B. The names of the input files
	input2	- A. The input data array
		  B. The dataset numbers to extract and process
OUTPUTS:
	data_out - The output data array
	index_out- The index structure for each output image
OPTIONAL KEYWORD INPUTS:
		-------------------- Calibration Parameters --------------------
	nocorrections- If set, then LEAK_SUB is not called
	dc_scalar- If set, then a simple scalar value is used for dark current 
		  subtraction. Default is to take the image closest in exposure.
	dc_interpolate - If set, then perform interpolation on the dark frame
		  images to get a better backround subtraction.  Deafult is to
		  take the image closest in exposure.
	upper_only - If set, only flag +1 pixels above (in a column) the
		  saturated area (not the -1 pixels) [see call to sxt_satpix].
	sfd_corr - If set, then the input image is an SFD image.  Use the
		  SFD decompression, perform the registration, and recompress
		  using the SFD compression.
	
		-------------------- Alignment Parameters --------------------
	register - If set, then perform the registration and correct only for
		the S/C jitter.

	ref_image - A single roadmap or index structure which will be used 
		to define the sun or heliocentric coordinates for alignment.  
		It can be the image number (subscript) of the images being
		extracted which should be used (not the absolute dataset 
		number within the images listed in "infil") 

	helio - the reference latitude and longitude for the alignment.
		This should be the position of the active region at some 
		time, preferably near the time it crossed closest to the 
		center of the disk.  
			helio(0) = longitude E/W (E is negative)
			helio(1) = latitude N/S (S is negative)
		It can be a non-zero scalar value if REF_IMAGE is passed in.
		In this case, the heliocentric coordinates are derived
		from "REF_IMAGE".
	date_helio - the reference date/time for the heliocentric input.

	suncoord - The coordinates of the center of the portion to extract
		   in angular arcseconds relative to sun center.
			suncoord(0) = E-W coordinate (E is negative)
			suncoord(1) = N-S coordinate (S is negative)

       ccdcoord - The FRE (full resolution CCD pixel equivalent) of the
                  center of the portion to extract

	outres- The resolution of the output image (0=FR, 1=HR, 2=QR).
		If not set, then convert all to full res.  Only relevant if
		registering the images.
		** NOT AVAILABLE RIGHT NOW - ALWAY FULL RESOLUTION **
	outsize- The dimention of the ouptut image [#col, #lin]
		If it is a scalar value, it will make the #lin = #col
		If not set, it will make it the largest size of the input
		field of views.  If PFI and FFI are mixed, it will take
		the largest PFI.

	fill_gap - A gap can exist between two PFI strips for a single
		   observing region because of a change in S/C pointing.
		   If this variable is set, then the gap between the PFI
		   strips is filled by interpolating the lines above and below
			** NOT AVAILABLE RIGHT NOW **

		-------------------- Secondary Processing Parameters ----------
	sum	- Sum over SUM X SUM pixels.  It must be a scalar value.
	exp_normalize- If set, perform exposure normalization
	normalize- Same as EXP_NORM

		-------------------- Miscellaneous Parameters ----------
	force_read - If set, read all datasets at once even if input was 
		  specified with INFIL/DSET.  This is available because doing 
		  LEAK_SUB on all images at once if the input is PFI is more 
		  efficient
	outfil	- If specified, the data will not be passed back in INDEX_OUT and
		  DATA_OUT.  Instead, it will be saved in an SDA file with the
		  name specified by this parameter. 
		  If "uncert" and "satpix" are included in the procedure call,
		  they will be saved with the same file name with a "_unc"
		  and a "_sat" appended to the file name.
	qdebug	- If set, display some diagnostic messages
	qstop	- If set, stop execution inside this subroutine (for debugging)
OPTIONAL KEYWORD OUTPUTS:
	error	- Error information.  
			0 - No errors
			1 - "index" and "data" input parameters are undefined
			2 - "index" and "data" data types are incorrect
	run_time - The number of minutes that SXT_PREP2 took
	st_en_lin - The start/end line number where each PFI strip is inserted 
		    into the output array.  It is 2 x # PFI Strips x # output 
		    images.
METHOD
	When running YODAT, the user should NOT have the observing regions
	assembled.  This routine will perform dark subtraction on each 
	individual exposure and will align each PFI strip independently.

	-------------------- Calibration Options --------------------
	Decompression, dark_sub, leak_sub

	-------------------- Alignment Option --------------------
	To align the images.  User can specify
		(1) heliocentric coordinates for a given time/date
		    (corrects for solar differential rotation and S/C drift)
		(2) the fixed coordinates relative to sun center in arcmin
		    (corrects for S/C drift)
		(3) simple CCD coordinates (probably only used when
		    assembling observing regions, but want to do background
		    subtraction first) (would not take out S/C drift)
	The images are all changed to full resolution, and the signal is
	scaled accordingly (an image converted from HR to FR has the signal
	divided by 4 because there are 4 times more pixels now.  The total
	signal is preserved)
 CALLS: ***
	dont_use_this [1], dont_use_this [2], sxt_prep [1], sxt_prep [2], sxt_prep [3]
RESTRICTIONS:

HISTORY:
	Written 16-Aug-93 by M.Morrison using and merging:
		ALIGN_PFI (which used  Metcalf ALIGN_AR as starting point)
		SXT_PREP (JRL 20-Apr-93 version)
V1.03	   Aug-93 (MDM)
V1.04	31-Aug-93 (MDM) - Various patches
			- Added RUN_TIME option
V1.05	 3-Sep-93 (MDM) - Adjusted the documentation header some
			- Changed the alignment code to always use ALIGN1IMG
			  for all combinations of PFI/FFI
			- Renamed keyword EXP_NORM to EXP_NORMALIZE
	 8-Sep-93 (SLF) - add append keyword (for sav_sda call)
V1.06	15-Sep-93 (MDM) - Added print statement on what version of SXT_PREP
			  is being run
			- Changed so that the sat pixel registration is
			  done properly (sub pixel, sub-DN problem)
			- Made the "uncert" data output type byte
	16-Sep-93 (MDM)	- Added NORM_FACT switch to ALIGN1IMG call for
			  satpix and uncert data.
V1.07	22-Sep-93 (MDM) - Corrected error in the /NORM option (it was not
			  working at all)
			- Corrected error in the /FILL_GAP option
V1.08	 1-Oct-93 (MDM) - Minor modification to recognize when registration
			  is requested.
V1.09	 6-Oct-93 (MDM) - Modified so that when not using the /REGISTER option
			  the output size is determined in originally summed
			  pixels (not Full res pixels)
V1.10	11-Oct-93 (MDM) - Corrected for the case where an OR is assembled but
			  /REGISTER is not used.  It was not saving the corner
			  or new shape properly.
V1.11	13-Oct-93 (MDM) - Enabled DC_INTERPOLATE and DC_SCALAR options
V1.12	15-Oct-93 (MDM) - Corrected for problem when registering the BYTE
			  uncertainty array
	15-Nov-93 (MDM) - Modified the header information 
V1.13	18-Nov-93 (MDM) - Patched an error in EXT_SUBIMG3 which was resulting in
			  poorly aligned images.  Problem was in rounding off
			  between integers and reals
	19-Nov-93 (MDM) - Modified to make the output data type BYTE when using
			  the /SFD_CORR option
V1.14	24-Nov-93 (MDM) - Corrected error with OR assembly.  The problem was
			  with EXT_SUBIMG3.  Added the /TRIM option inside
			  the ALIGN1IMG call.
			- Modified to record the actual percent of data present
			  when doing the observing region assembly.
	30-Nov-93 (MDM) - Renamed to SXT_PREP.  Put in call to SXT_PREP and
			  DONT_USE_THIS.


sxt_prep_exe $SSW/yohkoh/ucon/idl/freeland/sxt_prep_exe.pro
[Previous] [Next]
   Name: sxt_prep_exe
   
   Purpose: convert xsxt_prep output structure to sxt_prep call string

   Input Parameters:
      structure - from xsxt_prep

   Keyword Parameters:
      exe - if set, return is execute-ready string
	     (default is string array in 'pro' style

 CALLS: ***
	ARR2STR [1], Arr2Str [2], STR2ARR [1], STR2ARR [2], str_replace [1]
	str_replace [2]
 CALLED BY:
	xsxt_prep_event
   History:
      19-Aug-1993 (SLF)


sxt_pressure $SSW/yohkoh/ucon/idl/mctiernan/sxt_pressure.pro
[Previous] [Next]
NAME:
	sxt_pressure
PURPOSE:
	Calculates the plasma pressure given temperature
	and density, p=d*kT
CALLING SEQUENCE:
	sxt_pressure,te0,ute0,d0,ud0,p0,up0
INPUT:
	te0=Log(T)
	ute0=Uncertainty in Te0
	d0=Log(Density)
	ud0=Uncertainty in d0
OUTPUT:
	p0=Log(Plasma Energy) in dyne/cm^2
	up0=Uncertainty in p0
 CALLED BY:
	sxt_tfl, sxt_tflx
HISTORY:
	Written December '92 by JM
       Changed to te units from t6, 12-jul-92, jmm


sxt_psf $SSW/yohkoh/sxt/idl/atest/sxt_psf.pro
[Previous] [Next]
 Returns an image of the SXT point-spread-function.


FUNCTION sxt_psf, index, xc, yc, res=res, dim=dim, $
	spower=spower, fourier=fourier, $
	moffat_only=moffat_only, delta=delta, log10t=log10t, $
	no_shadow=no_shadow, scat_fraction=scat_fraction, $
	noverbose=noverbose


 REQUIRED INPUT PARAMETERS:
	index = SXT image index, used to get image center, filter,
		and resolution.
				OR
       filter = number of the X-ray analysis filter, GT-FILTB convention.
                In this case you must specify res.
	xc, yc = center of FOV in CCD Full Resolution pixels.
	res = The resolution [0,1,2] of the image that this PSF will
	      be compared to.

 OUTPUT:
       psf = image of the psf.  Default is:
               odd dimension (65x65), array centered,
               normalized to unit integral.  

 OPTIONAL INPUT KEYWORDS:
	dim = size of output PSF image in [res]-resolution pixels.  
		Default = 65.
	
	fourier = Return psf ready for use by IDL procedure FFT.
		Psf image is dimensioned power of 2 (64 x 64), 
		corner centered, normalized to unit mean.

       delta = returns scattering wings plus a delta at the center
		only, Moffat not included.  (Default is Moffat core
		plus scattering wings)

	moffat_only = returns Moffat psf only.  Scattering wings not
		included.

	no_shadow = The default mode is to use a scattering wing model
		that includes the "ray" shadows of the filter supports.
		This is currently our best fit to the scattering wing,
		with a slope of -2 in the radial dependence.
		Selecting NO_SHADOW will defeat this, and assume a 
		cylindrically symmetric, smooth scattering wing with 
		no "rays".
  
	spower = Slope of the scattering wing, with or without "rays",
		is set by SPOWER.  Default SPOWER is -2.

	scat_fraction = fraction of total signal to be attributed to the
		scattering wings.  The default values are based on 
		McKenzie's analysis of May 2002; but with this optional 
		parameter you can force X percent of the signal into 
		the wings; e.g., scat_fraction=0.073 for 7.3% scattering

	log10t = Log10 of temperature.  The Moffat parameters
		are wavelength, and therefore, temperature
		dependent.  Default uses values derived
		assuming equal emission measures at all
		temperatures  5.5 <= log10t <= 8.0.  
	        Also applies wavelength dependency to scattering
		wings, via (ref. wavelength/log10T wavelength)^2

 CALLING EXAMPLES:
	psf = SXT_PSF(index)
	psf = SXT_PSF(filter, xc, yc)
	psf = SXT_PSF(filter, xc, yc, /delta, scat_fraction=0.152)

 METHOD: 
	Uses the Moffat function fits described by Piet Martens.
	Adds scattering wings described by Acton.
	Wavelength weighting done by SXT_WEIGHT procedure. (Not so)
	Creates arrays with equivalent field of view in full-res,
	and calculates the PSF in full-res.  Then resizes the PSF
	array to the desired output size and resolution.

 RESTRICTION:
	Scattering has been empirically estimated for all filters,
	using full-res unsaturated flare images.  Some uncertainty
	still exists, but the defaults are the best current estimates.
	(May 2002, DMcK)

 PROGRAMS CALLED:
	SIZE, GT_FILTB, GT_CENTER, GT_RES, FINDGEN, REBIN, TRANSPOSE,
	ATAN, SXT_MWAVE, DELVARX, SXT_SCATWINGS, TOTAL, STDEV, SHIFT

 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], STDEV, delvarx [5], gt_center
	gt_filtb, gt_res, sxt_mwave, sxt_scatwings
 CALLED BY:
	SXTPIXON, SXT_IMAGE_DECONVOLVE, sxt_decon [1], sxt_decon [2], sxt_sharpen
 HISTORY:
	Written April 4, 1994   Barry LaBonte
	Added /DIM keyword  May 23, 1994  BJL
	Added /FOURIER, /MOFFAT keywords, scattering wings.  June 27, 1994 BJL
	Modified to use Moffat parameters weighted
		by SXT passband - Mewe spectrum product,
		added /LOG10T keyword.  March 24, 1995  BJL
V2.00  08-Feb-2001, DMcK - Incorporated many options that 
		were added to hacked versions of the last two years, or 
		which grew out of deconvolution workshop: resolution 
		flexibility; optional SLEVEL, SPOWER; log10T wavelength 
		dependency in the scattering wings; delta function replacement
		for Moffat core; SCAT_FRACTION option.  Updated version to
		2.00.
V2.10  09-Apr-2001, DMcK - Incorporated Acton's nifty program 
		SXT_SCATWINGS to get a scattering wing model that includes
		the "ray" shadows of the filter supports.  Also removed
		one call to REBIN that was disrupting the symmetry of the
		"ray-less" scattering wing.  Made SXT_SCATWINGS the
		default scattering model, with introduction of /no_shadow
		optional switch.  Updated version to 2.10.
V3.00  23-May-2002, DMcK - Major restructuring.
		Changed /MOFFAT to /MOFFAT_ONLY for clarity; added
		documentation; removed redundant SLEVEL input;
		Moffat core PSF is default; set scattering level
		hierarchy to SCAT_FRACTION > LOG10T > defaults.
		Default SCAT_FRACTIONs based on analysis of 35 over-the-limb
		flares throughout the mission, and analysis of spikey arcade
		from 18-dec-98.  Promoted to Version 3.00.


SXT_QLOOK $SSW/yohkoh/ucon/idl/metcalf/sxt_qlook.pro
[Previous] [Next]

pro sxt_qlook,tstart,tstop,pfifile,movie_name=gifroot,slow=slow, $
                    xsize=xsize,ysize=ysize,helio=helio,date_helio=date_helio, $
                    filta=filta,filtb=filtb,strict_filt=strict_filt, $
                    outres=outres,satpercent=satpercent,mpeg=mpeg,java=java,gif=gif

NAME:
     SXT_QLOOK
PURPOSE:
     Gives a quick-look at an SXT flare.  Shows multiple filters and does
     image preparation and alignments etc.  Also can output to a gif movie.
CATEGORY:
CALLING SEQUENCE:
      sxt_qlook,tstart,tstop,file
INPUTS:
      tstart = start time
      tstop = stop time
      file = filename(s) (can be a string vector)
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETER
     /slow = work slowly but preserving memory (use when the routine
             runs out of memory and crashes).  This option reads and
             preps every image individually.  It'll solve your memeory
             problem, but it's slow!
     outres = resolution of output (0,1, or 2 for full, half, or quarter res)
     filta = vector of filter A indices to include in the movie.
             def = [1,2,5,6]
     filtb = vector of filter B indices to include in the movie.
             def = [1,2,3,4,5,6]
     /strict = Treat the filta and filtb lists as a list of filter 
               combinations rather than treating the two lists 
               separately.
     satpercent = Percent of pixels allowed to be saturated.  Def = 0.0
     movie_name = Root of movie output filename.  If not set, no movie
               files are output.
     /gif  = Output gif movie
     /mpeg = Output mpeg movie
     /java = output java movie
     helio = helio coordinates for alignment.  Def = pointing at
             the middle of the flare mode.
     date_helio = date the helio coordinates are valid
     xsize,ysize = size of output images in SXT pixels of outres resolution.
                   def = 128.
OUTPUTS:
 CALLS: ***
	DIFF_ROT [1], DIFF_ROT [2], KILL_INDEX [1], KILL_INDEX [2], RD_SDA [1], RD_SDA [2]
	RD_SDA [3], SQUEEZE, WDEF [1], WDEF [2], WRITE_GIF, conv_h2p [1], conv_h2p [2]
	draw_boxcensiz [1], draw_boxcensiz [2], fmt_tim [1], fmt_tim [2], gt_center
	gt_dp_mode [1], gt_dp_mode [2], gt_expmode, gt_filta, gt_filtb, gt_res, image2movie
	int2secarr [1], int2secarr [2], sxt_composite [1], sxt_composite [2]
	sxt_composite [3], sxt_prep [1], sxt_prep [2], sxt_prep [3], where_arr [1]
	where_arr [2]
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf 1997-10-17


sxt_resp_inp $SSW/yohkoh/ucon/idl/mctiernan/sxt_resp_inp.pro
[Previous] [Next]
 NAME:
	sxt_resp_inp
 PURPOSE: 
	Inputs the ccd response, CCD e's and photons through SXT filters
	as functions of temperature T6=Log(T/10^6K)
 CALLING SEQUENCE:
	sxt_resp_inp,filters,date=date
 INPUT:
	Data is read in from a file called 
	t6_filter.response in the directory $SXT_DIR_CALBRATE
 KEYWORD INPUT:
       date if set, check date, and if it's after 17-nov-92, use
       the appropriate responses
 OUTPUT: 
	filters= an array of string variables of filter names.
 CALLS: ***
	ADDTIME [1], ADDTIME [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	concat_dir [4], restgen [1], restgen [2]
 COMMON BLOCKS:
	Common flresp which contains:
		t6, the temperature grid used to interpolate on, 
		ck, the number of DN's per photon for each filter 
		   as a function of t6.
	Common flresp0:
		ccd, the number of CCD e's as a function of t6 for em=1.0e-44 
		ccp, the number of photons into the CCD as a function of t6
		g, the gain constant g=100.0
	ccd,ccp,ck are fltarr(# of filters, # of t6's)
 HISTORY:
	Written Spring, 1992 by J. McTiernan
	 3-Sep-92 (MDM) - Moved and re-named the filter response file
	 4-Feb-93 (JM) - Rewritten to use the new response curves
        7-May-93 (JM) - added the date keyword


SXT_RPAXY $SSW/yohkoh/ucon/idl/hudson/sxt_rpaxy.pro
[Previous] [Next]
 NAME:
     SXT_RPAXY
 PURPOSE:
     calculate radii, position angles, and xy's for SXT
 CATEGORY:
     Yohkoh
 CALLING SEQUENCE:
     sxt_rpaxy, index, rr, pa, xy
     sxt_rpaxy, index, rr, pa, xy, center=center
     sxt_rpaxy, index, /get
     sxt_rpaxy, index, /get, coords=coords
 INPUTS:
     index of an image
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     center, allows input of a coordinate center (default fov center)
     show, shows rpaxy results
     pix, gives rr output in pixel units (otherwise R_sun units)
     get, prints clicked coordinates to screen (presupposes you've
      displayed the image already)
    coords, contains clicked position as described if /get
 OUTPUTS:
     rr, map of radius values relative to SXT_CEN sun center, 
       in units of solar radii 
     pa, map of position angles (positive E from N, degrees)
     xy(dim, dim, 2) maps of x and y values relative to sun center
 CALLS: ***
	get_rb0p [1], get_rb0p [2], gt_pix_size, gt_res, gt_shape_cmd, sxt_cen [1]
	sxt_cen [2]
 CALLED BY:
	GET_PA
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     HSH, written 20-jun-97
     29-sep-00, added "center" and "show" keywords (HSH)
      9-sep-01, added "get"  and "coords" keywords


sxt_satpix [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_satpix.pro
[Previous] [Next]
 NAME:
   sxt_satpix
 PURPOSE:
   Locate and flag saturated pixels in SXT images.
   Includes +1 and -1 pixels in the vertical direction (for blooming).
 CALLING SEQUENCE:
   satpix = sxt_satpix(index,data)
   satpix = sxt_satpix(index,data,ss)
   satpix = sxt_satpix(index,data,ss,sat_limit=sat_limit)
 INPUTS:
   Index  = SXT index structure
   data   = SXT data cube (byte type, compressed)
 OPTIONAL INPUTS:
   ss	   = Indices of a subset of images to process (default is all images)
 OPTIONAL INPUT KEYWORDS:
   sat_limit	= Vector with 3 elements with the values for the saturation
		  limits ([full, half, quarter]).  Default is (ge):
		  sat_limit = [235, 255, 255]	; Full, half, quarter resolution
   sparse 	= If set, returns result as a "sparse" data structure.
   upper_only	= If set, only return saturated pixels and 1 pixel above (not
		  not pixel below saturated region).
 OUTPUTS:
   Result of call is a 2-d by n_elements(ss) byte array.  
   Saturated pixels are flagged with a 1.
 CALLS: ***
	gt_res, sparse [1], sparse [2], sparse [3]
 CALLED BY:
	SDC_VERIFY, SXT_PREP0, sxt_prep [1], sxt_prep [2], sxt_prep [3]
 MODIFICATION HISTORY:
    9-mar-93, J. R. Lemen, LPARL
    20-apr-93, JRL, Changed the check from gt to ge sat_limit
    15-Jan-04, LWA, Removed byte-type limitation.


sxt_satpix [2] $SSW/yohkoh/sxt/idl/util/sxt_satpix.pro
[Previous] [Next]
 NAME:
   sxt_satpix
 PURPOSE:
   Locate and flag saturated pixels in SXT images.
   Includes +1 and -1 pixels in the vertical direction (for blooming).
 CALLING SEQUENCE:
   satpix = sxt_satpix(index,data)
   satpix = sxt_satpix(index,data,ss)
   satpix = sxt_satpix(index,data,ss,sat_limit=sat_limit)
 INPUTS:
   Index  = SXT index structure
   data   = SXT data cube (byte type, compressed)
 OPTIONAL INPUTS:
   ss	   = Indices of a subset of images to process (default is all images)
 OPTIONAL INPUT KEYWORDS:
   sat_limit	= Vector with 3 elements with the values for the saturation
		  limits ([full, half, quarter]).  Default is (ge):
		  sat_limit = [235, 255, 255]	; Full, half, quarter resolution
   sparse 	= If set, returns result as a "sparse" data structure.
   upper_only	= If set, only return saturated pixels and 1 pixel above (not
		  not pixel below saturated region).
 OUTPUTS:
   Result of call is a 2-d by n_elements(ss) byte array.  
   Saturated pixels are flagged with a 1.
 CALLS: ***
	gt_res, sparse [1], sparse [2], sparse [3]
 CALLED BY:
	SDC_VERIFY, SXT_PREP0, sxt_prep [1], sxt_prep [2], sxt_prep [3]
 MODIFICATION HISTORY:
    9-mar-93, J. R. Lemen, LPARL
    20-apr-93, JRL, Changed the check from gt to ge sat_limit


sxt_scatim $SSW/yohkoh/ucon/idl/foley/sxt_scatim.pro
[Previous] [Next]
 CALLING :  scatter_image=sxt_scatim( index, image, temps)


 INPUTS :   
     
     index :  The specific index element corresponding to the image.

     image :  must be 2-d, quarter resolution, normalised and not
              corrected for vignetting of SXT.
                
     temps :  This is an array equal in size to the image, containing
              the coresponding pixel temps in log10(te). If any temps in the 
              array, are not set, they default to 1.8MK.

 OUTPUTS : 

   scatter_image : The quarter resolution scatter image, for the 
                   relevant filter image. 
                       
 RESTRICTIONS : 
                  Temperatures must be estimated for all regions. 

      HISTORY : 
           ATP         1994,  wrote original program. 
           CAF March 5 1995,  Rewriten, to optimise performance.
           CAF,JRL April 11 1995, Index is now passed to select correct 
           filter, temps array should now be in the log10(Te) form.
           CAF,JRL April 31 1995, Set to call SXT_mwave
           CAF, April 19 1997, 
                              - removed restriction to quarter resolution. 
                              - may pass N images through for scatter estimation
                              - set call to srs970419.0000 for lambda^-2 dependence in scatter wings 


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

 Make a scattered light image from an SXT composite image.


PRO sxt_scatter, composite, scatter, level=level, power=power


 INPUT PARAMETERS:
	composite = composite image, Full frame.

 OUTPUT PARAMETERS:
	scatter = scattered light image.

 OPTIONAL INPUT KEYWORDS:
	level = level of scattered light.  Default = 0.00168.
	power = power-law index of scattered light.  Default = -1.89

 CALLED BY:
	sxt_comp_sharp
 RESTRICTIONS:
	The scattering function is only valid for the thin filters:
	Al.1, AlMg, Mg3.
	Uses Fourier transforms for convolution.
	USES BIG ARRAYS, TAKES TIME, USES MEMORY.

 HISTORY:
	Written June 17, 1994   Barry LaBonte
	Cleaned up the code   June 21, 1994  BJL
	Default values are Acton's result for 6-Sep-92 image  June 23,1994 BJL


sxt_scatwings $SSW/yohkoh/sxt/idl/atest/sxt_scatwings.pro
[Previous] [Next]
 NAME:
	sxt_scatwings
 PURPOSE
	To prepare an array mimicing the sxt scattering wings, including
	the entrance filter shadow rays.
 CALLING EXAMPLE
	out = sxt_scatwings(res,rr)
	out = sxt_scatwings(index(0)[,rr])
	out = sxt_scatwings(1)
 INPUT
	res, sxt image resolution in the form of a number (i.e., 0 for FR, i
	     1 for HR, 2 for QR) or an index structure.
 OPTIONAL KEYWORD INPUT
	no_ctr_smooth, set this keyword to avoid 7-point smoothing of
	    the wing array out to R=5 pixels.
 OUTPUT
	Array (not normalized) giving the scattering function.  Array size is
		FR	2049x2049
		HR	1025x1025
		QR	513x513
	The arrays are made one pixel larger than the SXT images in order to
	have a center pixel.
 OPTIONAL OUTPUT
	rr, array giving the radial distance of every pixel from the center
	    pixel in pixel units.
 DETAILS
	Based upon extensive analysis of 27-Feb-92 09:51 X-flare starburst
	I have concluded that -2 is the best choice of slope for the scattering
	wings, both in and between the rays.  The intensity in the rays is about
	one-third the intensity between the rays.  To match the appearance of
	the starburst I've set the rays equal to one degree and 4 degrees and 
	applied a 7-pixel boxcar smoothing of the scatter image.  The expression
	used to produce the model starburst is

		signal = 3e6 * rr^(-2)
       Slope is user-defineable, default is -2.


 PROGRAMS CALLED
	datatype, findgen, rebin, reform, sqrt, temporary, sector_bound
 HISTORY
	 9-Apr-2001  LWA, written
	10-Apr-2001  LWA, changed variable mask to maskk to avoid IDL conflict.
			  Added keyword no_ctr_smooth.
	30-May-2001  LWA, Rotated rays 1 degree clockwise.
V2.00  26-Apr-2002  DMcK, Allows user-defined slope, and removed call
			  to BIG_SMOOTH -- it was changing the slope.
			  Promoted to Version 2.00
 CALLS:
 CALLED BY
	sxt_psf


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

 PURPOSE:
   Prepare a composite SXT image from 2 or 3 Half or Quarter Res images.

 CALLING SEQUENCE EXAMPLES:

 INPUTS:
   index = SXT index structure
   data  = 3-d data cube (at least 2 images)


 OUTPUT:
   comp_index - the adjusted index of the composite (history added)
   comp_data  - the composite data array

 OPTIONAL INPUT KEYWORDS:

   smooth_factor = Boxcar smooth the bleed pixels.  If not defined, the
	     default is to smooth over 5 pixels.
   _extra - all others passed through to sxt_prep
  fillmap - map of pixels filled from SHORT(1) or MEDIUM(2)

 CALLS: ***
	BOX_MESSAGE, data_chk [1], data_chk [2], gt_day [1], gt_day [2], gt_expdur [1]
	gt_expdur [2], gt_time [1], gt_time [2], his_index, sxt_composite [1]
	sxt_composite [2], sxt_composite [3], sxt_prep [1], sxt_prep [2], sxt_prep [3]
 CALLED BY:
	mk_ssc [1], mk_ssc [2]
 MODIFICATION HISTORY:<F5
   15-sep-98  S.L.Freeland - from LWA 'sxt_composite.pro'
              stripped version using 'new technology'
              Calls sxt_prep internally
   21-Mar-99  S.L.Freeland - call sxt_clean independent from sxt_prep
              add /destreak, update history 
    7-Apr-99  S.L.Freeland - verify all indices->.HIS.time_compos/.day_compos
   26-Oct-99  S.L.Freeland - enabled keyword inherit->sxt_prep
   18-Dec-00  S.L.Freeland - merge LWA 'sxt_suture'
   15-Jan-01  S.L.Freeland - merge sxt_composite mods (fix 18-dec mod)
                             "released" as version 5.0

   18-Jan-2001 - S.L.Freeland - add FILLMAP output keyword
   22-Sep-2003 - D.E.McKenzie - Removed extra call to SXT_DN_UNC
   09-Oct-2003 - D.E.McKenzie - Removed a debug switch I'd left in on
				 22-Sep.
   12-Jan-2004 - LWA - Deleted ancient history info.
	Changed progverno to 6.0.
	Listed second_order_leak, sxt_cleanx, and destreak keywords
	   explicitely for clarification.
	Called sxt_clean in sxt_prep and commented out independent call.


sxt_sff_composite [2] $SSW/yohkoh/sxt/idl/atest/sxt_sff_composite.pro
[Previous] [Next]
 NAME:
   sxt_sff_composite

 PURPOSE:
   Prepare a composite SXT image from 2 or 3 Half or Quarter Res images.

 CALLING SEQUENCE EXAMPLES:

 INPUTS:
   index = SXT index structure
   data  = 3-d data cube (at least 2 images)


 OUTPUT:
   comp_index - the adjusted index of the composite (history added)
   comp_data  - the composite data array

 OPTIONAL INPUT KEYWORDS:

   smooth_factor = Boxcar smooth the bleed pixels.  If not defined, the
	     default is to smooth over 5 pixels.
   _extra - all others passed through to sxt_prep
  fillmap - map of pixels filled from SHORT(1) or MEDIUM(2)

 CALLS: ***
	BOX_MESSAGE, data_chk [1], data_chk [2], gt_day [1], gt_day [2], gt_expdur [1]
	gt_expdur [2], gt_time [1], gt_time [2], his_index, sxt_composite [1]
	sxt_composite [2], sxt_composite [3], sxt_prep [1], sxt_prep [2], sxt_prep [3]
 CALLED BY:
	mk_ssc [1], mk_ssc [2]
 MODIFICATION HISTORY:<F5
   15-sep-98  S.L.Freeland - from LWA 'sxt_composite.pro'
              stripped version using 'new technology'
              Calls sxt_prep internally
   21-Mar-99  S.L.Freeland - call sxt_clean independent from sxt_prep
              add /destreak, update history 
    7-Apr-99  S.L.Freeland - verify all indices->.HIS.time_compos/.day_compos
   26-Oct-99  S.L.Freeland - enabled keyword inherit->sxt_prep
   18-Dec-00  S.L.Freeland - merge LWA 'sxt_suture'
   15-Jan-01  S.L.Freeland - merge sxt_composite mods (fix 18-dec mod)
                             "released" as version 5.0

   18-Jan-2001 - S.L.Freeland - add FILLMAP output keyword

    Previous History:
    8-Nov-91, L. W. Acton (Wrote composite)
   19-May-92, LWA  (Several more mods in betwee)
   13-may-93, J. R. Lemen, Re-wrote.  Calls sxt_satpix
    1-Dec-93, MDM - Corrected error with the use of "s2" (when it is -1)
		- Modification on selection of replacement pixels.
		  It used to check (a) that it was high signal (ge 90)
				   (b) that it was not saturated
		  Added check so that it replaced pixels in the longer 
		  exposure only when the longer exposure was saturated
    15-Dec-93, SLF - Fixed typo (stapix->satpix)
    22-feb-94, JRL - Corrected the algorithm; 
		    - added smooth_factor, sfd, dc_interpolate, registeq
    17-Apr-94, LWA - Fixed /sfd scaling option (1000.*  was needed)
		    - Changed /plot to plot raw input images.
		    - Added RESTRICTIONS statement to header.
		    - Added despike=despike keyword.
    23-jun-94, JRL - Output is floating if input is a fltarr;
		    - Call sfd_comp with index=index to normalize properly
    08-May-95, LWA - Fixed to return negative values.
    02-Nov-96, LWA - Added output of index with history record.
		    - Made dc_data a keyword intput.
		    - Made dc_interpolate the default is dc_data not input.
    04-Nov-96, LWA - Removed forgotten diagnostic.
    10-Jan-97, LWA - Corrected calling sequence examples.


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

 Sharpens SXT images using iterative (Jansen-Van Citters type)
	algorithm.  Forces result to be > 0, conserves total
	flux.

PRO sxt_sharpen, index, imagein, result, noise, gain=gain, cutoff=cutoff, maxcount=maxcount, dim=dim

 Input parameters:
	index = Yohkoh index structure for image.  Used to get
		image location, filter
	imagein = SXT flux image, decompressed and dark subtracted.

 Output parameters:
	result = sharpened image

 Optional Output Parameter:
	noise = noise image, approximation to noise in input image

 Optional Input Keywords:
	gain = gain factor for iteration.  Fraction of error that is
		used to make next correction, 0. < gain < 1.. 
		Default = 0.7
	cutoff = threshold for iteration.  This is the ratio
		 of the largest absolute difference to the largest
		 image intensity.  Default = 0.02
	maxcount = maximum number of iterations to compute.
		 Default = 10
	dim = dimension of PSF image to use.  This trades off
		speed of comvolution with accuracy.  Default = 33.

 CALLS: ***
	STDEV, gt_center, gt_filtb, sxt_psf
 Procedure:
	Convolve the image with the point-spread-function.
	Difference of image and convolved image is a correction
	to the image.  Iterate to stable result.  Forces result
	to be positive and conserve total flux at each step.
	Separation of noise and signal is based on the idea that
	noise acts like spatial delta functions, while signal
	is always convolved with PSF.  Noise estimation is best for
	smooth images.

 History:
	Written June 4, 1993  Barry LaBonte
	New psf, better flux accounting, noise determination  April 5, 1994  BJL
	Bug fixes, add /DIM keyword, progress reporting    May 23, 1994   BJL


sxt_sig_per_dn_lwa $SSW/yohkoh/ucon/idl/acton/sxt_sig_per_dn_lwa.pro
[Previous] [Next]
 NAME:
  sxt_sig_per_dn_lwa

 PURPOSE:
  Compute a table of photon/DN or erg/DN for a given SXT filter 
  and wavelength band.

 CALLING SEQUENCE:
  erg_dn_lwa = sxt_sig_per_dn(Te,filter,date=date,short,long,/erg)
  photon_dn_lwa= sxt_sig_per_dn(Te,filter,date=date,short,long,/photon)
  erg_dn_lwa = sxt_sig_per_dn(Te,2,20,100,/erg)
  sig_dn_lwa = sxt_sig_per_dn(Te,filter,date='1-dec-92')  ; entrance filter changed

 INPUTS:
  filter = SXT analysis filter number (can be a vector)
	  1   Open       Op
	  2   Al.1       A1
	  3   AlMg       AM
	  4   Be119      Be
	  5   Al12       A2
	  6   Mg3        Mg
  Te = alog10(temperature)	Can be a vector

 ===========================================================================
 For example, the calling arguments might look like the following:

 IDL> Te = 5.5 + findgen(26)*.1 & pmm,te ; Generate a Temp vector 5.5 to 8.0
 IDL> out = sxt_sig_per_dn_lwa(Te,indgen(6)+1)       ; Compute for all filters
 IDL> help,Te,out
 TE              FLOAT     = Array(26)
 OUT             FLOAT     = Array(26, 6)
 ===========================================================================

 OPTIONAL INPUT:
       short = short wavelength (Angstrom), default = 1
       long  = long wavelength (Angstrom), default = 300

 OPTIONAL INPUT KEYWORDS:
   date = 'date' in the standard format to account for change
	in entrance filter transmission in November 1992.
   /photon if you want the program to return photons/DN
   /loud, prints out some diagnostic information

 OUTPUTS:
	Returns the alog10(erg/DN) or alog10(photon/DN) for specified filters

 CALLS: ***
	DOC_LIBRARY, MEWE_SPEC_LWA, sxt_flux [1], sxt_flux [2], sxt_flux [3]
 CALLED BY:
	sxl2radiance
 RESTRICTIONS:
  If the dates of interest span the time of 17-nov-92, then separate
  calls must be made for data before and after this date.

  Te must be in the range 5.50 to 8.00

  Short must be 1 or greater 
  Long must be 300 or smaller 

 PROGRAMS CALLED
	mewe_spec_lwa, sxt_flux

 MODIFICATION HISTORY:
   23-jul-93, L. Acton, Written.
   27-jul-93, J. Lemen, Renamed to sxt_erg_per_dn_lwa.  Vectorized for speed.
   31-jul-93, JRL, Added noverbose in call to sxt_flux
   18-nov-93, JRL, Made the /noverbose switch in sxt_flux call explicit.
   30-jul-94, LWA, Added capability to compute flux for spectral bands.
   11-jun-96, LWA, Added capability to return photons/DN and removed
			requirement that wavelengths be integral.
		        Designed for use with LWA version of MEWE_SPEC.
   30-jun-96, LWA, Made output double precision.
    6-Nov-98, LWA, Changed call to mewe_spec_lwa and name of program.
    4-Jul-99, LWA, Added keyword loud.


sxt_ssc2file $SSW/yohkoh/sxt/idl/atest/sxt_ssc2file.pro
[Previous] [Next]
   Name: sxt_ssc2file

   Purpose: convert SXT ssc images -> FITS w/cleanup + registration

   Input Paramters:
      time0, time1 - time range of interest (assumes SSCFILES not passed in)
      
   Keyword Paramters
      sscfiles - list of files to convert (instead of time range)
      eightbit/sixteenbit - passed to sxt_ssc_rationalize
      _extra - passed to sxt_ssc_rationalize 
      
   History:
      Circa 1-Jan-2000 - S.L.Freeland - sscs->pretty FITS (non-quantitative)

   Calls: ***
	BOX_MESSAGE, RD_XDA [1], RD_XDA [2], STR2ARR [1], STR2ARR [2], curdir [1]
	curdir [2], data_chk [1], data_chk [2], gt_filtb, gt_shape_cmd, mwritefits
	ssc_files [1], ssc_files [2], ssc_files [3], struct2ssw, sxt_ssc_rationalize


sxt_ssc2sss $SSW/yohkoh/sxt/idl/atest/sxt_ssc2sss.pro
[Previous] [Next]
   Name: sxt_ssc2sss

   Purpose: make a log/bytescaled version of an ssc (new prefix = sss)

   Input Parameters:
      sscfiles - list of ssc files to convert

   Keyword Parameters:
      register - if set, register including roll correction
      ref_image - index of registration reference (def is 1st image in ssc)
      refss - SS of desired ref_image relative to all sscfiles
              If REFSS=-1, it will use the 'middle' image
      reftest - just show which reference images used 
      outdir - output directory for 'sss...' files (def = $DIR_SXT_SSS)
      outfiles - output file names  (def is derived from ssc
      regenerate - if set, force remake of 'sss' for all input 'ssc'files
        [if sss exists and has same number of images as ssc, default is to
         not remake it - use /regenerate to force]
      decon - if set, apply SXT_DECON to images
  
   Calling Sequence:
      sxt_ssc2sss, sscfiles [,outdir=outdir] [,outfile=outfile] [,/regenerate], $
                            [ ,/register ] [, ref_image=ref_image] [, decon=decon]

   History:
      21-April-1999 - S.L.Freeland
      22-April-1999 - S.L.Freeland (documment)
      11-Jan-2000   - S.L.Freeland add REFSS and /REFTEST
       8-Aug-2000   - S.L.Freeland fix undefined variable if un-registered
      23-Jul-2001   - G.L.Slater - Added SXT_DECON option
      26-jul-2001 -   S.L.Freeland - assure ''decon' defined
  
 CALLS: ***
	BOX_MESSAGE, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1]
	CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], RD_XDA [1], RD_XDA [2]
	Rd_Roadmap [2], SSS_SCALE, break_file [4], concat_dir [4], curdir [1], curdir [2]
	data_chk [1], data_chk [2], file_exist [1], file_exist [3], get_info [1]
	get_info [2], get_info [3], get_info [4], get_logenv [1], get_logenv [2]
	rd_roadmap [1], safe_log10, sav_sda [1], sav_sda [2], sav_sda [3], str_replace [1]
	str_replace [2], sxt_decon [1], sxt_decon [2], sxt_prep [1], sxt_prep [2]
	sxt_prep [3]
   Restrictions:  
      (TODO) Review res/filter dependent scaling via mini function
             'sss_scale.pro'


sxt_ssc_rationalize $SSW/yohkoh/sxt/idl/atest/sxt_ssc_rationalize.pro
[Previous] [Next]
   Name: sxt_ssc_rationalize

   Purpose: register and optionally scale ssc/sss data

   Input Parameters:
      index, data
      
   Output Parameters:
      iout, dout - registered and optionally scaled 

   Keyword_Parameters:
      outres -  standard Yohkoh interp, default=1 (half res)
      outsize - output image size
 CALLS:
 CALLED BY
	sxt_ssc2file


sxt_ssn2fits [1] $SSW/yohkoh/sxt/idl/atest/sxt_ssn2secondary.pro
[Previous] [Next]
   Name: sxt_ssn2fits

   Purpose: convert ssc or sss files -> "Standard" FITs 
            for export and -> YPOP/WWW movie maker

   Input Parameters:
      ssnfiles - file list to process
  
   Keyword Parameters:
      outsize - size of output (for embedding, default = 576x576)
      outres  - default = 1 (half res = ~2.54"/pix) 
      outdir  - where to stick files

 CALLS: ***
	BOX_MESSAGE, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1]
	CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], Rd_Roadmap [2]
	SXT_SSN2SECONDARY, TIME2FILE, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], break_file [4], concat_dir [4], event_movie [1], event_movie [2]
	file_append [1], file_append [2], file_exist [1], file_exist [3], file_list [1]
	file_list [2], get_info [1], get_info [2], get_info [3], get_info [4], gt_filtb
	gt_shape_cmd, html_doc, image2movie, last_nelem, mwritefits, rd_roadmap [1]
	rd_tfile [1], rd_tfile [2], safe_log10, sort_index [1], sort_index [2]
	special_movie, str2html [1], str2html [2], str2html [3], str_replace [1]
	str_replace [2], struct2ssw, sxt_prep [1], sxt_prep [2], sxt_prep [3]
   Side Effects:
      data is registered to sun center - fits file written


sxt_ssn2fits [2] $SSW/yohkoh/sxt/idl/atest/sxt_sss2fits.pro
[Previous] [Next]
   Name: sxt_ssn2fits

   Purpose: convert ssc or sss files -> "Standard" FITs 
            for export and -> YPOP/WWW movie maker

   Input Parameters:
      ssnfiles - file list to process
  
   Keyword Parameters:
      outsize - size of output (for embedding, default = 576x576)
      outres  - default = 1 (half res = ~2.54"/pix) 
      outdir  - where to stick files

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], Rd_Roadmap [2], SXT_SSS2FITS
	TIME2FILE, concat_dir [4], curdir [1], curdir [2], gt_filtb, gt_shape_cmd
	mwritefits, rd_roadmap [1], struct2ssw, sxt_prep [1], sxt_prep [2], sxt_prep [3]
   Side Effects:
      data is registered to sun center - fits file written


SXT_STRUCT $SSW/yohkoh/gen/idl/ref_access/sxt_struct.pro
[Previous] [Next]
       NAME:
               SXT_STRUCT
       PURPOSE:
               Define the following SXT specific database structures
                       * SXT_QS_Instr_Rec         
                       * SXT_QS_Conv_Rec          
                       * SXT_Index_Rec            
                       * SXT_Gnd_Idx_Rec          
                       * SXT_Proc_Idx_Rec         
                       * SXT_RoadMap_Rec          

                       * SXT_SumLog_Rec
                       * SXT_RAMDump_Rec
                       * SXT_DarkLog_Rec
                       * SXT_EnginLog_Rec
                       * SXT_OptTel_Rec
                       * SXT_Leak_Rec

       CALLING SEQUENCE:
               SXT_STRUCT
 CALLED BY:
	GET_SDA, RD_STR_DATA, RD_SXL_DATA, his_index, mk_sd2, mk_sdc [2], mk_sdc [3]
	mk_sdc [4], mk_sdl, mk_sl [1], mk_sl [2], mk_sot, mk_ssl, mk_sxc, mk_sxh, mk_sxl
	rd_roadmap [1], rd_sdl, rd_sld, rd_sls, rd_sot, rd_ssl, rd_sxc, rd_sxtgoes
	rd_week_file [1], rd_week_file [2], rd_week_file [3], rd_week_file [4]
	sxt_cba2os1 [1], sxt_cba2os1 [2], weekid [2], wrtsxtmap, ydb_exist [2]
       HISTORY:
               written by Mons Morrison, Fall 90.
               15-Mar-93 (MDM) - Modified to have the structure version
                                 number in the structure name
               28-Feb-93 (MDM) - Changed the label information for the
                                 temperature house keeping sensors


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

   Purpose: display summary mosaic of new sfd and observing region locations 
		
   Input Parameters
      nimages - (optional) number of sxt images to display (

   Keyword Paramters:
      save - if set, save display in generic file (used by /fast switch)
      fast - if set, read previously saved display
      
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], FILE_EXIST [2], WDEF [1], WDEF [2], break_file [4], concat_dir [4]
	file_exist [1], file_exist [3], lastsfd [1], lastsfd [2], newsfd, restgen [1]
	restgen [2], savegen [1], savegen [2], yesnox [1], yesnox [2]
   History:
      31-Aug-1993 (SLF)
	5-sep-1993 (SLF) Add Z buffer for batch operations


sxt_sumtime $SSW/yohkoh/sxt/idl/util/sxt_sumtime.pro
[Previous] [Next]
  NAME:
    sxt_sumtime
  PURPOSE:
    Sum SXT X-ray images by in time.
    Preserve decompression uncertainty and saturated pixel information.

    Warning:  This routine clobbers the input unc_data, satpix

  CALLING SEQUENCE:
    sxt_sumtime,index,data,new_index,new_data
    sxt_sumtime,index,data,new_index,new_data,unc_data,new_unc
    sxt_sumtime,index,data,new_index,new_data,unc_data,new_unc,  $
			satpix,new_satpix
    sxt_sumtime,index,data,new_index,new_data,subs=subs,time=time

  INPUTS:
    index	= SXT index structure
    data	= Image cube (must be decompressed)
  OUTPUTS:
    new_index	= Copy of the first index
    new_data	= 2-d summed array 
		  If data is float, new_data = float
		  If data is integer and new_data lt 2L^16 then new_data = integer
		  If data is integer and new_data ge 2L^16 then new_data = float
  OPTIONAL INPUTS:
    unc_data	= Decompression uncertainties
    satpix	= Saturated pixels (can be a sparse structure)
		  (Max value of satpix is 255.)
  OPTIONAL OUTPUTS:
     new_unc	= 2-d array of uncertainties 
     new_satpix= 2-d array of saturated pixels (sum of all satpix's)
  OPTIONAL INPUT PARAMETERS:
    subs	= Array of subscripts to sum
  OPTIONAL OUTPUT PARAMETERS:
    time	= Total time of summed array (msec).
 CALLS: ***
	DOC_LIBRARY, UNIQ [1], UNIQ [2], UNIQ [3], gt_expdur [1], gt_expdur [2], gt_filtb
	tbeep [1], tbeep [2], tbeep [3]
  RESTRICTIONS:
    data must be decompressed and 3-d
    Allows different filter data to be summed, so be careful.

  MODIFICATION HISTORY:
    25-Mar-93, J. R. Lemen, LPARL
    30-mar-93, JRL, Changed the definition of new_satpix


sxt_sumxy $SSW/yohkoh/sxt/idl/util/sxt_sumxy.pro
[Previous] [Next]
  NAME:
    sxt_sumxy
  PURPOSE:
    Sum SXT X-ray images by sumX by sumY pixels.
    Preserve decompression uncertainty and saturated pixel information.

    Warning:  This routine clobbers the input variables.

  CALLING SEQUENCE:
    sxt_sumxy,index,data,sumX
    sxt_sumxy,index,data,sumX,sumY
    sxt_sumxy,index,data,sumX,sumY,unc_data
    sxt_sumxy,index,data,sumX,sumY,unc_data,satpix
  INPUTS/OUTPUTS:
    index	= SXT index structure
    data	= Image cube			(overwrites the input variables)
  INPUTS:
    sumX	= Number of pixels to sum together
  OPTIONAL INPUTS:
    sumY	= If missing, sumY will be set equal to sumX
  OPTIONAL INPUT/OUTPUTS
    unc_data	= Decompression uncertainties
    satpix	= Saturated pixels (can be a sparse structure)
		  (Max value of satpix is 255.)
 CALLS: ***
	tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	SXT_PREP0, SXT_TEEM1 [1], SXT_TEEM1 [2], SXT_TEEM1 [3]
  RESTRICTIONS:
    data must be decompressed and 2-d or 3-d
    Currently, the index record is not updated.

  MODIFICATION HISTORY:
    9-Mar-93, J. R. Lemen, LPARL
   16-mar-93, JRL, Fixed up round-off scheme for unc_data


sxt_suture [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_suture.pro
[Previous] [Next]
 NAME:
	sxt_suture
 PURPOSE
	  Fill in saturated areas in an SXT image with statistically
	randomized data interpolated from both sides of the bleed.
	  For use in sxt_composite.pro but can be used with
	any sxt image with saturated parts.  NOTE:  This
	code cannot tell the difference between true solar saturation
	and saturation due to bleed.
 CALLING SEQUENCE
	out=sxt_suture(img,satpix,unc,unc_out=unc_out,$
		noise_factor=noise_factor)
	out=sxt_suture(img,satpix,unc,noise_factor=3.0
 INPUT
	img = SXT image produced by SXT_PREP
	satpix = Boolean image showing saturated pixels
		(e.g., from SXT_PREP)
 OPTIONAL INPUT
	unc = uncertainty array from sxt_dn_unc.pro. (Must be 
		present to add noise to the interpolated data.)
 OPTIONAL KEYWORD INPUT
	noise_factor = set this to a value such that the visual
		appearance of the interpolated resembles the
		statistical appearance of the unsaturated image.
		A larger number lowers the noise. (default=1.0)
 OPTIONAL KEYWORD OUTPUT
	unc_out = uncertainty array of the sutured image.  This estimate
		  includes the added noise and the uncertainties of the
		  non-saturated pixels on either side of the interpolation,
		  added in quadrature.
 HISTORY
	 7-9 Oct 2000  LWA, written and tested.
	11 Oct 2000  LWA, added unc_out capability & updated header.
       18-Dec-2000, S.L.Freeland - remove 512x512 restriction
	11-Jan-2001, DMcK & LWA - The output uncert is now an honest
			attempt to estimate the uncertainty in the
			sutured pixels.
	13-Jan-2001, LWA, Fixed uncert addressing error.
			Revised uncertainty algorithm.
	21-Feb-2001, LWA, Fixed problem if edge columns saturated.
        6-Apr-2001, SLF, protect against    
	22-Sep-2003, DMcK, New estimate of uncertainty in sutured pixels.
 CALLS:
 CALLED BY
	sxt_composite [1], sxt_composite [2], sxt_composite [3], sxt_prep [1]
	sxt_prep [2], sxt_prep [3]


sxt_suture [2] $SSW/yohkoh/sxt/idl/atest/sxt_suture.pro
[Previous] [Next]
 NAME:
	sxt_suture
 PURPOSE
	  Fill in saturated areas in an SXT image with statistically
	randomized data interpolated from both sides of the bleed.
	  For use in sxt_composite.pro but can be used with
	any sxt image with saturated parts.  NOTE:  This
	code cannot tell the difference between true solar saturation
	and saturation due to bleed.
 CALLING SEQUENCE
	out=sxt_suture(img,satpix,unc,unc_out=unc_out,$
		noise_factor=noise_factor)
	out=sxt_suture(img,satpix,unc,noise_factor=3.0
 INPUT
	img = SXT image produced by SXT_PREP
	satpix = Boolean image showing saturated pixels
		(e.g., from SXT_PREP)
 OPTIONAL INPUT
	unc = uncertainty array from sxt_dn_unc.pro. (Must be 
		present to add noise to the interpolated data.)
 OPTIONAL KEYWORD INPUT
	noise_factor = set this to a value such that the visual
		appearance of the interpolated resembles the
		statistical appearance of the unsaturated image.
		A larger number lowers the noise. (default=1.0)
 OPTIONAL KEYWORD OUTPUT
	unc_out = uncertainty array of the sutured image.  This estimate
		  includes the added noise and the uncertainties of the
		  non-saturated pixels on either side of the interpolation,
		  added in quadrature.
 HISTORY
	 7-9 Oct 2000  LWA, written and tested.
	11 Oct 2000  LWA, added unc_out capability & updated header.
       18-Dec-2000, S.L.Freeland - remove 512x512 restriction
	11-Jan-2001, DMcK & LWA - The output uncert is now an honest
			attempt to estimate the uncertainty in the
			sutured pixels.
	13-Jan-2001, LWA, Fixed uncert addressing error.
			Revised uncertainty algorithm.
	21-Feb-2001, LWA, Fixed problem if edge columns saturated.
        6-Apr-2001, SLF, protect against    
 CALLS:
 CALLED BY
	sxt_composite [1], sxt_composite [2], sxt_composite [3], sxt_prep [1]
	sxt_prep [2], sxt_prep [3]


sxt_t6_resp0 $SSW/yohkoh/ucon/idl/mctiernan/sxt_t6_resp0.pro
[Previous] [Next]
 NAME:
     sxt_t6_resp0
 CALLING SEQUENCE:
     Sxt_t6_resp0, t6, t6_resp, t6_range=t6_range, no_t6=no_t6, date=date
 INPUT:
     None
 OUTPUT:
     t6 = temperature array
     t6_resp = SXT response in 10^7 K photons, at t6 for each filter
 KEYWORDS:
     t6_range = the range of temperatures, the default is 2.0 to 100.0
     no_t6 = number of temperature points, the default is 101
     date = the date, if not passed in then we use today, to deal with the entrance filter
 CALLS: ***
	ADDTIME [1], ADDTIME [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	INTERPU_1D, anytim2ints [1], anytim2ints [2], concat_dir [4], restgen [1]
	restgen [2]
 CALLED BY:
	sxt_thfsp_resp
 HISTORY:
     8-nov-95, jmm


SXT_TE $SSW/yohkoh/gen/idl/to_be_deleted/sxt_te.pro
[Previous] [Next]
 NAME:
       SXT_TE
 PURPOSE:
       Compute temperature at i1,i2 from database temperature and
       database i1, i2.
 CALLING SEQUENCE:
       te = sxt_te(arg1, arg2, arg3, arg4, arg5, arg6, getem=getem,  $
           em=em, getratio=getratio, ratio_r=ratio_r, ratio_db=ratio_db,$
           interp=interp, gain=gain, version = version
 INPUTS:
       arg1, arg2, arg3, arg4, arg5, arg6
       Type I:
         arg1   = i1
         arg2   = i2
         arg3   = periph1
         arg4   = periph2
         arg5   = t1
         arg6   = t2
       Type II:
         arg1   = i1
         arg2   = i2
         arg3   = index_1
         arg4   = index_2
       Type III:
         arg1   = i_cube
         arg2   = index_array
         arg3   = frm1
         arg4   = frm2
       
       frm1     = image number corresponding to i1
       frm2     = image number corresponding to i2 
       index_1  = index from "test_rd"
       index_2  = index from "test_rd"
       i1       = vector of number of electron for filter 1.
       i2       = vector of number of electron for filter 2.
       periph1  = number 1 periph byte parameter 
       periph2  = number 2 periph byte parameter
       t1       = time period of i1, default value is 1.
       t2       = time period of i2, default value is 1.
 OPTIONAL INPUT PARAMETERS:
       gain     = camera gain in e-/Dn. 
                  If not supplies, default= (~100). Only effects
                  calculation of em.
       getem    = If supplies, calculate EM(em)
       getratio = If supplies, output ratio of i1,i2 and database i1, i2
                  (ratio_r, ratio_db)
       interp   = If supplies, use Spline interpolation.
                  default is INTERPOL interpolation.
 OUTPUTS:
       te       = log 10 of corresponding temperature 
 OPTIONAL OUTPUTS:
       em       = log 10 of the emission measure. Uses the thinner
                  filter 
       ratio_r  = ratio of i1 and i2(or i2/i1)
                  ratio_r=(i1/t1)/(i2/t2)  [thicker/thinner]
       ratio_db = ratio of database i1 and database i2
       version  = version number of input data base file
 CALLS: ***
	INTERPOL, Periph, SPLINE, gt_expdur [1], gt_expdur [2], gt_filta, gt_filtb
	restgen [1], restgen [2], sxt_decomp [1], sxt_decomp [2], tbeep [1], tbeep [2]
	tbeep [3]
 COMMON BLOCKs:
       common sxt_te_comdb, db, text, header, label_id,
                            version1, em_assumed
       db         = array of (n_filter+1,n_temp)
                    first colum is temperature(log value)
                    rest of colum is number of electrons 
                    for corresponding filters(not filter id)
                     (n_temp is number of temperatures)
       text       = some information about the database.
       header     = time and date of the creation of database.
       label_id   = filter id number corresponding to col. number 
                    if label_id(4) = 6 means that id number 4 if at
                    col. number 4(fourth filter) in database data.
                    This information is from database file.
       version1   = version number of the database file.(from database
                    file)
       em_assumed = assumed em value.(from database file)
 RESTRICTIONS:
       Number of data points and data type in i1 and i2 should be equal. 
       Order of i1 and i2 does not matter to this program. In the
       program check the filter id, and determine which one is thicker
       the ratio is always thicker divided by thinner one.
       filt1_id,filt2_id,t1 and t2 are corresponding to i1 and i2.
 PROCEDURE:
       There are three different type of input parameters. One can use
       one of these three different type to compute temperature.
       Type I:   Input i1,i2,periph1,periph2,t1,t2,...........
       Type II:  Input i1,i2,index_1,index_2,..........
                 index_1, index_2 are from "test_rd" program
                 use index to compute periph1,2(filter a,b position),
                 and t1, t2.
       Type III: Input i_cube, index_array, frm1, frm2,........
                 i1,i2 are in i_cube, and at "frm1", and "frm2" images
                 index are in corresponding index_array.
                 
       Read data from file only for first time call this function. 
       Also get em_assumed, version1 and label_id from this file.
       Store all the information at common block sxt_te_comdb.
       Call periph to determine filter a and b positions.
       Front wheel filter id number(fila) must be 1 or 6. And if it is 6
       must multiply the data by newtral density trans.(T_ND).
       Determine the col. number in data db for corresponding filter
       id number from label_id. Then determine the order of thickness
       for corresponding filter id.
       Get the i1 and i2 vector from database, then compute the i1 and
       i2 ratio.  Always divide thicker filter by thiner filter of 
       electron, so determine which filter is thicker first, then
       compute ratio for input i1,i2 vectors and ratio for database.
       Find the corresponding temperature of i1,i2 ratio by interpolate
       the ratio value using INTERPOL function.
       te = interpol(te_db, alog10(r_db), alog10(r))
       where   te = interpolated temperature, corresponding to r.
               te_db = database temperature vector(log. value).
               r_db  = database ratio.
               r     = input i1,i2 ratio.
       If keyword INTERP is supplied, then use spline interpolation.
       te = spline(alog10(r_db), te_db, alog10(r))
            (r_db, and r must be in ascending order)
       Calculate te only for those i1 or i2 not equal to zero.
       Compute em by using thin filter.
       em = alog10(gain_ccd * ithin_db / fthin_te) + em_assumed
            fthin_te = interpol(ithin_db, te_db, te)
       If keyword getratio is supplied, then return output of ratio_r
       and ratio_db.

       Thickness corresponding to filter id number(thick_order):

                  filter name  filter id number    corresponding order 
                                                      of thickness
                  -----------  ----------------    ------------------- 
                  (temperature)     0                    0
                  noback            1                    1
                  al 1265 A         2                    2
                  al/mg/mn          3                    3
                  mg 2.52           6                    4
                  al 11.6 um        5                    5
                  be 119 um         4                    6
       thick_order = [0,1,2,3,6,5,4], corresponding to filter id

 MODIFICATION HISTORY:
       Written by Fei-Mei Lee Chou, July 10, 1991.
       Modified by Fei-Mei Lee Chou, Jan 1992.
	updated by GAL Oct 92, bug fix to EM calculation.
	Updated by JRL 19-jan-93, Read the sre930119_01.genx file.
	20-may-93, JRL,  Disabled the routine (SXT_TEEM should not be used)


SXT_TE_CURVE $SSW/yohkoh/ucon/idl/shimizu/sxt_teem_curve.pro
[Previous] [Next]
 NAME:
      SXT_TE_CURVE
 PURPOSE:
      Compute the temperature and EM of the time-sequential data.
 CALLING SEQUENCE:
      sxt_teem_curve, arg1, arg2, arg3, arg4, te, em
 INPUTS:  
      arg1 - index_1 (Yohkoh index structure) 
      arg2 - i1 (vector of number of electron for filter 1)
      arg3 - index_2 (Yohkoh index structure)
      arg4 - i2 (vector of number of electron for filter 2) 
          arg1, arg2, arg3, arg4 are time-sequence data. 
 OPTIONAL INPUTS:
      Most of them are same as those of SXT_TE.pro. Refer to SXT_TEEM.PRO.


 OUTPUTS:
      Same as those of SXT_TEEM.PRO. Refer to SXT_TEEM.PRO.
 OPTIONAL OUTPUTS:
      Most of them are same as those of SXT_TEEM.PRO. Refer to SXT_TEEM.PRO.


 REGISTRATIONS:
      Cannot be used for the spacial distribution. 
  ##################
      NEED CONSIDERATION of TIME DIFFERENCE between i1 and i2.
           ARG1 and ARG3.
  ##################
 CALLS: ***
	SXT_TEEM [1], SXT_TEEM [2], SXT_TEEM_CURVE, gt_filtb
 PROCEDURE:
      Use "SXT_TEEM.PRO" to compute the temperature.
 HISTORY:
      16 June, 1993  written by T.Shimizu (U.Tokyo)


SXT_TEEM [1] $SSW/yohkoh/sxt/idl/atest/sxt_teem.pro
[Previous] [Next]
 NAME:
       SXT_TEEM
 PURPOSE:
       Compute Te, EM, d_Te, d_EM from the ratio of the two input data arrays.
 CALLED BY:
	BORN_AGAIN, DO_TEEM, SLOPE_TEMP, SXT_HYST, SXT_TE_CURVE, TEEM_BIT, WITH_INT
	azimuth_teem [1], azimuth_teem [2], cur_teemcursor Te and EM, dem_tr_er
	dem_tr_er0, go_teem [1], go_teem [2], go_teem_nn, go_teem_t, mc_unc, pr_teem
	sxt_av_teem, sxt_fl_analxpro, sxt_tfl, sxt_tflx, sxt_thinit, sxtbox_teem
	  NOTE: To do this _without_ use of index structures use sxt_teem2.pro. 
 CALLING SEQUENCE:
       sxt_teem, index1, Image1, index2, Image2, Te 
       sxt_teem, index1, Image1, index2, Image2, Te, EM, gain=gain, subs=subs
	sxt_teem, index1, Image1, index2, Image2, Te, EM, d_Te, d_EM, Valid
	sxt_teem, index1, Image1, index2, Image2, Te, EM, d_Te, d_EM, sum=sum
 INPUTS:
       index1  = index (structure)    of Image1
       Image1  = SXT image (DN), if byte type then sxt_prep is called.
       index2  = index (structure)    of Image2
       Image2  = SXT image (DN) through a different filter, if byte
			type then sxt_prep is called. 
	  NOTE:  The Image variables can be either the raw compressed
		SXT images, simple scalars, or images that have already
		been processed through SXT_PREP.  In the latter case
		the index structure created by SXT_PREP must be supplied.
		It is O.K. to input exposure-normalized PREP'd images
		although the d_te and d_em results will not be identical
		as when using raw compressed data because of round-off
		error.
		 When comparing results using raw compressed vs. PREP'd 
		input care must be taken to assure that the registration
		reference image is the same in both cases.
 OPTIONAL INPUT KEYWORDS:
       t1,t2	= Exposure times in msec.  These values will override
		  those in index1 and index2 if index1 and index2 are supplied.
		  If index1 and t1 are not supplied, default to 1000 msec.
	subs	= If image1 and image2 are 3-d, index of images to process.
       gain    = camera gain in e-/Dn.  
                 If not supplied, default= (~100). Used in EM calculation.
       interp  = If set, use Spline interpolation of SXT response functions
		  Default is linear interpolation.  
		  (NOTE: SPLINE [IDL user library] fails on lindexe images.)
	sat1,sat2=Array of saturated pixels (if Image is not byte-type).
	unc1,unc2=Array of decompression uncertainties (if Image not byte-type).
	sum	= Sum over sum X sum pixels before computing Te.  
	satval	= value of sat1 or sat2 to treat as a saturated pixel (def=1).
	average	= If set, return average Te and total EM for entire image.
	thresh1,thresh2 = Minimum threshold (in DN) of background subtracted
			  and rebinned (sum=X) image1, image2
	date	= Time in any format (including structure). Used to
		  determine entrance filter transmission (not needed if
		  index1 or index3 is an SXT index structure).
 OUTPUTS:
	Te	= log10(Temp)  (invalid temps = 0)
 OPTIONAL OUTPUTS:
	EM	= log10(Emission measure).  
	d_Te	= Statistical uncertainties of Te  (log10 units)
	d_EM	= Statistical uncertainties of EM (includes uncertainty of d_Te)
			(log10 units)
	Valid	= Array of valid pixels (=0).  -1 = bad ratio values.
 OPTIONAL OUTPUT KEYWORDS:
       version  = version number of input data base file
 CALLS: ***
	DOC_LIBRARY, SXT_TEEM1 [1], SXT_TEEM1 [2], SXT_TEEM1 [3], fastdoc [1], fastdoc [2]
	tbeep [1], tbeep [2], tbeep [3]
 COMMON BLOCKs:
	None. (In sxt_teem2, sxt_teem_db contains SXT response curves: sre*genx)
 RESTRICTIONS:
       o Image1 and Image2 must be the same size (1-d or 2-d or 3-d).
  Possible calling options:

       Index                     Image
       --------                  ------------
       Structure                 Scalar
       Structure                 2D image
       Vector of structures(k)   3D data cube (n,m,k)

       The output (Te, EM, dTe, dEM) will generally be the same dimensions as the
       input image array unless the sum or average keyword options are specified.
 PROCEDURE:
	o Will compute ratio of thicker/thinner to determine Te.
	o Calls sxt_prep with /reg, /float, and /dc_orbit correct
		if imageX is byte type.
	o Use thinner image for EM determination.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Double Valued Functions:
    The following filter ratios are doubled valued (launch entr. filters)
        Al12/Noback, Al12/Al.1, AL12/AlMg, Al12/Mg3
        Mg3 /Noback, Mg3 /Al.1, Mg3 /AlMg
    The temperatures returned may be a LOWER limit to the actual value.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 MODIFICATION HISTORY:
	29-mar-93, J. Lemen,  Can now handle data cubes.
			      (sxt_teem calls sxt_teem1 which calls sxt_teem2)
	 2-apr-93, J. Lemen,  Fixed bug for t1, t2 in single image case.
	22-dec-93, JRL, Fixed an IDL V3.1 related bug
	 8-sep-94, JRL, d_EM now includes uncertainty caused by d_Te
			Minor change to the informational timing messages
	18-nov-94, JRL, Fixed an bug with cubes that are (1,1,N)
	28-Jan-95, JRL, Updated the documentation for filter number
	 8-mar-95, JRL, Renamed one of the input variables.
	15-Apr-02, LWA, Remaned "arg" parametes to "index".
			Updated header.


SXT_TEEM [2] $SSW/yohkoh/sxt/idl/sensitivity/sxt_teem.pro
[Previous] [Next]
 NAME:
       SXT_TEEM
 PURPOSE:
       Compute temperature from the ratio of the two input data arrays.
 CALLING SEQUENCE:
       sxt_teem, index1, Image1, index2, Image2, Te 
       sxt_teem, index1, Image1, index2, Image2, Te, EM, gain=gain, subs=subs
       sxt_teem, filt1,  Image1, filt2,  Image2, Te, EM, t1=t1, t2=t2
	sxt_teem, filt1,  Image1, index2, Image2, Te, thresh1=thresh1, /average
	sxt_teem, index1, Image1, index2, Image2, Te, EM, d_Te, d_EM, Valid
	sxt_teem, index1, Image1, index2, Image2, Te, EM, d_Te, d_EM, sum=sum
 INPUTS:
	index1	= index (structure)    of Image1 
	filt1	= Filter B value (1-6) of Image1
	Image1	= SXT counts as DN
	index2	= index (structure)    of Image2
	filt2	= Filter B value (1-5) of Image2
	Image2	= SXT counts as DN

	The filt1 or filt2 parameters, define the filter number
	the same what that is given from: print,gt_filtb()
	  1   Open       Op
	  2   Al.1       A1
	  3   AlMg       AM
	  4   Be119      Be
	  5   Al12       A2
	  6   Mg3        Mg


 OPTIONAL INPUT KEYWORDS:
       t1,t2	= Exposure times in msec.  These values will override
		  those in index1 and index2 if index1 and index2 are supplied.
		  If index1 and t1 are not supplied, default to 1000 msec.
	subs	= If image1 and image2 are 3-d, index of images to process.
       gain    = camera gain in e-/Dn.  
                 If not supplied, default= (~100). Used in EM calculation.
       interp  = If set, use Spline interpolation of SXT response functions
		  Default is linear interpolation.  
		  (NOTE: SPLINE [IDL user library] fails on large images.)
	sat1,sat2=Array of saturated pixels (if Image is not byte-type).
	unc1,unc2=Array of decompression uncertainties (if Image not byte-type).
	sum	= Sum over sum X sum pixels before computing Te.  
	satval	= value of sat1 or sat2 to treat as a saturated pixel (def=1).
	average	= If set, return average Te and total EM for entire image.
	thresh1,thresh2 = Minimum threshold (in DN) of background subtracted
			  and rebinned (sum=X) image1, image2
	date	= Time in any format (including structure). Used to
		  determine entrance filter transmission (not needed if
		  index1 or index3 is an SXT index structure).
 OUTPUTS:
	Te	= log10(Temp)  (invalid temps = 0)
 OPTIONAL OUTPUTS:
	EM	= log10(Emission measure).  
	d_Te	= Statistical uncertainties of Te
	d_EM	= Statistical uncertainties of EM (includes uncertainty of d_Te)
	Valid	= Array of valid pixels (=0).  -1 = bad ratio values.
 OPTIONAL OUTPUT KEYWORDS:
       version  = version number of input data base file
 CALLS: ***
	DOC_LIBRARY, SXT_TEEM1 [1], SXT_TEEM1 [2], SXT_TEEM1 [3], fastdoc [1], fastdoc [2]
	tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	BORN_AGAIN, DO_TEEM, SLOPE_TEMP, SXT_HYST, SXT_TE_CURVE, TEEM_BIT, WITH_INT
	azimuth_teem [1], azimuth_teem [2], cur_teemcursor Te and EM, dem_tr_er
	dem_tr_er0, go_teem [1], go_teem [2], go_teem_nn, go_teem_t, mc_unc, pr_teem
	sxt_av_teem, sxt_fl_analxpro, sxt_tfl, sxt_tflx, sxt_thinit, sxtbox_teem
 COMMON BLOCKs:
	None. (In sxt_teem2, sxt_teem_db contains SXT response curves: sre*genx)
 RESTRICTIONS:
       o Image1 and Image2 must be the same size (1-d or 2-d or 3-d).
  Possible calling options:

       Index       Image
       --------    ------------
       Scalar      Scalar
       Scalar      (n,m)  array
       Vector(k)   (n,m,k) array

       The output (Te, EM, dTe, dEM) will generally be the same dimensions as the
       input image array unless the sum or average keyword options are specified.
 PROCEDURE:
	o Will compute ratio of thicker/thinner to determine Te.
	o Calls sxt_prep if imageX is  byte type
	o Use thinner image for EM determination.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Double Valued Functions:
    The following filter ratios are doubled valued (launch entr. filters)
        Al12/Noback, Al12/Al.1, AL12/AlMg, Al12/Mg3
        Mg3 /Noback, Mg3 /Al.1, Mg3 /AlMg
    The temperatures returned may be a LOWER limit to the actual value.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 MODIFICATION HISTORY:
	29-mar-93, J. Lemen,  Can now handle data cubes.
			      (sxt_teem calls sxt_teem1 which calls sxt_teem2)
	 2-apr-93, J. Lemen,  Fixed bug for t1, t2 in single image case.
	22-dec-93, JRL, Fixed an IDL V3.1 related bug
	 8-sep-94, JRL, d_EM now includes uncertainty caused by d_Te
			Minor change to the informational timing messages
	18-nov-94, JRL, Fixed an bug with cubes that are (1,1,N)
	28-Jan-95, JRL, Updated the documentation for filter number
	 8-mar-95, JRL, Renamed one of the input variables.


SXT_TEEM1 [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_teem1.pro
[Previous] [Next]
 NAME:
       SXT_TEEM1
 PURPOSE:
       Compute Te, EM, d_Te, d_EM from the ratio of the two input data arrays.
 CALLED BY:
	SXT_TEEM [1], SXT_TEEM [2], model_spec
         NOTE: To do this without use of index structures use sxt_teem2.pro.
 CALLING SEQUENCE:
       sxt_teem, index1, Image1, index2, Image2, Te
       sxt_teem, index1, Image1, index2, Image2, Te, EM, gain=gain, subs=subs
       sxt_teem, index1, Image1, index2, Image2, Te, EM, d_Te, d_EM, Valid
       sxt_teem, index1, Image1, index2, Image2, Te, EM, d_Te, d_EM, sum=sum
 INPUTS:
       index1  = index (structure)    of Image1
       Image1  = SXT image (DN), if byte type then sxt_prep is called.
       index2  = index (structure)    of Image2
       Image2  = SXT image (DN) through a different filter, if byte type then sxt_prep is called.
         NOTE:  The Image variables can be either the raw compressed
               SXT images, simple scalars, or images that have already
               been processed through SXT_PREP.  In the latter case
               the index structure created by SXT_PREP must be supplied.
               It is O.K. to input exposure-normalized PREP'd images
               although the d_te and d_em results will not be identical
               as when using raw compressed data because of round-off
               error.
                When comparing results using raw compressed vs. PREP'd
               input care must be taken to assure that the registration
               reference image is the same in both cases.                      
 OPTIONAL INPUT KEYWORDS:
       t1,t2	= Exposure times in msec.  These values will override
		  those in index1 and index2 if index1 and index2 are supplied.
		  If index1 and t1 are not supplied, default to 1000 msec.
       gain    = camera gain in e-/Dn.  
                 If not supplied, default= (~100). Used in EM calculation.
       interp  = If set, use Spline interpolation of SXT response functions
		  Default is linear interpolation.  
		  (NOTE: SPLINE [IDL user library] fails on large images.)
	sat1,sat2=Array of saturated pixels (if Image is not byte-type).
	unc1,unc2=Array of decompression uncertainties (if Image not byte-type).
	sum	= Sum over sum X sum pixels before computing Te.  
	satval	= value of sat1 or sat2 to treat as a saturated pixel (def=1).
	average	= If set, return average Te and total EM for entire image.
	thresh1,thresh2 = Minimum threshold (in DN) of background subtracted
			  and rebinned (sum=X) image1, image2
	date	= Time in any format (including structure). Used to
		  determine entrance filter transmission (not needed if
		  index1 or index3 is an SXT index structure).
 OUTPUTS:
	Te	= log10(Temp)  (invalid temps = 0)
 OPTIONAL OUTPUTS:
	EM	= log10(Emission measure).  
	d_Te	= Statistical uncertainties of Te, log10 format.
	d_EM	= Statistical uncertainties of EM, log10 format.
	Valid	= Array of valid pixels (=0).  -1 = bad ratio values.
 OPTIONAL OUTPUT KEYWORDS:
       version  = version number of input data base file
 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], DOC_LIBRARY, SXT_TEEM2 [1]
	SXT_TEEM2 [2], SXT_TEEM2 [3], delvarx [5], fastdoc [1], fastdoc [2], fmt_tim [1]
	fmt_tim [2], gt_day [1], gt_day [2], gt_expdur [1], gt_expdur [2], gt_filta
	gt_filtb, gt_res, sxt_comp, sxt_decomp [1], sxt_decomp [2], sxt_prep [1]
	sxt_prep [2], sxt_prep [3], sxt_sumxy, tbeep [1], tbeep [2], tbeep [3]
 COMMON BLOCKs:
	None. (In sxt_teem2, sxt_teem_db contains SXT response curves: sre*genx)
 RESTRICTIONS:
       o Image1 and Image2 must be the same size and 1-2 or 2-d (not a cube).
 PROCEDURE:
	o Will compute ratio of thicker/thinner to determine Te.
	o Calls sxt_prep with /reg, /dc_orbit_correct and /float if imageX is byte type
	o Use thinner image for EM determination.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Double Valued Functions:
    The following filter ratios are doubled valued (launch entr. filters)
        Al12/Noback, Al12/Al.1, AL12/AlMg, Al12/Mg3
        Mg3 /Noback, Mg3 /Al.1, Mg3 /AlMg
    The temperatures returned may be a LOWER limit to the actual value.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 MODIFICATION HISTORY:
       10-Jul-91, Fe-Mei Lee Chou. Modified Jan 1992.  SXT_TE was a function.
	23-jan-93, G. Linford,  Changed to a procedure, parameter changes.
	28-jan-93, J. Lemen,  Extensive mods.,  GAL & KTS minor typo correction.
	 5-feb-93, J. Lemen,  J. McTiernan: Corrections and minor mods.
	15-feb-93, J. Lemen,  gt_expdur already contains 10% trans. 
	 2-mar-93, J. Lemen,  Add call to sxt_prep.  Update calling arguments
	11-mar-93, J. Lemen,  Fixed a typo
	23-mar-93, J. Lemen,  Call sxt_teem1 to do the hard work.
	24-mar-93, J. Lemen,  Fixed some typo's
	29-mar-93, JRL, Enable sum= option even if sxt_prep is not called 
			internally.  thresh1 now applied after background subtraction.
			Renamed to sxt_teem1 (sxt_teem1 renamed to sxt_teem2)
	 1-apr-93, JRL, Fixed a typo (error only if img2 was byte type).
       18-nov-93, JRL, Fixed some data checking code.
	22-dec-93, JRL, Fixed a IDL V3.1 related bug
	25-jan-94, JRL, Add a warning message if the ND filter is used
	11-feb-94, JRL, Fixed the warning message if the ND filter is used
       25-jun-94, JRL, If all data is below the threshold, simply return 0s.
			If all data is saturated, return macro pixel value anyway.
	15-apr-02, LWA, Added /float, /register, /dc_orbit_correct, and
			  /dc_interpolate switches to sxt_prep.
			Deleted return of bogus Te, etc., values in saturated areas.
			Corrected code to work with sxt_prep normalized data.
			Renamed "arg" variables to "index".
			Updated header.
      21-Feb-06, T. Wang, fixed calculations of uunc1 and uunc2 when keyword of 'average' 
                       is set, and added summations of sig1 and sig2 which are missing.
                       Fixed the keywords of sig1 and sig2 in call of sxt_teem2 when
                       filt1_th gt filt2_th


SXT_TEEM1 [2] $SSW/yohkoh/sxt/idl/atest/sxt_teem1.pro
[Previous] [Next]
 NAME:
       SXT_TEEM1
 PURPOSE:
       Compute Te, EM, d_Te, d_EM from the ratio of the two input data arrays.
 CALLED BY:
	SXT_TEEM [1], SXT_TEEM [2], model_spec
         NOTE: To do this without use of index structures use sxt_teem2.pro.
 CALLING SEQUENCE:
       sxt_teem, index1, Image1, index2, Image2, Te
       sxt_teem, index1, Image1, index2, Image2, Te, EM, gain=gain, subs=subs
       sxt_teem, index1, Image1, index2, Image2, Te, EM, d_Te, d_EM, Valid
       sxt_teem, index1, Image1, index2, Image2, Te, EM, d_Te, d_EM, sum=sum
 INPUTS:
       index1  = index (structure)    of Image1
       Image1  = SXT image (DN), if byte type then sxt_prep is called.
       index2  = index (structure)    of Image2
       Image2  = SXT image (DN) through a different filter, if byte type then sxt_prep is called.
         NOTE:  The Image variables can be either the raw compressed
               SXT images, simple scalars, or images that have already
               been processed through SXT_PREP.  In the latter case
               the index structure created by SXT_PREP must be supplied.
               It is O.K. to input exposure-normalized PREP'd images
               although the d_te and d_em results will not be identical
               as when using raw compressed data because of round-off
               error.
                When comparing results using raw compressed vs. PREP'd
               input care must be taken to assure that the registration
               reference image is the same in both cases.                      
 OPTIONAL INPUT KEYWORDS:
       t1,t2	= Exposure times in msec.  These values will override
		  those in index1 and index2 if index1 and index2 are supplied.
		  If index1 and t1 are not supplied, default to 1000 msec.
       gain    = camera gain in e-/Dn.  
                 If not supplied, default= (~100). Used in EM calculation.
       interp  = If set, use Spline interpolation of SXT response functions
		  Default is linear interpolation.  
		  (NOTE: SPLINE [IDL user library] fails on large images.)
	sat1,sat2=Array of saturated pixels (if Image is not byte-type).
	unc1,unc2=Array of decompression uncertainties (if Image not byte-type).
	sum	= Sum over sum X sum pixels before computing Te.  
	satval	= value of sat1 or sat2 to treat as a saturated pixel (def=1).
	average	= If set, return average Te and total EM for entire image.
	thresh1,thresh2 = Minimum threshold (in DN) of background subtracted
			  and rebinned (sum=X) image1, image2
	date	= Time in any format (including structure). Used to
		  determine entrance filter transmission (not needed if
		  index1 or index3 is an SXT index structure).
 OUTPUTS:
	Te	= log10(Temp)  (invalid temps = 0)
 OPTIONAL OUTPUTS:
	EM	= log10(Emission measure).  
	d_Te	= Statistical uncertainties of Te, log10 format.
	d_EM	= Statistical uncertainties of EM, log10 format.
	Valid	= Array of valid pixels (=0).  -1 = bad ratio values.
 OPTIONAL OUTPUT KEYWORDS:
       version  = version number of input data base file
 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], DOC_LIBRARY, SXT_TEEM2 [1]
	SXT_TEEM2 [2], SXT_TEEM2 [3], delvarx [5], fastdoc [1], fastdoc [2], fmt_tim [1]
	fmt_tim [2], gt_day [1], gt_day [2], gt_expdur [1], gt_expdur [2], gt_filta
	gt_filtb, gt_res, sxt_comp, sxt_decomp [1], sxt_decomp [2], sxt_prep [1]
	sxt_prep [2], sxt_prep [3], sxt_sumxy, tbeep [1], tbeep [2], tbeep [3]
 COMMON BLOCKs:
	None. (In sxt_teem2, sxt_teem_db contains SXT response curves: sre*genx)
 RESTRICTIONS:
       o Image1 and Image2 must be the same size and 1-2 or 2-d (not a cube).
 PROCEDURE:
	o Will compute ratio of thicker/thinner to determine Te.
	o Calls sxt_prep with /reg, /dc_orbit_correct and /float if imageX is byte type
	o Use thinner image for EM determination.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Double Valued Functions:
    The following filter ratios are doubled valued (launch entr. filters)
        Al12/Noback, Al12/Al.1, AL12/AlMg, Al12/Mg3
        Mg3 /Noback, Mg3 /Al.1, Mg3 /AlMg
    The temperatures returned may be a LOWER limit to the actual value.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 MODIFICATION HISTORY:
       10-Jul-91, Fe-Mei Lee Chou. Modified Jan 1992.  SXT_TE was a function.
	23-jan-93, G. Linford,  Changed to a procedure, parameter changes.
	28-jan-93, J. Lemen,  Extensive mods.,  GAL & KTS minor typo correction.
	 5-feb-93, J. Lemen,  J. McTiernan: Corrections and minor mods.
	15-feb-93, J. Lemen,  gt_expdur already contains 10% trans. 
	 2-mar-93, J. Lemen,  Add call to sxt_prep.  Update calling arguments
	11-mar-93, J. Lemen,  Fixed a typo
	23-mar-93, J. Lemen,  Call sxt_teem1 to do the hard work.
	24-mar-93, J. Lemen,  Fixed some typo's
	29-mar-93, JRL, Enable sum= option even if sxt_prep is not called 
			internally.  thresh1 now applied after background subtraction.
			Renamed to sxt_teem1 (sxt_teem1 renamed to sxt_teem2)
	 1-apr-93, JRL, Fixed a typo (error only if img2 was byte type).
       18-nov-93, JRL, Fixed some data checking code.
	22-dec-93, JRL, Fixed a IDL V3.1 related bug
	25-jan-94, JRL, Add a warning message if the ND filter is used
	11-feb-94, JRL, Fixed the warning message if the ND filter is used
       25-jun-94, JRL, If all data is below the threshold, simply return 0s.
			If all data is saturated, return macro pixel value anyway.
	15-apr-02, LWA, Added /float, /register, /dc_orbit_correct, and
			  /dc_interpolate switches to sxt_prep.
			Deleted return of bogus Te, etc., values in saturated areas.
			Corrected code to work with sxt_prep normalized data.
			Renamed "arg" variables to "index".
			Updated header.


SXT_TEEM1 [3] $SSW/yohkoh/sxt/idl/sensitivity/sxt_teem1.pro
[Previous] [Next]
 NAME:
       SXT_TEEM1
 PURPOSE:
       Compute temperature from the ratio of the two input data arrays.
 CALLING SEQUENCE:
       sxt_teem1, index1, Image1, index2, Image2, Te [, EM, gain=gain, /interp]
       sxt_teem1, filt1,  Image1, filt2,  Image2, Te,   EM, t1=t1, t2=t2
	sxt_teem1, filt1,  Image1, index2, Image2, Te, thresh1=thresh1
	sxt_teem1, index1, Image1, index2, Image2, Te, EM, d_Te, d_EM, Valid

 INPUTS:
	index1	= index (structure)    of Image1 
	filt1	= Filter B value (1-5) of Image1
	Image1	= SXT counts as DN
	index2	= index (structure)    of Image2
	filt2	= Filter B value (1-5) of Image2
	Image2	= SXT counts as DN

 OPTIONAL INPUT KEYWORDS:
       t1,t2	= Exposure times in msec.  These values will override
		  those in index1 and index2 if index1 and index2 are supplied.
		  If index1 and t1 are not supplied, default to 1000 msec.
       gain    = camera gain in e-/Dn.  
                 If not supplied, default= (~100). Used in EM calculation.
       interp  = If set, use Spline interpolation of SXT response functions
		  Default is linear interpolation.  
		  (NOTE: SPLINE [IDL user library] fails on large images.)
	sat1,sat2=Array of saturated pixels (if Image is not byte-type).
	unc1,unc2=Array of decompression uncertainties (if Image not byte-type).
	sum	= Sum over sum X sum pixels before computing Te.  
	satval	= value of sat1 or sat2 to treat as a saturated pixel (def=1).
	average	= If set, return average Te and total EM for entire image.
	thresh1,thresh2 = Minimum threshold (in DN) of background subtracted
			  and rebinned (sum=X) image1, image2
	date	= Time in any format (including structure). Used to
		  determine entrance filter transmission (not needed if
		  index1 or index3 is an SXT index structure).
 OUTPUTS:
	Te	= log10(Temp)  (invalid temps = 0)
 OPTIONAL OUTPUTS:
	EM	= log10(Emission measure).  
	d_Te	= Statistical uncertainties of Te
	d_EM	= Statistical uncertainties of EM
	Valid	= Array of valid pixels (=0).  -1 = bad ratio values.
		  1 indicates a saturated pixel (or possibly > 1 if sum>1)
 OPTIONAL OUTPUT KEYWORDS:
       version  = version number of input data base file
 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], DOC_LIBRARY, SXT_TEEM2 [1]
	SXT_TEEM2 [2], SXT_TEEM2 [3], delvarx [5], fastdoc [1], fastdoc [2], fmt_tim [1]
	fmt_tim [2], gt_day [1], gt_day [2], gt_expdur [1], gt_expdur [2], gt_filta
	gt_filtb, gt_res, sxt_comp, sxt_decomp [1], sxt_decomp [2], sxt_prep [1]
	sxt_prep [2], sxt_prep [3], sxt_sumxy, tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	SXT_TEEM [1], SXT_TEEM [2], model_spec
 COMMON BLOCKs:
	None. (In sxt_teem2, sxt_teem_db contains SXT response curves: sre*genx)
 RESTRICTIONS:
       o Image1 and Image2 must be the same size and 1-2 or 2-d (not a cube).
 PROCEDURE:
	o Will compute ratio of thicker/thinner to determine Te.
	o Calls sxt_prep if imageX is  byte type
	o Use thinner image for EM determination.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Double Valued Functions:
    The following filter ratios are doubled valued (launch entr. filters)
        Al12/Noback, Al12/Al.1, AL12/AlMg, Al12/Mg3
        Mg3 /Noback, Mg3 /Al.1, Mg3 /AlMg
    The temperatures returned may be a LOWER limit to the actual value.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 MODIFICATION HISTORY:
       10-Jul-91, Fe-Mei Lee Chou. Modified Jan 1992.  SXT_TE was a function.
	23-jan-93, G. Linford,  Changed to a procedure, parameter changes.
	28-jan-93, J. Lemen,  Extensive mods.,  GAL & KTS minor typo correction.
	 5-feb-93, J. Lemen,  J. McTiernan: Corrections and minor mods.
	15-feb-93, J. Lemen,  gt_expdur already contains 10% trans. 
	 2-mar-93, J. Lemen,  Add call to sxt_prep.  Update calling arguments
	11-mar-93, J. Lemen,  Fixed a typo
	23-mar-93, J. Lemen,  Call sxt_teem1 to do the hard work.
	24-mar-93, J. Lemen,  Fixed some typo's
	29-mar-93, JRL, Enable sum= option even if sxt_prep is not called 
			internally.  thresh1 now applied after background subtraction.
			Renamed to sxt_teem1 (sxt_teem1 renamed to sxt_teem2)
	 1-apr-93, JRL, Fixed a typo (error only if img2 was byte type).
       18-nov-93, JRL, Fixed some data checking code.
	22-dec-93, JRL, Fixed a IDL V3.1 related bug
	25-jan-94, JRL, Add a warning message if the ND filter is used
	11-feb-94, JRL, Fixed the warning message if the ND filter is used
       25-jun-94, JRL, If all data is below the threshold, simply return 0s.
			If all data is saturated, return macro pixel value anyway.
			When arg1 or arg3 is a filter number, make sure it is a scalar.


SXT_TEEM2 [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_teem2.pro
[Previous] [Next]
 NAME:
       SXT_TEEM2
 PURPOSE:
       Low level SXT temperature routine (called by sxt_teem1)
	Temperature from img2/img1 and Em from img1 
       (img1 should from the thinner of the two filters)
 CALLING SEQUENCE:
       sxt_teem2, filt1, img1, filt2, img2, Te , EM
       sxt_teem2, filt1, img1, filt2, img2, Te, EM, d_te, d_em, valid, 	$
			t1=t1, t2=t2, interp=interp, gain_ccd=gain_ccd	$
			date=date, pix=pix, n_params0=n_params0,	$
			unc1=unc1, unc2=unc2, version=version
 INPUTS:
	filt1	= Filter B value (1-5) of Img1
	Img1	= SXT counts (DN) decompressed, registered and background subtracted
	filt2	= Filter B value (1-5) of Img2
	Img2	= SXT counts (DN) decompressed, registered and background subtracted

 OPTIONAL INPUT KEYWORDS:
       t1,t2	= Exposure times in msec.  (Default is 1000 ms).
	date	= Date to determine fraction of launch entrance filter 
		  for response function (Default = '31-aug-91')
	pix	= Array of pixels to compute observed ratio.
       ccd_gain= camera gain in e-/Dn.    (Default is 100).
       interp  = If set, use Spline interpolation of SXT response functions
		  (default is INTERPOL interpolation).
	unc1,unc2=Array of decompression uncertainties (default is 0)
	n_params0=To override the number of actual parameters.  This controls
		  what calculations are done:
		  5 for Te, 6 for Te+EM, 7 for Te+EM+dTE+dEM
 OUTPUTS:
	Te	= log10(Temp)  (invalid temps = 0)
 OPTIONAL OUTPUTS:
	EM	= log10(Emission measure).  
	d_Te	= Statistical uncertainties of Te, (log10 units)
	d_EM	= Statistical uncertainties of EM 
		(includes uncertainty of d_Te) (log10 units)
	Valid	= Array of valid pixels (=0).  -1 = bad ratio values.
 OPTIONAL OUTPUT KEYWORDS:
       version  = version number of input data base file
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], DERIV
	DOC_LIBRARY, DSPLINE, break_file [4], concat_dir [4], delvarx [5], fastdoc [1]
	fastdoc [2], get_yo_dates [1], get_yo_dates [2], get_yo_dates [3], gt_filtb
	restgen [1], restgen [2], tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	SXT_TEEM1 [1], SXT_TEEM1 [2], SXT_TEEM1 [3], sxl2radiance
 COMMON BLOCKs:
	sxt_teem_db	Contains the SXT response functions (sre*genx)
 RESTRICTIONS:
       o Img1 and Img2 must be the same size, decompressed, registered,
		straylight and background corrected.
	o Not many checks are made -- assume this was done by sxt_teem1.pro
	o Will compute ratio of img2/img1 to determine Te.  
	  The caller should make sure that img1 is the thinner filter.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Double Valued Functions:
    The following filter ratios are doubled valued (launch entr. filters)
        Al12/Noback, Al12/Al.1, AL12/AlMg, Al12/Mg3
        Mg3 /Noback, Mg3 /Al.1, Mg3 /AlMg
    The temperatures returned may be a LOWER limit to the actual value.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 MODIFICATION HISTORY:
	18-mar-93, J. Lemen, Written
	23-mar-93, J. Lemen, Added modified entrance filter code
	29-mar-93, JRL, Don't return dummy unc1, unc2 arrays (call delvarx)
	18-nov-93, JRL, Fixed bug with not including Mg3 filter
	22-dec-93, JRL, Fixed an IDL V3.1 related bug
	23-mar-94, RDB, Made file name sre*.*  (VMS compatibility)
	25-jun-94, JRL, Call get_yo_dates to get open entrance filter fracton
			Return correctly dimensioned Te, EM even if there are no valid pixels.
       31-aug-94, JMM, added Klimchuk correction to EM uncertainty
                       calculation, includes temperature uncertainty
                       in EM uncertainty calculation.
	15-Apr-02, LWA  Modified to pass total signal array and observing
			time from sxt_teem1 for those cases using sxt_prep normalized input.
	19-Apr-02, LWA  Corrected case for t1 not specified.
       15-Nov-2004 - S.L.Freeland - use sxt_teem_common.pro for common  def.
	 7-Jul-2005 LWA  Commented out "Open fraction ..." print statement.


SXT_TEEM2 [2] $SSW/yohkoh/sxt/idl/atest/sxt_teem2.pro
[Previous] [Next]
 NAME:
       SXT_TEEM2
 PURPOSE:
       Low level SXT temperature routine (called by sxt_teem1)
	Temperature from img2/img1 and Em from img1 
       (img1 should from the thinner of the two filters)
 CALLING SEQUENCE:
       sxt_teem2, filt1, img1, filt2, img2, Te , EM
       sxt_teem2, filt1, img1, filt2, img2, Te, EM, d_te, d_em, valid, 	$
			t1=t1, t2=t2, interp=interp, gain_ccd=gain_ccd	$
			date=date, pix=pix, n_params0=n_params0,	$
			unc1=unc1, unc2=unc2, version=version
 INPUTS:
	filt1	= Filter B value (1-5) of Img1
	Img1	= SXT counts (DN) decompressed, registered and background subtracted
	filt2	= Filter B value (1-5) of Img2
	Img2	= SXT counts (DN) decompressed, registered and background subtracted

 OPTIONAL INPUT KEYWORDS:
       t1,t2	= Exposure times in msec.  (Default is 1000 ms).
	date	= Date to determine fraction of launch entrance filter 
		  for response function (Default = '31-aug-91')
	pix	= Array of pixels to compute observed ratio.
       ccd_gain= camera gain in e-/Dn.    (Default is 100).
       interp  = If set, use Spline interpolation of SXT response functions
		  (default is INTERPOL interpolation).
	unc1,unc2=Array of decompression uncertainties (default is 0)
	n_params0=To override the number of actual parameters.  This controls
		  what calculations are done:
		  5 for Te, 6 for Te+EM, 7 for Te+EM+dTE+dEM
 OUTPUTS:
	Te	= log10(Temp)  (invalid temps = 0)
 OPTIONAL OUTPUTS:
	EM	= log10(Emission measure).  
	d_Te	= Statistical uncertainties of Te, (log10 units)
	d_EM	= Statistical uncertainties of EM 
		(includes uncertainty of d_Te) (log10 units)
	Valid	= Array of valid pixels (=0).  -1 = bad ratio values.
 OPTIONAL OUTPUT KEYWORDS:
       version  = version number of input data base file
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], DERIV
	DOC_LIBRARY, DSPLINE, break_file [4], concat_dir [4], delvarx [5], fastdoc [1]
	fastdoc [2], get_yo_dates [1], get_yo_dates [2], get_yo_dates [3], gt_filtb
	restgen [1], restgen [2], tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	SXT_TEEM1 [1], SXT_TEEM1 [2], SXT_TEEM1 [3], sxl2radiance
 COMMON BLOCKs:
	sxt_teem_db	Contains the SXT response functions (sre*genx)
 RESTRICTIONS:
       o Img1 and Img2 must be the same size, decompressed, registered,
		straylight and background corrected.
	o Not many checks are made -- assume this was done by sxt_teem1.pro
	o Will compute ratio of img2/img1 to determine Te.  
	  The caller should make sure that img1 is the thinner filter.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Double Valued Functions:
    The following filter ratios are doubled valued (launch entr. filters)
        Al12/Noback, Al12/Al.1, AL12/AlMg, Al12/Mg3
        Mg3 /Noback, Mg3 /Al.1, Mg3 /AlMg
    The temperatures returned may be a LOWER limit to the actual value.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 MODIFICATION HISTORY:
	18-mar-93, J. Lemen, Written
	23-mar-93, J. Lemen, Added modified entrance filter code
	29-mar-93, JRL, Don't return dummy unc1, unc2 arrays (call delvarx)
	18-nov-93, JRL, Fixed bug with not including Mg3 filter
	22-dec-93, JRL, Fixed an IDL V3.1 related bug
	23-mar-94, RDB, Made file name sre*.*  (VMS compatibility)
	25-jun-94, JRL, Call get_yo_dates to get open entrance filter fracton
			Return correctly dimensioned Te, EM even if there are no valid pixels.
       31-aug-94, JMM, added Klimchuk correction to EM uncertainty
                       calculation, includes temperature uncertainty
                       in EM uncertainty calculation.
	15-Apr-02, LWA  Modified to pass total signal array and observing
			time from sxt_teem1 for those cases using sxt_prep normalized input.
	19-Apr-02, LWA  Corrected case for t1 not specified.


SXT_TEEM2 [3] $SSW/yohkoh/sxt/idl/sensitivity/sxt_teem2.pro
[Previous] [Next]
 NAME:
       SXT_TEEM2
 PURPOSE:
       Low level SXT temperature routine (called by sxt_teem1)
	Temperature from img2/img1 and Em from img1 
       (img1 should from the thinner of the two filters)
 CALLING SEQUENCE:
       sxt_teem2, filt1, img1, filt2, img2, Te , EM
       sxt_teem2, filt1, img1, filt2, img2, Te, EM, d_te, d_em, valid, 	$
			t1=t1, t2=t2, interp=interp, gain_ccd=gain_ccd	$
			date=date, pix=pix, n_params0=n_params0,	$
			unc1=unc1, unc2=unc2, version=version
 INPUTS:
	filt1	= Filter B value (1-5) of Img1
	Img1	= SXT counts (DN) decompressed, registered and background subtracted
	filt2	= Filter B value (1-5) of Img2
	Img2	= SXT counts (DN) decompressed, registered and background subtracted

 OPTIONAL INPUT KEYWORDS:
       t1,t2	= Exposure times in msec.  (Default is 1000 ms).
	date	= Date to determine fraction of launch entrance filter 
		  for response function (Default = '31-aug-91')
	pix	= Array of pixels to compute observed ratio.
       ccd_gain= camera gain in e-/Dn.    (Default is 100).
       interp  = If set, use Spline interpolation of SXT response functions
		  (default is INTERPOL interpolation).
	unc1,unc2=Array of decompression uncertainties (default is 0)
	n_params0=To override the number of actual parameters.  This controls
		  what calculations are done:
		  5 for Te, 6 for Te+EM, 7 for Te+EM+dTE+dEM
 OUTPUTS:
	Te	= log10(Temp)  (invalid temps = 0)
 OPTIONAL OUTPUTS:
	EM	= log10(Emission measure).  
	d_Te	= Statistical uncertainties of Te, (log10 units)
	d_EM	= Statistical uncertainties of EM 
		(includes uncertainty of d_Te) (log10 units)
	Valid	= Array of valid pixels (=0).  -1 = bad ratio values.
 OPTIONAL OUTPUT KEYWORDS:
       version  = version number of input data base file
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], DERIV
	DOC_LIBRARY, DSPLINE, break_file [4], concat_dir [4], delvarx [5], fastdoc [1]
	fastdoc [2], get_yo_dates [1], get_yo_dates [2], get_yo_dates [3], gt_filtb
	restgen [1], restgen [2], tbeep [1], tbeep [2], tbeep [3]
 CALLED BY:
	SXT_TEEM1 [1], SXT_TEEM1 [2], SXT_TEEM1 [3], sxl2radiance
 COMMON BLOCKs:
	sxt_teem_db	Contains the SXT response functions (sre*genx)
 RESTRICTIONS:
       o Img1 and Img2 must be the same size, decompressed, registered,
		straylight and background corrected.
	o Not many checks are made -- assume this was done by sxt_teem1.pro
	o Will compute ratio of img2/img1 to determine Te.  
	  The caller should make sure that img1 is the thinner filter.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Double Valued Functions:
    The following filter ratios are doubled valued (launch entr. filters)
        Al12/Noback, Al12/Al.1, AL12/AlMg, Al12/Mg3
        Mg3 /Noback, Mg3 /Al.1, Mg3 /AlMg
    The temperatures returned may be a LOWER limit to the actual value.
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 MODIFICATION HISTORY:
	18-mar-93, J. Lemen, Written
	23-mar-93, J. Lemen, Added modified entrance filter code
	29-mar-93, JRL, Don't return dummy unc1, unc2 arrays (call delvarx)
	18-nov-93, JRL, Fixed bug with not including Mg3 filter
	22-dec-93, JRL, Fixed an IDL V3.1 related bug
	23-mar-94, RDB, Made file name sre*.*  (VMS compatibility)
	25-jun-94, JRL, Call get_yo_dates to get open entrance filter fracton
			Return correctly dimensioned Te, EM even if there are no valid pixels.
       31-aug-94, JMM, added Klimchuk correction to EM uncertainty
                       calculation, includes temperature uncertainty
                       in EM uncertainty calculation.
	15-Apr-02, LWA  Modified to pass total signal array and observing
			time from sxt_teem1 for those cases using sxt_prep normalized input.
	19-Apr-02, LWA  Corrected case for t1 not specified.


sxt_temps $SSW/yohkoh/ucon/idl/acton/sxt_temps.pro
[Previous] [Next]
NAME:
	sxt_temps
PURPOSE:
	To plot the SXT forward support plate temperature given an
	 SXT index array
SAMPLE CALLING SEQUENCE:
	sxt_temps,index [,which,psym=psym,ss,y]
INPUT:
	index - an SXT index array
OPTIONAL INPUT:
	which - select which temperature to plot [Default: 1]
		0 = 'Metering tube center'
		1 = 'Forward support plate (mirror) '
		2 = 'Aft support plate (FW2T?)
		3 = 'Filter wheel housing (FW1T?)
		4 = 'Shutter motor case
		5 = 'TSA (thermal strap) S/C end
		6 = 'TEC hot end'       
		7 = 'CCD camera head'  
	psym=psym, select the plotting symbols [Default: psym=-1]
OPTIONAL OUTPUT
	ss - indices of index records with temperatures
	y  - temperature values for indices ss
METHOD:
	One option is to do the following:
		ff = file_list('$DIR_SXT_SDC', '*')
		rd_xda, ff, -1, index, /nodata
		sxt_temps,index,which=0
	Another option is:
		get_sfm,timegrid('1-oct-91',!stime,days=1),index,/nodata
		sxt_temps,index,ss,y
 CALLS: ***
	AHK_CONV, UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6]
	plottime [1], plottime [2]
HISTORY:
	Written Jun-92 by M.Morrison
	28-Feb-95 (LWA) _ Adapted from PLOT_TEMPS2
	10-mar-95 (LWA) - Corrected error in call


sxt_tfl $SSW/yohkoh/ucon/idl/mctiernan/sxt_tfl.pro
[Previous] [Next]
 NAME: 
	sxt_tfl
 PURPOSE:
	To generate Temperature, Emission Measure, and Density and energy
	For an SXT flare, as functions of time. For the whole flare...
 CALLING SEQUENCE:
	sxt_tfl, infile, outfile, fb1=fb1, fb2=fb2, dn_threshold=dn_threshold, all_modes=all_modes
 INPUT:
       infile= input file name
       outfile=output file name
 OUTPUT:
	index1, index2 = Image info from test_rd
	data1, data2= Images, for two filters
       sat1, sat2= sat pixels for each filter
       unc1, unc2= decomp. uncertainties for each filter
      Saved in output file:
	lpix= size of a pixel in km,
       npix0= number of pixels used in calculation, defined by some
             threshold, smoothed into a pollynomial of degree 6
	te0= Log(Avg T)
	ute0= Uncertainty in te0
	em0= Log(Total EM),
            actually, Log(average EM per pixel* number of pixels)
	uem0= Uncertainty in em0
	d0=Log(Density), average of whole flare
	ud0=Unc. in d0
       v0= log(volume)
       uv0 = unc. in volume
	e0=Log(Total Plasma Energy) in ergs
	ue0=Uncertainty in e0
       p0=log(pressure)
       up0= uncertainty in p0
 KEYWORDS:
       fb1= filter number #1, default is 4, for Be119
       fb2= filter number #2, default is 5, Al12
       dn_threshold= the threshold value, if from 0 to 1, then this is 
               interpreted as a fraction of the maximum, for
               each image. if you input a negative number, 
               then the threshold will be max(dn/(e*input))>>.
               The default is 0.05.
       all_modes= allows the use of non-flare mode stuff, experimental...
 CALLS: ***
	POLY_FIT, RD_SDA [1], RD_SDA [2], RD_SDA [3], SXT_TEEM [1], SXT_TEEM [2], av_den
	gt_dp_mode [1], gt_dp_mode [2], gt_expdur [1], gt_expdur [2], gt_filta, gt_filtb
	gt_res, int2secarr [1], int2secarr [2], seq_2fl, sxt_energy, sxt_interp [1]
	sxt_interp [2], sxt_prep [1], sxt_prep [2], sxt_prep [3], sxt_pressure
 HISTORY:
       11-22-94, jmm
       2-18-95, jmm, changed stuff around to save some memory, added /all_modes keyword
       2-22-95, jmm, some fixes to avoid crashes in DARK_SUB and SXT_TEEM


sxt_tflx $SSW/yohkoh/ucon/idl/mctiernan/sxt_tflx.pro
[Previous] [Next]
 NAME: 
	sxt_tflx
 PURPOSE:
	To generate Temperature, Emission Measure, and Density and energy
	For an SXT flare, as functions of time. For the whole flare...
 CALLING SEQUENCE:
	sxt_tflx, index, data, fb1=fb1, fb2=fb2, dn_threshold=dn_threshold, $
                 save_file=save_file, all_modes = all_modes, unc_data=unc_data, $
                 index1, index2, te0, ute0, em0, uem0, d0, ud0, $
                 e0, ue0, p0, up0, v0, uv0, npix0, unpix0
 INPUT:
       index, data = SXT index and data, can be prepped or non-prepped
 OUTPUT:
	index1, index2 = Index for the two set of filters
	lpix= size of a pixel in km,
       npix0= number of pixels used in calculation, defined by some
             threshold, smoothed into a pollynomial of degree 6
	te0= Log(Avg T)
	ute0= Uncertainty in te0
	em0= Log(Total EM),
            actually, Log(average EM per pixel* number of pixels)
	uem0= Uncertainty in em0
	d0=Log(Density), average of whole flare
	ud0=Unc. in d0
       v0= log(volume)
       uv0 = unc. in volume
	e0=Log(Total Plasma Energy) in ergs
	ue0=Uncertainty in e0
       p0=log(pressure)
       up0= uncertainty in p0
 KEYWORDS:
       fb1= filter number #1, default is 4, for Be119
       fb2= filter number #2, default is 5, Al12
       dn_threshold= the threshold value, if from 0 to 1, then this is 
               interpreted as a fraction of the maximum, for
               each image. if you input a negative number, 
               then the threshold will be max(dn/(e*input))>>.
               The default is 0.05.
       all_modes= allows the use of non-flare mode stuff, experimental...
       save_file = a filename to save the output into
       unc_data = uncertainty in data, if prepped before being passed int
 CALLS: ***
	POLY_FIT, SXT_TEEM [1], SXT_TEEM [2], av_den, gt_dp_mode [1], gt_dp_mode [2]
	gt_expdur [1], gt_expdur [2], gt_filta, gt_filtb, gt_res, int2secarr [1]
	int2secarr [2], seq_2fl, sxt_energy, sxt_interp [1], sxt_interp [2], sxt_prep [1]
	sxt_prep [2], sxt_prep [3], sxt_pressure
 HISTORY:
       11-22-94, jmm
       2-18-95, jmm, changed stuff around to save some memory, added /all_modes keyword
       2-22-95, jmm, some fixes to avoid crashes in DARK_SUB and SXT_TEEM
       12-8-95, jmm, changed to work from index and data, and output into variables


SXT_THERM $SSW/yohkoh/ucon/idl/mctiernan/sxt_therm.pro
[Previous] [Next]
 NAME: 
     SXT_THERM
 PURPOSE:
     generate responses for all SXT filters for a given power law
 INPUTS:
     therm = (T/10^6, EM/10^44) (can be array)
 OUTPUTS:
     CCD e's resulting from this thermal spectrum (*,5)
     desired filter identified by
	0	Thin Al
	1	Dag
	2	Mg
	3	Thick Al
	4	Be
 CALLS: ***
	mewe_spec [1], mewe_spec [2], restgen [1], restgen [2]
 HISTORY:
     HSH, written 29-nov-92
     HSH, updated 18-jan-92 (vector input)
     HSH, 10-feb-92 changed output to full set
     jmm, 7-Mar-93 changed output to CCD electrons
     jmm, 11-Mar-93 changed from PL to Thermal spectrum


SXT_THERM_EBAR $SSW/yohkoh/ucon/idl/hudson/sxt_therm_ebar.pro
[Previous] [Next]
 NAME:
     SXT_THERM_EBAR
 PURPOSE:
     generate mean energy of SXT response to a thermal spectrum
	(mewe_spec) 
 CALLING SEQUENCE:
     sxt_therm_ebar(temp, filter)
 INTPUTS:
     temp = temperature in MK 
     filter the desired analysis filter, from the map
       0       Thin Al
       1       Dag
       2       Mg
       3       Thick Al
       4       Be
 OUTPUTS:
      ebar in keV
 CALLS: ***
	mewe_spec [1], mewe_spec [2], restgen [1], restgen [2]
 HISTORY:
     HSH, JMcT, written 7-feb-93
     HSH, vectorized in filter range 2-apr-93


sxt_thfsp $SSW/yohkoh/ucon/idl/mctiernan/sxt_thfsp.pro
[Previous] [Next]
 NAME:
	sxt_thfsp
 PURPOSE:
	To fit spectra for sxt, using mult_th_fsp.pro
       this is for the continuous thermal models only,
 CALLING SEQUENCE:
       Sxt_thfsp, index, data, fit_pars, sc_par, ch_dta, $
                Outfile=outfile, Pfile=pfile, Filt_no=filt_no, tyspec=tyspec, $
                use_filters=use_filters, sindex=sindex, sdata=sdata, $
                sys_err=sys_err, init_a=init_a, time_range=time_range, all=all
 INPUT:
	index= info. structure for SXT data from test_rd
       data= compressed SXT data
 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), for tyspec
                  =95, a(0) = EM at peak, a(1) = peak T, a(2) = width in T,
                       a(3) = PL index
                  =96, a(0) = EM at 1MK, a(1) = low pl. index OF T (<5MK),
                    a(2) = high pl. index of T (>5MK), a(3) = cutoff T
                  =97, a(0) = EM at peak, a(1) = peak T, a(2) = width in T
                  =98, a(0)=EM at 1MK, a(1) = pl. index of T, a(2) = Max. T
                  =99, a(0)=EM at 1MK, a(1) = pl. index of T
		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
 KEYWORD INPUT:
	outfile= the output file
	pfile= a file for spectral plot
       filt_no=a filter no. to choose the SXT interval
       tyspec= type of spectrum, the default is to prompt the user
       use_filters = an array of filter numbers, 2 is al.1, 3 is AlMG,
                     4 is Be119, 5 is Al12, 6 is Mg3, the default is
                     to use [2, 4, 5]. Be careful, SXT_INTERP is used,
                     so that if you tell it a filter that isn't used
                     near the time interval that you have, you may
                     get nonsense... This has been taken care of, jmm 11-4-95
       sindex, sdata= prepped index and data, so you need not do this every time
       sys_err= 'systematic errors', useful for the mismatch in count rates
                between SXT, GOES, or pass in if you don't trust the errors
                you get from counting stats, or to arbitrarily push down chi^2
                values, The default iz 0.0.
                This makes the error in the rate = sqrt(cps/dt)+sys_err*cps.
                The use of sys_err is recommended here
       time_range = a time range, all of the points in this range are used
       All= if set, use all of the points...
 CALLS: ***
	choose_interval, dude, gt_expdur [1], gt_expdur [2], gt_filtb, int2secarr [1]
	int2secarr [2], mult_th_fsp, strip_data, sxt_interp [1], sxt_interp [2]
	sxt_prep [1], sxt_prep [2], sxt_prep [3], sxt_thinit
 HISTORY:
       2-feb-96, from SXTGOES_THFSP, jmm


sxt_thfsp_resp $SSW/yohkoh/ucon/idl/mctiernan/sxt_thfsp_resp.pro
[Previous] [Next]
 NAME:
	sxt_thfsp_resp
 PURPOSE:
       inputs filter thermal response and outputs it into a file
       which can be used by fsp_*.pro, for the multi thermal fits,
       tyspec=98 or 99
 CALLING SEQUENCE:
       sxt_thfsp_resp
 INPUT:
       reads the latest sxt response file $DIR_SXT_SENSITIVE/sre*
 OUTPUT:
       outputs the response files /ys/ucon/soft/mctiernan/sxt_thfsp_resp_0.dta
       and /ys/ucon/soft/mctiernan/sxt_thfsp_resp_1.dta
 KEYWORDS:
     t6_range = the range of temperatures, the default is 1.0 to 100.0
     no_t6 = number of temperature points, the default is 121
 CALLS: ***
	sxt_t6_resp0
 HISTORY:
       11-jan-95, jmm


sxt_thinit $SSW/yohkoh/ucon/idl/mctiernan/sxt_thinit.pro
[Previous] [Next]
 NAME:
     sxt_thinit
 PURPOSE:
     Initializes the spectrum for SXT_THFSP.pro, the
     standard AINIT doesn't seem to work too well. Not
     a general program, only for use by SXT_THFSP, or SXT_FSP
 CALLING SEQUENCE:
     init_a = sxt_thinit(sph_cnt, tyspec)
 INPUT:
     sph_cnt= "counts"/sec in the SXT filters, these have
              been normalized in SXT_THFSP, 
     tyspec= spectral type, 3, 10, 95, 96, 97, 98 or 99
 OUTPUT:
     init_a = the initial values of the fit parameters,
              for the standard thermals, the average of
              the temperatures and EM's, for tysp=99,
              a power law fit to the two temperatures
              and EMs.
 CALLS: ***
	SXT_TEEM [1], SXT_TEEM [2]
 CALLED BY:
	sxt_thfsp
 HISTORY:
     25-oct-95, jmm


SXT_TVEC $SSW/yohkoh/ucon/idl/bentley/sxt_tvec.pro
[Previous] [Next]
 NAME:
       SXT_TVEC
 PURPOSE:
       Creates corrected vector of SXT times
 CALLING SEQUENCE:
       time = sxt_tvec(index)
 INPUTS:
       index   standard yohkoh index record (or observing log record)
 OPTIONAL INPUTS:
 KEYWORD INPUTS:
       debug   if set, output information about exposures
 OUTPUTS:
       time    corrected time in internal structure format
 OPTIONAL OUTPUTS:
 CALLS: ***
	ALL_VALS [1], ALL_VALS [2], ANYTIM2MSV, MSV2INTS, gt_dpe
 CALLED BY:
	OBS_PLOT
 RESTRICTIONS:
       Uses planned exposure (DPE) because actual not in observing log
 PROCEDURE:
       Adds half of exposure duration derived from converted dpe value
 MODIFICATION HISTORY:
       RDB  19-Aug-94  Written


sxt_uniq [1] $SSW/yohkoh/sxt/idl/util/sxt_uniqfov.pro
[Previous] [Next]
   Name: sxt_uniq

   Purpose: return indices of uniq SXT 'pointings'

   Input Parameters:
      index - vector of sxt index or roadmap records

   Output: 
      function returns structure with 1 lonword array tag for each uniq fov
      each vector is the 'ss' vector for corresponding FOV
         {fov0:lonarr,
	   fov1:lonarr,
	   ...
          fovn:lonarr}
   
   Keyword Parameters:
      min_sep - Input, max seperation criteria (in arcminutes) same for X and Y
      minimg  - input, ignore images which dont have at least this many
      plotfov - input, if set, call plot_fov for each uniq pointing set
      counts  - output, number of images of for each uniq pointing
      fov     - output, number of uniq FOVs (=number tags of return structure)
      uniqss  - output, indicies of uniq, with RESOLUTION differences as
                        well as uniq FOV

   Calling Sequence:
      ufov=sxt_uniqfov(index [,min_sep=min_sep, counts=counts, uniqss=uniqss)


   Illustrative Examples - [Read data for most common FOV in file]:
      I. 
      rd_roadmap,'sprfile',rmap  		  ; spr roadmap
      ufov=sxt_uniqfov(rmap,counts=counts)       ; find uniq FOVs, 
      most=where(counts eq max(counts))	  ; most common FOV
      rd_sda,'sprfile',ufov.(most),index,data	  ; read data

      II.
      ufov=sxt_uniqfov(rmap,uniqss=uniqss)	
      rd_roadmap,newfiles(/spr,last=5),rmap	  ; read last five spr rmaps
      lastsfd,sfdindex,sfddata,/half		  ; most recent half res sfd
      plot_nar,sfdindex, pfi_index=rmap(uniqss)  ; overlay 'uniq' or pointings

 CALLS: ***
	FMT_TAG [1], FMT_TAG [2], MAKE_STR [1], MAKE_STR [2], SXT_UNIQFOV, UNIQ [1]
	UNIQ [2], UNIQ [3], deriv_arr [1], deriv_arr [2], gt_center, gt_res, plot_fov [1]
	plot_fov [2], yesnox [1], yesnox [2]
 CALLED BY:
	lastsfd [1], lastsfd [2], plot_sxg
   History:
      30-aug-1993 (SLF) 
       6-sep-1993 (SLF) - muddled code even more, made /fov the default
			   added plotfov, got it to work 
       6-oct-1994 (SLF) - use gt_center instead of gt_fov_center
       8-oct-1994 (SLF) - return uniqss (indices of uniq pointing OR resolution)


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

   Purpose: return indices of uniq pointings

   Input Parameters:
      index - vector of sxt index or roadmap records
  
   Keyword Parameters:
      FOV - switch - if set, check uniq FOV (via sxt_uniqfov)
      min_sep - FOV minimum seperation (pass to sxt_uniqfov)
      filtres - switch, if set, only uniq filter/resolution combinations

   Calling Sequence:
     ss=sxt_uniq(index [,/fov, min_sep=min_sep , /filtres]

   Calling Example:
      ss=sxt_uniq(index, min_sep=20)		; FOV uniq to within 20 "
      ss=sxt_uniq(index, /filtres)		; uniq filterB/resolution comb

 CALLS: ***
	SXT_UNIQFOV, UNIQ [1], UNIQ [2], UNIQ [3], gt_corner_cmd, gt_filtb, gt_res
	gt_shape_cmd
 CALLED BY:
	lastsfd [1], lastsfd [2], plot_sxg
   History:
      30-aug-1993 (SLF) 
	7-sep-1993 (slf) call sxt_uniqfov if fov/minsep set
      22-sep-1995 (SLF) add FILTRES keyword (only check FILTB and RES)


sxt_uvf_info [1] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_uvf_info.pro
[Previous] [Next]
   Name: sxt_uvf_info

   Purpose: return info about UV-Flood

   Input Parameters:
      times - input times

   Keyword_Parameters:
      morn_int - (switch) - if set, return morning inteval (secs)
      secsince - (switch) - if set, return seconds since UV Flood end (secs)
      tfms     - (switch) - if set, return 'tfms' required by LWA/TMetcalf
                            orbital leak fit function
      nofilter - (switch) - if set, do not filter "corrupt" morning int records
                            ( generally only used for testing)
   Calling Examples:
      mornint=sxt_uvf_info(times,/morn_int)  ; return morning interval
      dtsuvf =sxt_uvf_info(times,/secsince)  ; seconds since end of uvf
      tfms   =sxt_uvf_info(times,/tfms)      ; minutes since FMS normlized
                                             ;   to MORN INT=2  
      uvdbase - if set, use uv dbase

   History - 24-Jan-1997 - S.L.Freeland (for SDC orbital variation)
             28-Jan-1997 - S.L.Freeland (add /TFMS keyword and function)
             21-Mar-1999 - S.L.Freeland (filter out corrupt records)
                           assure TFMS>0
             16-May-2003 - S.L.Freeland (use new UV Flood dbase)
             26-Jul-2003 - S.L.Freeland (tweak decidsion about whether
                           uvdbase found due to IDL 5.6 or solserv difference
 CALLS:
 CALLED BY
	DC_ORBIT_CORRECT, SDC_VERIFY, dark_sub [1], dark_sub [2], dark_sub [3]
	get_dc_image [2], get_dc_image [3]


sxt_uvf_info [2] $SSW/yohkoh/gen/galileo/idl/lmsal/sxt_uvf_info2.pro
[Previous] [Next]
   Name: sxt_uvf_info

   Purpose: return info about UV-Flood

   Input Parameters:
      times - input times

   Keyword_Parameters:
      morn_int - (switch) - if set, return morning inteval (secs)
      secsince - (switch) - if set, return seconds since UV Flood end (secs)
      tfms     - (switch) - if set, return 'tfms' required by LWA/TMetcalf
                            orbital leak fit function
      nofilter - (switch) - if set, do not filter "corrupt" morning int records
                            ( generally only used for testing)
   Calling Examples:
      mornint=sxt_uvf_info(times,/morn_int)  ; return morning interval
      dtsuvf =sxt_uvf_info(times,/secsince)  ; seconds since end of uvf
      tfms   =sxt_uvf_info(times,/tfms)      ; minutes since FMS normlized
                                             ;   to MORN INT=2  

   History - 24-Jan-1997 - S.L.Freeland (for SDC orbital variation)
             28-Jan-1997 - S.L.Freeland (add /TFMS keyword and function)
             21-Mar-1999 - S.L.Freeland (filter out corrupt records)
                           assure TFMS>0
 CALLED BY
	DC_ORBIT_CORRECT, SDC_VERIFY, dark_sub [1], dark_sub [2], dark_sub [3]
	get_dc_image [2], get_dc_image [3]


sxt_uvf_info [3] $SSW/yohkoh/sxt/idl/atest/sxt_uvf_info.pro
[Previous] [Next]
   Name: sxt_uvf_info

   Purpose: return info about UV-Flood

   Input Parameters:
      times - input times

   Keyword_Parameters:
      morn_int - (switch) - if set, return morning inteval (secs)
      secsince - (switch) - if set, return seconds since UV Flood end (secs)
      tfms     - (switch) - if set, return 'tfms' required by LWA/TMetcalf
                            orbital leak fit function
      nofilter - (switch) - if set, do not filter "corrupt" morning int records
                            ( generally only used for testing)
   Calling Examples:
      mornint=sxt_uvf_info(times,/morn_int)  ; return morning interval
      dtsuvf =sxt_uvf_info(times,/secsince)  ; seconds since end of uvf
      tfms   =sxt_uvf_info(times,/tfms)      ; minutes since FMS normlized
                                             ;   to MORN INT=2  

   History - 24-Jan-1997 - S.L.Freeland (for SDC orbital variation)
             28-Jan-1997 - S.L.Freeland (add /TFMS keyword and function)
             21-Mar-1999 - S.L.Freeland (filter out corrupt records)
                           assure TFMS>0
 CALLS:
 CALLED BY
	DC_ORBIT_CORRECT, SDC_VERIFY, dark_sub [1], dark_sub [2], dark_sub [3]
	get_dc_image [2], get_dc_image [3]


sxt_vignette $SSW/yohkoh/sxt/idl/util/sxt_vignette.pro
[Previous] [Next]
 NAME:
    sxt_vignette
 PURPOSE:
    Return the SXT X-ray vignette function determined from WSMR1 data.

    Called by sxt_off_axis to correct image shape (portion) given in index.
 CALLING SEQUENCE:
 	vignette = sxt_vignette(index)		; Index must be a scalar structure.
 	vignette = sxt_vignette(array)
	vignette = sxt_vignette(index,energy)

 INPUT:
  INDEX  - Standard SXT index structure.  Specifies portion of SXT FOV to return.
	    Determine low or high energy from filter (if ENERGY argument not present).
  ARRAY  - Vector of length 5 where:
		  array(0) = x CCD coordinate & array(1) = y CCD coordinate
		  array(2) = # of x pixels    & array(3) = # of y pixels
		  array(4) = Resolution as: 0=full, 1=half, 2=quarter
 OPTIONAL INPUT:
  ENERGY - If = 0 or not present, determine from index (filtb=4 or 5, energy=2)
	    If = 1, use low-energy result  (overrides index)
	    If = 2, use high-energy result (overrides index)
 OUTPUT:
   2-d matrix describing the SXT vignette function normalized to 1.0 at the
   position of highest effective area (gt_sxt_axis).
 CALLED BY:
	STRAY_CORR, help_vignette, sxt_off_axis
 PROCEDURE:
   The SXT vignette function consists of two non-concentric cones whose slopes
   and origins were determined from WSMR1 data and refined by analyis of flight
   data.  See Calibration Notes 36 and 37.  The origins are defined as:
                                   x     y
   Inner-region (r < 21 arc-min)  515   633  (determined fr WSMR data)
   Outer-region (r > 21 arc-min)  533   599  (determined fr WSMR data)

   Note that the out-region centroid location and the cutoff radius (=21) may
   be changed in the future based on more extensive analysis of flight data.

   The slopes were derived from off-axis measurements at 
       Low energy		Al-K (8.3 A) and C-K (44 A)
       High energy		Ag L (4.16 A)

   Be patient.  On a DECstations 5000/200 this routine takes about 
       	 8 sec for a  512x 512 image
		53 sec for a 1024x1024 image
 CALLS: ***
	DOC_LIBRARY, GT_SXT_AXIS, gt_corner, gt_filtb, gt_pix_size, gt_res, gt_shape
	tbeep [1], tbeep [2], tbeep [3]
 RESTRICTIONS:
   If index is passed in, must be a scalar
 MODIFICATION HISTORY:
   12-Jan-94, J. R. Lemen LPARL, Written
    3-Feb-94, JRL, Check that index is a scalar structure
    4-Feb-94, JRL, Changed the outer-region cone centroid.
    4-Oct-95, JRL, Fixed a bug that effected half-res and full-res PFIs


SXT_WEIGHT $SSW/yohkoh/ucon/idl/labonte/sxt_weight.pro
[Previous] [Next]

 NAME: SXT_WEIGHT

 PURPOSE: Returns value of a wavelength-dependent parameter weighted
     by the SXT passbands times a Mewe solar spectrum.



PRO sxt_weight, wavein, parmin, parmeem, parmtc, parmgrid=parmgrid


 INPUT PARAMETERS:
	wavein = wavelength vector for input parameter, Angstroms.
		Must be monotonically increasing.

	parmin = vector of parameter values.

 OUTPUT PARAMETERS:
	parmeem = weighted values of the parameter assuming equal
		emission measures at all temperatures from 
		Log10(T) = 5.5 to 8.0.  Vector (6).  Filter order
		as given by GT_FILTB().

	parmtc = corrections to parmeem for quadratic variation with
		Log10(T).  Dimensioned(6,3).  Corrected value is
		parmeem(i) + parmtc(i,0) + parmtc(i,1)*(Log10(T)-6.)
			+ parmtc(i,2)*(Log10(T)-6.)^2

 OPTIONAL OUTPUT KEYWORDS:
	parmgrid = array of weighted values, dimensioned (nfilts,ntemps)
		Both nfilts and ntemps = 6.  Temperature values are
		Log10 = 5.5 to 8.0 by 0.5.  Use this return to be
		that PARMTC is a valid fit.

 METHOD:
	Uses Mewe_spec to get solar spectrum, takes SXT passbands from
	database.

 CALLS: ***
	INTERPOL, POLY_FIT, UNIQ [1], UNIQ [2], UNIQ [3], mewe_spec [1], mewe_spec [2]
	restgen [1], restgen [2]
 HISTORY:
	Written  March 27, 1995  Barry LaBonte
	Added /PARMGRID keyword  May 1, 1995 BJL


sxt_where $SSW/yohkoh/sxt/idl/util/sxt_where.pro
[Previous] [Next]
   Name: sxt_where

   Purpose: filter sxt index/roadmaps - return indices of matches

   Input Parameters:
      index - SXT index or roadmap records
 
   Output Parameters:
      count - number of matches

   Keyword Parameters:
      conf_file - name of SS configuration file 
                  (see $DIR_SXT_DOC/ssconfig.doc for description)
      quite - if set, suppress messages
        
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], concat_dir [4]
	file_exist [1], file_exist [3], get_logenv [1], get_logenv [2], gt2exe [1]
	gt2exe [2], prstr [1], prstr [2], rd_tfile [1], rd_tfile [2]
 CALLED BY:
	search_obs
   History:
      22-mar-95 (SLF) - extention of mk_spd to allow observing log searches
      16-may-95 (SLF) - force HOME directory output


sxt_wwwmovie $SSW/yohkoh/sxt/idl/atest/sxt_wwwmovie.pro
[Previous] [Next]
   Name: sxt_wwwmovie

   Purpose: make SXT movies from WWW requests

   Keyword Parameters:
      qfile - WWW Post Query filename  
      background - if set, running in background (Q request)
                   (see sxt_wwwmonitor.pro)
  
   History:
      8-jul-1996 S.L.Freeland
     10-jul-1996 S.L.Freeland - invert plot_trav and scale size for Z-buff
     12-may-1997 S.L.Freeland - add Q/background ability
                                optimize forground task  
     29-may-1997 S.L.Freeland - protect against zero files 
     15-jul-1997 S.L.Freeland - add /JAVA hook in image2mpeg call
     22-jul-1997 S.L.Freeland - add /STILL hook
     10-oct-1997 S.L.Freeland - generate FORM if no e-mail
                                (allow user to add e-mail after the fact)  
     04-dec-1997 S.L.Freeland - allow multiple mailnames
      9-Sep-1999 S.L.Freeland - add /BASE_URL to html_doc call, increased
                                immediate job processing number  


sxt_xsaa $SSW/yohkoh/sxt/idl/atest/sxt_xsaa.pro
[Previous] [Next]
 NAME:
	sxt_xsaa
 PUPROSE:
       To improve images taken in SAA that have CR streaks.
       The default parameters are optimized for prepared
       SXT images or composite images.
 CALLED BY:
	sxt_clean [1], sxt_clean [2]
       NOTE: This program is useful for cosmetic improvement
             of images contaminated by SAA particles.  However,
             IT ALSO REMOVES SIGNAL FROM SMALL X-RAY FEATURES
             SUCH AS X-RAY BRIGHT POINTS.  Therefore it should
             be used with care and before/after checking on any
             images intended for quantitative analysis.
 CALLING SEQUENCE:
	result = sxt_xsaa(index,image)
	result = sxt_xsaa(index,image [,sens=sens,thresh=thresh,$
		    pix=pix,endpix=endpix,debug=debug,$
		    good_pixmap=good_pixmap])
 INPUTS:
	index = index structure for determining DPE
	image = 2-dimensional sxt_prep'd or composite non-byte image
 OPTIONAL KEYWORD INPUTS:
	NOTE:  Default sens and thresh parameters are set to give
		modest streak improvement while causing minimal
		violence to the data.  Considerable enhancement
		of streak removal performance can be obtained by
		experimenting with sens and thresh for any single
		image.
   	sens = sensitivity to streaks, higher means more sensitive
   		[default: sens=9]
   	thresh = threshold for second-pass pixel map, higher causes less
		pixels to be modified.  Range 10-250, quite insensitive.
   		[default: thresh=3.0*sens]
	/pix = pause to display interim good_pixmap and result arrays.
	/endpix = use this if you only want to view the initial and final
		results.  No pauses.
	/debug = stops at end for parameter checks.
	/timer, prints out how long it took program to run.
 OPTIONAL KEYWORD OUTPUT:
	good_pixmap = the binary image showing unmodified pixels by 1's.
 PROCEDURE:
	Streaks at various angles are amplified and located using
	convolution and thresholding. This information is used to generate
	a map of good (undamaged) pixels. Bad pixels are replaced with a 
	average of adjacent good pixels. In a second pass, the
	result of this operation is subtracted from the original image.
	The good pixel map is revised based on the difference image,
	and pixel replacement is done for final.
 CALLS: ***
	AVERAGE, BOX_MESSAGE, CONVOL_ENHANCE, NZMEAN, PAUSE [1], WDEF [1], WDEF [2]
	blank_circle [1], blank_circle [2], data_chk [1], data_chk [2], get_info [1]
	get_info [2], get_info [3], get_info [4], get_rb0p [1], get_rb0p [2], gt_pix_size
	gt_res, pause [2], safe_log10, shift_res [1], shift_res [2], sxt_cen [1]
	sxt_cen [2], tbeep [1], tbeep [2], tbeep [3]
 RESTRICTIONS:
	The program does not work well on images which have not 
	been sxt_prep'd.
 HISTORY
	Original destreaking scheme invented by Charles Kankelborg.
	29-Jan-99, LWA	Modified logic and determined default parameters.
	06-Feb-99, LWA  Final tweak and renamed sxt_xsaa.pro.
       21-Mar-99, SLF  Return orignal image instead of 'NDG'
	02-Feb-00, LWA  Force .995-1.005 Rsun ring into good_pixmap.
                 	Replaced logcmp with safe_log10.
	03-Feb-00, LWA  Changed to log compression for processing.
			Eliminated lvl keyword.
       


SXTASEQ $SSW/yohkoh/ucon/idl/kawai/sxtaseq.pro
[Previous] [Next]
NAME:
       SXTASEQ
PURPOSE:
       Make SXT aligned image cube, taking account of
       the change of OR coordinate, S/C attitude and 
       optical filter offset.

CATEGORY:
CALLING SEQUENCE:
       result = SXTASEQ(DATA, INDEX, RANGE=[X1,X2,Y1,Y2] ,/QUIET)
INPUTS:
       DATA, INDEX = that of gotten by YODAT

OPTIONAL INPUTS:
       RANGE=[X1,X2,Y1,Y2] : SXTASEQ returns (X1:X2,Y1:Y2,*) -
                             part of the aligned data cube.
                             By default, whole size of the 
                             data are returned.
       /QUIET : if specied, a transformation information of each
                image is not displayed.
OUTPUTS:
       result = 3D-ARRAY:
                    (X2-X1) x (Y2-Y1) x N_ELEMENTS(DATA(0,0,*)) 
 CALLS: ***
	GET_SUNCENTER [1], GET_SUNCENTER [2], HXA_SUNCENTER, IS_UNDEF, ROT, gt_time [1]
	gt_time [2]
 CALLED BY:
	sel_img
COMMON BLOCKS:
SIDE DEFFECTS:            
RESTRICTIONS:
       Data must be full resolution.
       Corrections of S/C attitude and optical filter offset are
       performed by GET_SUNCENTER using PNT data.
       ROT function is used to shift each image.

HISTORY:
  Goro Kawai, Jan. 25, 1993
  Goro Kawai, Feb.  1, 1993  /QUIET option
  Goro Kawai, Mar. 22, 1993  use GET_SUNCENTER instead of HXA_SUNCENTER

EXAMPLES:
SECRET OPTIONAL INPUTS:
 /hxa_suncenter
 /ar7150


sxtbox_fsp $SSW/yohkoh/ucon/idl/mctiernan/sxtbox_fsp.pro
[Previous] [Next]
 NAME:
	sxtbox_fsp
 PURPOSE:
	To fit spectra for sxt, spectrometer style, using any_fsp.pro,
       for a box chosen using LCUR_IMAGE.
 CALLING SEQUENCE:
	sxtbox_fsp,index,data,fit_pars,sc_par,ch_dta,tyspec=tyspec,outfile=outfile,$
                  pfile=pfile,same_bx=same_bx,boxq=boxq,countfile=countfile,$
                  filt_no=filt_no,av_satpix=av_satpix,use_filters=use_filters,$
                  sindex=sindex,sdata=sdata,sys_err=sys_err
 INPUT:
	index= info. structure for SXT data from test_rd
       data= data, ALigned and uncompressed, byte type data will be SXT_PREPPED
 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= 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:
       tyspec= type of spectrum, the default is to prompt the user
	outfile= the output file, a keyword
	pfile= a file for spectral plots
       same_bx= if set, use the values of the box coordinates in same_bx,
                or boxq, if set
       boxq= the output box subscripts,
       countfile= a file name for the accumulated counts which can 
                  be used as input to fsp_proc.pro, no fit is done
                  if you set this keyword.
       filt_no= filter no. to choose the time interval, if not set, the
                routine will prompt you.
       av_satpix= if set, use sat_av.pro to average out the sat. pixels, this
                  is only invoked if SXT_PREP is called
       use_filters = an array of filter numbers, 2 is al.1, 3 is AlMG,
                     4 is Be119, 5 is Al12, 6 is Mg3, the default is
                     to use [2, 4, 5]. Be careful, SXT_INTERP is used,
                     so that if you tell it a filter that isn't used
                     near the time interval that you have, you may
                     get nonsense...
       sindex, sdata= prepped index and data, so you need not do this every time
       sys_err= a 'systematic error', pass in if you don't trust the
                errors you get from counting stats, or to arbitrarily
                push down chi^2 values, The default iz 0.0.
                This makes the error in the rate = sqrt(cps/dt)+sys_err*cps.
 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], UTPLOT [1], UTPLOT [2]
	UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6], any_fsp, anyrts, delvarx [5], dude
	fmt_tim [1], fmt_tim [2], gt_expdur [1], gt_expdur [2], gt_filtb, lcur_image
	plot_lcur [1], plot_lcur [2], sat_av_arr, strip_data, sxt_interp [1]
	sxt_interp [2], sxt_prep [1], sxt_prep [2], sxt_prep [3], yesnox [1], yesnox [2]
 CALLED BY:
	box_sxtth_hxt
 HISTORY:
	Written Mar, '93 by J.McTiernan
       changed to use of lcur_image 03-nov-93 (jmm)
       Added s_bck keyword, 7-apr-94, JMM
       All sorts of stuff, 12-may-95, jmm, added the ability to use prepped
           data, so the old way of using the loop variables will not work
           anymore, this is replaced by the USE_FILTERS keyword, to avoid
           weird extrapolations.
       Added sys_err keyword, 24-jun-95, jmm
       New output format, 28-jul-95, jmm


sxtbox_teem $SSW/yohkoh/ucon/idl/mctiernan/sxtbox_teem.pro
[Previous] [Next]
 NAME:
	sxtbox_teem
 PURPOSE:
	Tget temperatures and emission measures from SXT images
       for a box chosen using LCUR_IMAGE.
 CALLING SEQUENCE:
	sxtbox_teem,index,data,fb1,fb2,te,em,dte,dem,same_bx=same_bx,boxq=boxq,$
                filt_no=filt_no,av_satpix=av_satpix,unc=unc,sat=sat,align_unc=align_unc
                tim_array=tim_array
 INPUT:
	index= info. structure for SXT data from yodat
       data = data, sxtbox_teem calls SXT_PREP, and aligns if the data
              is of byte-type
       fb1, fb2= filter numbers, fb=1 for open, 2 for al1400, 3 for DAG,
                 4 FOR Be100, 5 for Al12, and 6 for mg3mu.
 OUTPUT:
       te = log(T)
       em = log(EM)
       dte = uncertainty in te
       dem = uncertainty in em
 KEYWORDS:
       same_bx= if set, use the values of the box coordinates in same_bx,
                or boxq, if set
       boxq= the output box subscripts,
       filt_no= filter no. to choose the time interval, if not set, fb2 is used
       av_satpix= if set, use sat_av.pro to average out the sat. pixels
       unc= the array of compression, etc, uncertainties, if the data
            has peen sxt_prepped.
       sat= the array of sat. pixels, if the data has peen sxt_prepped.
       align_unc = The uncertainties in alignment coordinates, a pair of
                 (x,y) in FR pixels. These should be fractions of pixels.
                  Nobody except for me can use this yet, don't try.
       tim_array = a time array, for plotting purposes
 CALLS: ***
	SXT_TEEM [1], SXT_TEEM [2], anytim2ints [1], anytim2ints [2], dude, gt_filtb
	lcur_image, sat_av_arr, seq_2fl, sxt_interp [1], sxt_interp [2], sxt_prep [1]
	sxt_prep [2], sxt_prep [3]
 HISTORY:
	Written 1-May-95, jmm


SXTFFI1 [1] $SSW/yohkoh/ucon/idl/nitta/ffidl_nn.pro
[Previous] [Next]
 NAME:
       SXTFFI1
 PURPOSE:
    ****************************************************
    *  SOLAR-A/SXT IMAGE QUICK LOOK SYSTEM (Ver, 4.2)  *
    *         (DISPLAY FFI IMAGE)                      *
    ****************************************************
 CATEGOLY:
       SOLAR-A/SXT QL
 CALLING SEQUENCE:
       This is main procedure.
       .run sxtffi1 
 INPUTS:
       None.
       But Inputs is asked by menu after running this procedure.
 OUTPUTS:
       None.
    NOTE:
       Header information is stored in the variation  "header" and image data
     is stored in the variation "image".
 COMMON BLOCKS:
       None.
 SIDE EFFECTS:
       Open Window and display FFI image.
 RESTRICTIONS:
       None.
 PROCEDURE:
       Read the image data from image data files (/SXTffi/YYMMDD/HHMMSS.dat)
     and check the header information. And then display the image and status
     informations.
 PROGRAMMER:
       TOSHIFUMI SHIMIZU
            Department of Astronomy, University of Tokyo, JAPAN
 HISTORY:
            28-DEC-1990   Version sunview                                     
             7-JAN-1991   COMPLETE FILE SEARCH FUNCTION                       
             9-JAN-1991   ATTENT function                                     
      V1.0  10-JAN-1991   Revice either for Version X-WINDOW or for SUN View  
      V1.1  31-JAN-1991   Support inputted Blank into TIME (MENU)             
      V1.2   1-FEB-1991   Read file change                                    
                            /SXTffi/yymmdd/hhmmss.dat                         
                            FLTM=STRMID(INFL, 15, 6)                          
      V1.3   3-FEB-1991   Correct Image Quality
      V2.0  13-MAR-1991   Change the file format      
      V3.0  26-MAR-1991   Change header layout(Ver, 1.0)
      V3.1  26-MAR-1991   Modify Window
      V3.2  28-MAR-1991   Change layout of status.
                            Delete TLM:,MOD: and Append CCD TEMP:
      V3.3  28-MAR-1991   Check Sys.Version#(high)
      V3.4   1-APR-1991   Append ARS:,ART:
    X V3.5  19-APR-1991   Decompress compressed data.
      V4.0  23-JAN-1993   For KSC DelayLook
      V4.1  26-FEB-1995   Year= 'SA'   
      V4.2   3-Mar-1995   Display images first then show information


SXTFFI1 [2] $SSW/yohkoh/ucon/idl/shimizu/ffidl.pro
[Previous] [Next]
 NAME:
       SXTFFI1
 PURPOSE:
    ****************************************************
    *  SOLAR-A/SXT IMAGE QUICK LOOK SYSTEM (Ver, 4.2)  *
    *         (DISPLAY FFI IMAGE)                      *
    ****************************************************
 CATEGOLY:
       SOLAR-A/SXT QL
 CALLING SEQUENCE:
       This is main procedure.
       .run sxtffi1 
 INPUTS:
       None.
       But Inputs is asked by menu after running this procedure.
 OUTPUTS:
       None.
    NOTE:
       Header information is stored in the variation  "header" and image data
     is stored in the variation "image".
 COMMON BLOCKS:
       None.
 SIDE EFFECTS:
       Open Window and display FFI image.
 RESTRICTIONS:
       None.
 PROCEDURE:
       Read the image data from image data files (/SXTffi/YYMMDD/HHMMSS.dat)
     and check the header information. And then display the image and status
     informations.
 PROGRAMMER:
       TOSHIFUMI SHIMIZU
            Department of Astronomy, University of Tokyo, JAPAN
 HISTORY:
            28-DEC-1990   Version sunview                                     
             7-JAN-1991   COMPLETE FILE SEARCH FUNCTION                       
             9-JAN-1991   ATTENT function                                     
      V1.0  10-JAN-1991   Revice either for Version X-WINDOW or for SUN View  
      V1.1  31-JAN-1991   Support inputted Blank into TIME (MENU)             
      V1.2   1-FEB-1991   Read file change                                    
                            /SXTffi/yymmdd/hhmmss.dat                         
                            FLTM=STRMID(INFL, 15, 6)                          
      V1.3   3-FEB-1991   Correct Image Quality
      V2.0  13-MAR-1991   Change the file format      
      V3.0  26-MAR-1991   Change header layout(Ver, 1.0)
      V3.1  26-MAR-1991   Modify Window
      V3.2  28-MAR-1991   Change layout of status.
                            Delete TLM:,MOD: and Append CCD TEMP:
      V3.3  28-MAR-1991   Check Sys.Version#(high)
      V3.4   1-APR-1991   Append ARS:,ART:
    X V3.5  19-APR-1991   Decompress compressed data.
      V4.0  23-JAN-1993   For KSC DelayLook
      V4.1  26-FEB-1995   Year= 'SA'   
      V4.2   3-Mar-1995   Display images first then show information


sxthxt_fsp $SSW/yohkoh/ucon/idl/mctiernan/sxthxt_fsp.pro
[Previous] [Next]
 NAME:
	sxthxt_fsp
 PURPOSE:
	To fit spectra for sxt and hxt, using any_fsp.pro, sxt is used for
       the time interval
 CALLING SEQUENCE:
       Sxthxt_fsp, index, data, hindex, hdata, fit_pars, sc_par, ch_dta, $
                Outfile=outfile, Pfile=pfile, Filt_no=filt_no, tyspec=tyspec, $
                use_filters=use_filters, sindex=sindex, sdata=sdata, noplot=noplot, $
                h_sdel=h_sdel, sys_err=sys_err, time_range=time_range, all=all$
                h_bck_time=h_bck_time,h_bck_dt=h_bck_dt,h_auto_bck=h_auto_bck
 INPUT:
	index= info. structure for SXT data from test_rd
       data= compressed SXT data
       hindex= info. structure for HXT data
       hdata= HXT data
 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= 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:
	outfile= the output file
	pfile= a file for spectral plot
       filt_no=a filter no. to choose the SXT interval
       tyspec= type of spectrum, the default is to prompt the user
       use_filters = an array of filter numbers, 2 is al.1, 3 is AlMG,
                     4 is Be119, 5 is Al12, 6 is Mg3, the default is
                     to use [2, 4, 5]. Be careful, SXT_INTERP is used,
                     so that if you tell it a filter that isn't used
                     near the time interval that you have, you may
                     get nonsense... This has been taken care of, jmm, 11-4-95
       sindex, sdata= prepped index and data, so you need not do this every time
       sys_err= 'systematic errors', useful for the mismatch in count rates
                between SXT, HXT, or pass in if you don't trust the errors
                you get from counting stats, or to arbitrarily push down chi^2
                values, The default iz 0.0.
                This makes the error in the rate = sqrt(cps/dt)+sys_err*cps.
       h_sdel= HXT channels to delete
       h_bck_time= bck start time for HXT, if not set you choose it.
       h_bck_dt= dt of the HXT bck interval, if returned
       h_auto_bck= use automatic background finding for HXT
       time_range = a time range, all of the points in this range are used
       All= if set, use all of the points...
       noplot= if set, no screen plot
 CALLS: ***
	INTERPU_1D, accum_counts [1], accum_counts [2], accum_counts [3], any_fsp
	anytim2ex [1], anytim2ex [2], anytim2ints [1], anytim2ints [2], auto_bck_find
	choose_interval, dude, fmt_tim [1], fmt_tim [2], gt_expdur [1], gt_expdur [2]
	gt_filtb, hxt_chsums, int2secarr [1], int2secarr [2], strip_data, sxt_interp [1]
	sxt_interp [2], sxt_prep [1], sxt_prep [2], sxt_prep [3]
 HISTORY:
	Written Mar, '93 by J.McTiernan
       Rewritten 5-24-95, Jmm
       Added sys_err, 6-24-95, jmm
       New output formats, 7-28-95, jmm
       Added time_range, and All keywords, uses CHOOSE_INTERVAL for the
       time interval, jmm, 2-nov-95
       Added a check to see if the interval times are in between
       the start and end times for each filter, 4-nov-95, jmm


SXTKaySea [2] $SSW/yohkoh/gen/idl/dbase/sxtkaysea.pro
[Previous] [Next]
	Name:
		SXTKaySea 
	Purpose:
		Find and return the indics of data-vector "idx" which
		satisfy keyed search.  
	CALLING SEQUENCE:
		idxList = SXTKaySea( idx, item, op, val, [op2=op2, 
				  val2=val2, op3=op3, val3=val3])
	INPUT:
		idx	Structured data-vector to be searched
		item	string which is associated with a field name
			of the input data-vectors (sxtp, sxtf, etc).
		op	operator for search
		val	search value
		op2&3	2nd and third operators if present
		val2&3	2nd and third values if present.
	RETURNED:
		a success list of indices from idx
 CALLS: ***
	MskExpLev, MskImg, MskPer, ReqExpVal, ReqImgVal, ReqPerVal [1], ReqPerVal [2]
 CALLED BY:
	KeySea [1], KeySea [2], KeySearch
	History:
		Alpha ver. 1.0a written 24-Apr-1991 by GAL to--
		test some ideas for keyed searches of SXT data-base
		records (e.g. roadmap and sxt observing log).
		15-May-91, updated for use with KeySearch routine.
		1-Aug-91, added ObsRegion key.
		5-Aug-91, ver 2.0a, changed order of formal parameters 
			and added op/vals 2&3 to allow for additional
			search keys (e.g. shape_cmd, FOV_center).
		7-Oct-91, updated search tag check list.
		16-Oct-91, updated tests for valid items 
		17-Oct-91, added ImgParam search keys
		17-Jan-92, update FOV.
		21-Jan-92, update for use with index nest structure
		28-Jan-92, bug in shape_cmd logic (type0)
		4-Feb-92, (gal for this and all of above changes)
			  added logic for dpe search.
		10-Feb-92, added logic for DP_mode search.


SXTPFI1 [1] $SSW/yohkoh/ucon/idl/nitta/pfidl_nn.pro
[Previous] [Next]
 NAME:
       SXTPFI1
 PURPOSE:
   *****************************************************
   *   SOLAR-A/SXT IMAGE QUICK LOOK SYSTEM (Ver,3.9)   *
   *     (DISPLAY PFI IMAGES AS OBSERVING REGIN )      *
   *****************************************************
 CATEGORY:
       SOLAR-A/SXT QL
 CALLING SEQUENCE:
       This is main procedure.
       .run sxtpfi1
 INPUTS:
       None.
       But Inputs is asked by menu after running this procedure.
 OUTPUTS:
       None.
    NOTE:
       Header information is stored in the variation "header" and image data
     is stored in the variation "image".
 COMMON BLOCKS:
       None.
 SIDE EFFECTS:
       Open Window and display PFI image.
 RESTRICTIONS:
       None.
 PROCEDURE:
       Read the image data from image data files(/SXTpfi/YYMMDD/HHMMSS.dat)
     and check the header information. And then display the image and status
     informations.
 PROGRAMER:
       TOSHIFUMI SHIMIZU
            Department of Astronomy, University of Tokyo, JAPAN
 HISTORY:
            29-DEC-1990   Version sunview                                     
             8-JAN-1991   COMPLETE FILE SEARCH AND SELECT FUNCTION            
      V1.0  10-JAN-1991   Revice either foe Version X-WINDOW and for Sunview  
      V1.1  31-JAN-1991   C ADD --> S ADD (STATUS TITLE)                      
      V1.2  31-JAN-1991   NSSIZE=1&EWSIZE=1,2 ZOOM FACTER 1/2 CHANGE          
      V1.3  31-JAN-1991   CHECK OUT IMAGE COMPLETION FROM ALL HEADER DATA     
                          Check out Image Quality From All Header Data        
      V1.4  31-JAN-1991   Support Inputted Blank into TIME (MENU)             
      V1.5   1-FEB-1991   Read file change                                    
                            /SXTpfi/yymmdd/hhmmss.dat                         
                            FLTM= STRMID(INFL, 15, 6)                         
      V1.6   3-FEB-1991   Correct Image Quality                               
      V2.0  11-MAR-1991   Change PFI file format. from mkimage_ql(new)        
      V2.1  15-MAR-1991   Correct Rebin without interpolation.                
      V2.2  19-MAR-1991   Modify Window.                                       
      V2.3  19-MAR-1991   Modify QL Search                                    
      V3.0  27-MAR-1991   Change header layout(Ver,1.0)                       
      V3.1  28-MAR-1991   Change layout of status.
                            Delete TLM:,MOD: and Append CCD TEMP:,ARS:,ART:   
      V3.2  28-MAR-1991   Check sys.Version#(High)
      V3.3  30-MAR-1991   Correct position of ser# check.
      V3.4   1-APR-1991   Correct V3.3 (append "close, 2" in check of ser#.)
      V3.5   4-APR-1991   Rewrite QL-Search count "ic".
      V3.6  10-APR-1991   Eeffective programming by minimizing virtual memory.
      V3.7  18-APR-1991   Append new time search(CHTM).
      V3.8  26-FEB-1995   Year = 'SA'
      V3.9  03-Mar-1995   Display images first and then show information
                                                                              


SXTPFI1 [2] $SSW/yohkoh/ucon/idl/shimizu/pfidl.pro
[Previous] [Next]
 NAME:
       SXTPFI1
 PURPOSE:
   *****************************************************
   *   SOLAR-A/SXT IMAGE QUICK LOOK SYSTEM (Ver,3.9)   *
   *     (DISPLAY PFI IMAGES AS OBSERVING REGIN )      *
   *****************************************************
 CATEGORY:
       SOLAR-A/SXT QL
 CALLING SEQUENCE:
       This is main procedure.
       .run sxtpfi1
 INPUTS:
       None.
       But Inputs is asked by menu after running this procedure.
 OUTPUTS:
       None.
    NOTE:
       Header information is stored in the variation "header" and image data
     is stored in the variation "image".
 COMMON BLOCKS:
       None.
 SIDE EFFECTS:
       Open Window and display PFI image.
 RESTRICTIONS:
       None.
 PROCEDURE:
       Read the image data from image data files(/SXTpfi/YYMMDD/HHMMSS.dat)
     and check the header information. And then display the image and status
     informations.
 PROGRAMER:
       TOSHIFUMI SHIMIZU
            Department of Astronomy, University of Tokyo, JAPAN
 HISTORY:
            29-DEC-1990   Version sunview                                     
             8-JAN-1991   COMPLETE FILE SEARCH AND SELECT FUNCTION            
      V1.0  10-JAN-1991   Revice either foe Version X-WINDOW and for Sunview  
      V1.1  31-JAN-1991   C ADD --> S ADD (STATUS TITLE)                      
      V1.2  31-JAN-1991   NSSIZE=1&EWSIZE=1,2 ZOOM FACTER 1/2 CHANGE          
      V1.3  31-JAN-1991   CHECK OUT IMAGE COMPLETION FROM ALL HEADER DATA     
                          Check out Image Quality From All Header Data        
      V1.4  31-JAN-1991   Support Inputted Blank into TIME (MENU)             
      V1.5   1-FEB-1991   Read file change                                    
                            /SXTpfi/yymmdd/hhmmss.dat                         
                            FLTM= STRMID(INFL, 15, 6)                         
      V1.6   3-FEB-1991   Correct Image Quality                               
      V2.0  11-MAR-1991   Change PFI file format. from mkimage_ql(new)        
      V2.1  15-MAR-1991   Correct Rebin without interpolation.                
      V2.2  19-MAR-1991   Modify Window.                                       
      V2.3  19-MAR-1991   Modify QL Search                                    
      V3.0  27-MAR-1991   Change header layout(Ver,1.0)                       
      V3.1  28-MAR-1991   Change layout of status.
                            Delete TLM:,MOD: and Append CCD TEMP:,ARS:,ART:   
      V3.2  28-MAR-1991   Check sys.Version#(High)
      V3.3  30-MAR-1991   Correct position of ser# check.
      V3.4   1-APR-1991   Correct V3.3 (append "close, 2" in check of ser#.)
      V3.5   4-APR-1991   Rewrite QL-Search count "ic".
      V3.6  10-APR-1991   Eeffective programming by minimizing virtual memory.
      V3.7  18-APR-1991   Append new time search(CHTM).
      V3.8  26-FEB-1995   Year = 'SA'
      V3.9  03-Mar-1995   Display images first and then show information
                                                                              


SXTPIXON $SSW/yohkoh/ucon/idl/metcalf/sxtpixon.pro
[Previous] [Next]

pro sxtpixon,index,data,movie,snr=snr,nosnr=nosnr,nochi2=nochi2, $
             doubleres=doubleres

NAME:
     SXTPIXON
PURPOSE:
     Deconvolves the SXT point spread function
CATEGORY:
CALLING SEQUENCE:
     sxtpixon,index,data,ndata
INPUTS:
     index = SXT index
     data = SXT data cube (after processing by sxt_prep!)
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     /snr  = Use SNR weighting in the iteration goodness-of-fit (GOF)
     /nochi2 = Use Pina and Puetter's GOF rather than chi^2
     /doubleres = return image with double the spatial resoltuion.
                  The default is to bin the answer back down to the original
                  spatial resoltion.
OUTPUTS:
     ndata = Deconvolved data cube
 CALLS: ***
	PSFPIXON, gt_res, sxt_psf
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
     Works best with full resolution data.

     Data is not corrected in any way.  Sxtpixon assumes that data has
     been run through sxt_prep.

     SXTPIXON will not work well in areas with saturation or bleed.

     The edges of the image are not deconvolved properly (because of the 
     way IDL's CONVOL routine works) so the images should be centered in
     the FOV.
PROCEDURE:
     Uses pixon deconvolution from Pina and Puetter.  To end the iterations
     prematurely, type a "Q".
MODIFICATION HISTORY:
     T. Metcalf June 24, 1994


sxtpnt_sum $SSW/yohkoh/sxt/idl/util/sxtpnt_sum.pro
[Previous] [Next]
NAME:
	sxtpnt_sum
PURPOSE:
	To generate a summary listing of the SXT images taken for a time
	span sorting by different PFI pointings
SAMPLE SEQUENCE CALL:
	sxtpnt_sum, sttim, entim
	sxtpnt_sum, '5-oct-93 13:00', '6-sep-93 1:00', /hc
	sxtpnt_sum, '5-oct-93 13:00', '6-sep-93 1:00', outfil='harvey1.txt'
INPUT:
	sttim	- The starting time
	entim	- The ending time
OPTIONAL INPUT:
	outfil	- The name of the output file.  If not passed, it will 
		  make the file "sxtpnt_sum.txt" in your home directory.
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DPRINT, GET_NBYTES, UNIQ [1]
	UNIQ [2], UNIQ [3], concat_dir [4], gt_center, int2secarr [1], int2secarr [2]
	obs_summary, rd_obs
OPTIONAL KEYWORD INPUT:
	hc	- If set, then print the file to the laser printer.
	minsep	- The minimum change in pointing in arcminutes before 
		  flagging it as a new region.  Default is 0.75 arcmin.
HISTORY:
	Written 19-Oct-93 by M.Morrison
	27-Oct-93 (MDM) - Added the MINSEP keyword option


sxtth_hxt $SSW/yohkoh/ucon/idl/mctiernan/sxtth_hxt.pro
[Previous] [Next]
 NAME:
	sxtth_hxt
 PURPOSE:
	To fit spectra for sxt and hxt, using any_fsp.pro,
       This fits the total sxt emission to a thermal component,
       and subtracts the expected amount from the total
       hxt emission. TIme ranges are chose using SXT.
 CALLING SEQUENCE:
       sxtth_hxt, index, data, hindex, hdata, s_fitp, h_fitp, $
                  s_scpar, h_scpar, s_chdta, h_chdta, $
                  outfile = outfile, pfile = pfile, filt_no = filt_no, $
                  time_range=time_range, all=all, noplot=noplot, $
                  h_tyspec=h_tyspec, h_sdel=h_sdel, s_tyspec=s_tyspec, $
                  use_filters=use_filters, sindex=sindex, sdata=sdata, $
                  s_sys_err=s_sys_err,h_sys_err=h_sys_err, $
                  h_bck_time=h_bck_time,h_bck_dt=h_bck_dt,h_auto_bck=h_auto_bck
 INPUT:
	index= info. structure for SXT data from test_rd
       data= compressed SXT data, can be sxt_prepped, now
       hindex= info. structure for HXT data
       hdata= HXT data
 OUTPUT:
;      s_fitp and h_fitp, are structures for SXT and HXT respectively:
	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.
;      s_scpar and h_scpar are structures for SXT and HXT respectively
	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)
;      s_chdta and h_chdta are structures for SXT and HXT respectively
	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
 KEYWORD INPUT:
	outfile= the output file
	pfile= a file for spectral plot
       filt_no=a filter no. to choose the SXT interval
       h_tyspec= type of spectrum for HXT fit, default is a prompt
       h_sdel=HXT channels to delete, default is a prompt
       s_tyspec=type of spectrum for SXT fit, default is thermal with lines =10
       use_filters = an array of filter numbers, 2 is al.1, 3 is AlMG,
                     4 is Be119, 5 is Al12, 6 is Mg3, the default is
                     to use [2, 4, 5]. Be careful, SXT_INTERP is used,
                     so that if you tell it a filter that isn't used
                     near the time interval that you have, you may
                     get nonsense...
       sindex, sdata= prepped index and data, so you need not do this every time
       s_, h_sys_err= 'systematic errors', for each instrument, useful for the
                      mismatch in count rates between SXT, HXT, or pass in if you
                      don't trust the errors you get from counting stats, or to
                      arbitrarily push down chi^2 values, The default iz 0.0.
                      This makes the error in the rate = sqrt(cps/dt)+sys_err*cps.
       h_bck_time= bck start time for HXT, if not set you choose it.
       h_bck_dt= dt of the HXT bck interval, if returned
       h_auto_bck= use automatic background finding for HXT
       time_range = a time range, all of the points in this range are used
       All= if set, use all of the points...
       noplot= if set, no screen plot
 CALLS: ***
	INTERPU_1D, accum_counts [1], accum_counts [2], accum_counts [3], any_fsp
	anytim2ex [1], anytim2ex [2], anytim2ints [1], anytim2ints [2], auto_bck_find
	choose_interval, fmt_tim [1], fmt_tim [2], fsp_outplot, fsp_output, hxt_chsums
	hxt_thcomp, int2secarr [1], int2secarr [2], sxt_fsp
 HISTORY:
	Written Mar, '93 by J.McTiernan
       2-dec-93, multiple intervals JMM
       accounted for hxt 4 second delay, 9/21/94, jmm
       changed to call sxt_fsp, why not, jmm, 5-23-95
       Added the sys_err's, jmm, 6-24-95
       New output format, jmm, 7-28-95


SYM_CIRCLE $SSW/yohkoh/ucon/idl/sakao/sym_circle.pro
[Previous] [Next]
 NAME:
	SYM_CIRCLE
 PURPOSE:
	Set plot symbol as a circle. 
 CALLING SEQUENCE:
	SYM_CIRCLE
	SYM_CIRCLE, /fill
	SYM_CIRCLE, /fill, radius=1.5
 INPUT:
	none
 OPTIONAL KEYWORD INPUT:
	fill	- If set, then the plot symbol is a filled-circle. Default is 
		  an open-circle. 
	radius	- Specifies radius of the circle. Default = 1.0. 
 OUTPUT:
	none.
 SIDE EFFECT:
	User-defined plot symbol is changed. 
 NOTE:
	Set psym = 8 when using the plot symbol made by this procedure. 
 HISTORY:
	version 1.0	96.02.04 (Sun)	T.Sakao written.


SYNOP_3_ROTS $SSW/yohkoh/ucon/idl/hudson/synop_3_rots.pro
[Previous] [Next]
 NAME:
     SYNOP_3_ROTS
 PURPOSE:
     Access the SXT data base for synoptic charts and plot 3 in a 
       vertical array with the input rotation in the middle.
     For information about the nature of the charts, see Greg Slater.
 CATEGORY:
     Yohkoh
 CALLING SEQUENCE:
     synop_3_rots, cr, /print
 INPUTS:
     cr is the Carrington rotation number
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED
     rd_xda, grid, fmt_tim
 OUTPUTS:
 CALLS: ***
	RD_XDA [1], RD_XDA [2], WDEF [1], WDEF [2], fmt_tim [1], fmt_tim [2], grid
 COMMON BLOCKS:
 SIDE EFFECTS:
     siezes IDL window 0
 RESTRICTIONS:
 MODIFICATION HISTORY:
     HSH, written 6-Jan-95


synop_movie $SSW/yohkoh/ucon/idl/morrison/synop_movie.pro
[Previous] [Next]
NAME:
	synop_movie
PURPOSE:
	To display the SXT and Kitt Peak Magnetogram and He 10840 synoptic
	images.  The display screen should be at least 900x900.  
CALLING SEQUENCE:
	synop_movie
	synop_movie, 1850, 1855
	synop_movie, outfil_base='/2p/morrison/junk/synop_'
	synop_movie, /sxt_only
OPTIONAL INPUT:
	strot	- The starting carrington rotation number
	enrot	- The ending carrington rotation number
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], CONGRID [1], CONGRID [2]
	CONGRID [3], FILE_EXIST [2], PAUSE [1], RD_SDA [1], RD_SDA [2], RD_SDA [3]
	RFITS [1], RFITS [2], RFITS [3], TV_SSX, concat_dir [4], file_exist [1]
	file_exist [3], pause [2], savegen [1], savegen [2]
OPTIONAL KEYWORD INPUT:
	outfil_base - The directory and beginning of the filename for the
		      GENX save file.  The portion _CR####.GENX will be
		      added to the filename
	sxt_only - If set, then just display the SSC, SSE, and SSW images
	nvs	- If set, then make the images less than 486 tall
HISTORY:
	Written 31-May-93 by M.Morrison


synth $SSW/yohkoh/ucon/idl/pike/synth.pro
[Previous] [Next]
  Procedure to (o)plot, or just read, a theoretical spectrum calculated 
  for a given temperature.  If suitable arays are given as arguments, 
  then the spectral data are returned in them.

  Parameters:  chan    1-4  the channel to simulate. FeXXVI, FeXXV, Ca, S
               temp    temperature of calculation in Mdegs
               wave    wavelength of data points
               inten   spectrum intensity
               /over   if specified, theoretical spectrum is plotted over
                       existing plot.
               /noplot if specified, supresses plotting (only makes sense
                       if return arrays are specified.

  Use    IDL> synth,2,9         plot FeXXV spectrum for temperature of 9 Mdegs
         IDL> synth,2,9,/over   oplot FeXXV spectrum for temperature of 9 Mdegs
         IDL> synth [,/over]    parameters will be prompted for.
         IDL> synth,2,9,wave_25,fe25_cnts,/noplot   just load arrays, no plot


  In oplot mode the scale factor is prompted for.

  Data files: ACS
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], concat_dir [4]
 CALLED BY:
	get_syn_25
  Procedure:  CDP     Feb 92


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

   Purpose: test use of ys system variables for printer control

   Input Paramters:
      filename - file to print (substitute for FILENAME in print command)

   Keyword Parameters
     pers - if set, personal print command is selected
     site - if set, site specific print command is selected
     font - if set, substitute for FONT in print command

   History:
      slf - 4-feb-1993
  
 CALLS: ***
	sprint, str_replace [1], str_replace [2]
   Restrictions:
      system varialbes must be defined first (via ys_defsysv.pro)


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

   Purpose: return current time in yohkoh db terms

   slf, 6-mar-92 from existing routines 

 CALLS:
 CALLED BY
	adsdirs [1], adsdirs [2], ccd_sunc [1], ccd_sunc [2], check_process [1]
	check_process [2], cnvtimstr, diskbench, goes_gaps, goes_plot [1], goes_plot [2]
	goes_plot [3], goes_plot [4], goes_plot [5], goes_summary, last_lc, launch [1]
	launch [2], mk_ydbtape [1], mk_ydbtape [2], rdtbl


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

  Purpose:
    Returns the current system time

  Calling sequence:
    string_var = systime2()

  Method:
    This is a unix specific routine.
    Spawns unix date command with a format list.  This routine
    gets around the problem of IDL returning the wrong time even if the
    kernal as not been built correctly.

 CALLED BY:
	SUMM_CALS, WOBS_PLOT, WR_FULL_LOAD, plot_ssw_fov
  Modification History:
    Written, 10-dec-91, J. R. Lemen