LABEL_TV $SSW/yohkoh/ucon/idl/wuelser/label_tv.pro
[Previous] [Next]
 NAME:
	LABEL_TV
 PURPOSE:
	Display an image with labelled axes.
 CATEGORY:
	General graphics.
 CALLING SEQUENCE:
	label_tv, aa
 INPUTS:
	aa = 2 dimensional array to display.
 KEYWORD PARAMETERS:
       xrange = [from,to].  x pixel range to be displayed
       yrange = [from,to].  y pixel range to be displayed
       title = string containing a plot title
	/WINDOW_SCALE = set to scale the window size to the image size,
		otherwise the image size is scaled to the window size.
		Ignored when outputting to devices with scalable pixels.
	/ASPECT = set to retain image's aspect ratio.  Assumes square
		pixels.  If /WINDOW_SCALE is set, the aspect ratio is
		retained.
	/INTERP = set to bi-linear interpolate if image is resampled.
 OUTPUTS:
	No explicit outputs.
 COMMON BLOCKS:
	none.
 SIDE EFFECTS:
	The currently selected display is affected.
 RESTRICTIONS:
	None that are obvious.
 PROCEDURE:
	If the device has scalable pixels then the image is written over
	the plot window.
 MODIFICATION HISTORY:
	JPW Jan. 1992 adopted from image_cont by DMS, May, 1988.


lam2bin $SSW/yohkoh/ucon/idl/pike/lam2bin.pro
[Previous] [Next]
   Procedure to return the start and stop bins in a wavelength array
   corresponding to start and stop wavelengths

  Input:     l_arr       array of wavelengths, bins are assumed to be the
                         indices in this array
             lam_st      start wavelength
             lam_end     end wavelength
 
  Ouput:     bin_st      bin corresponding to lam_st
             bin_end     bin corresponding to lam_end


  Use:
        IDL> lam2bin, l_arr, lam_st, lam_end, bin_st, bin_end


   CDP  Feb 92

 CALLED BY
	FE25_BSC_TEMP


LAND [1] $SSW/yohkoh/ucon/idl/morrison/land.pro
[Previous] [Next]
 Name:
	LAND
 Purpose:
	Set up PostScript parameters for landscape.

	No arguments are required for 5" by 5" plots.
	The ASPECT keyword overrides YLEN.

 Optional Inputs:
	XLEN	= X axis length (in)
	YLEN	= Y axis length (in)
	ASP	= Ratio of Y?X AXIS lengths (overrides YLEN)
	SF	= Global scaling factor

 Modification History:
	Jan 1991,	Adapted by J.R. Lemen from E.S. Claflin program


LAND [2] $SSW/yohkoh/ucon/idl/morrison/laser.pro
[Previous] [Next]
 Name:
	LAND
 Purpose:
	Set up PostScript parameters for landscape.

	No arguments are required for 5" by 5" plots.
	The ASPECT keyword overrides YLEN.

 Optional Inputs:
	XLEN	= X axis length (in)
	YLEN	= Y axis length (in)
	ASP	= Ratio of Y?X AXIS lengths (overrides YLEN)
	SF	= Global scaling factor

 CALLS: ***
	LASER
 Modification History:
	Aug 1991,	Mons Morrison
	Jan 1991,	Adapted by J.R. Lemen from E.S. Claflin program
	25-Oct-93 (MDM) - Adjusted the size for the /PORTRAIT option


LAND_LEMEN $SSW/yohkoh/ucon/idl/hudson/land_lemen.pro
[Previous] [Next]
 Name:
	LAND_LEMEN
 Purpose:
	Set up PostScript parameters for landscape.

	No arguments are required for 5" by 5" plots.
	The ASPECT keyword overrides YLEN.

 Optional Inputs:
	XSIZE	= X axis length (in) NOTE: must be floating point!
	YSIZE	= Y axis length (in)
	ASP	= Ratio of Y/X AXIS lengths (overrides YSIZE)
	SF	= Global scaling factor

 Modification History:
	Jan 1991,	Adapted by J.R. Lemen from E.S. Claflin program
  12-jul-93, JRL, Changed the keyword names
  14-oct-94, HSH, changed the program name and put it on line
  15-oct-94  HSH  saved the plot variables


laser_init $SSW/yohkoh/gen/idl/movie/laser_init.pro
[Previous] [Next]
  Name:
    laser_init
  Purpose:
    initialize the LASER common block.

 CALLED BY:
	command_laser, get_laser_type, laser_write
  Note:
    this expects the laser disk player/recorder to have a disk in, and
    the motor running.
  Calling Sequence:
    laser_write, buff [,device]
  Optional Input Keyword:
    device = 0 or 1 for recorder or player (def=0)
             (device can also just be a input parameter)
 CALLS: ***
	get_host [1], get_host [2]
  Common Blocks:
       LASER
  Procedure:
    determine which computer we are running on in order to determine how
    to properly define the device_str array.
  Modification History:
       feb-1995 - written by L. Shing
		    used part of JRL's command_pana to determine HOST
		    and thus the proper device name to call.
	oct-1995 - made /dev/tty0n match the terminal server on isassN
       oct-1999 - added /dev/tty07 --PGS


laser_write $SSW/yohkoh/gen/idl/ys_util/laser_write.pro
[Previous] [Next]
  Name:
    laser_write
  Purpose:
    send a command to the laser disk/player-- using C routine to get response.;
  Calling Sequence:
    laser_write, buff [,device=device, resp=resp]
    laser_write, buff [,device, resp=resp]
    laser_write, buff [,device]

 CALLED BY:
	command_laser, get_laser_type
  Note:
    the type of machine is determine by the response on the terminal
    line.  the terminal line is expected to be 9600 baud for the PANASONIC,
    and 1200 baud for the SONY; the SONY has problems losing characters
    if they are sent too fast (might only be a problem with the
    model 3000 series SONY).

    this routine depends on the C routine 'call.c' written in 1/95
    spawn with the /noshell option is used to run the C routine.
    it keeps reading from the called C routine until a char=0 is
    sent back.

  Input:
    buff   = String containing command, 'BP', 'EJ', string('60'xb)
  Optional Input Keyword:
    device = 0 or 1 for recorder or player (def=0)
             (device can also just be a input parameter)
    nowait = flag to tell C program NOT to wait for complete response from
               the laser disk player.
  Optional output keyword:
    resp   = response from laser disk
    rawresp = response from the laser disk (byte form) sometimes, ascii
                               just won't do.
    noparse = flag to make sure that we don't recurse forever in this
		routine when we are parsing long commands.
		the SONY has a tough time dealing with long commands.

 CALLS: ***
	get_laser_type, laser_init
  Common Blocks:
       LASER
  Procedure:
    sends the chars in 'buff' to the machine; also, if the machine is
    the PANASONIC, it will attach the STX and ETX characters that are
    required for the PANASONIC.

  Modification History:
       feb-1995 - written by L. Shing
	oct-1995, LS , fixed a problem with /nowait


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

   Purpose: plot goes x-ray and yohkoh light curves on same scale


   Calling Sequence:
      last_lc [/bcs, /hxt ,/wbs , /all, last=last]

   Input Parameters:
      input1 - user start time or goes xray data record structure array
      input2 - user stop time

   Optional Keyword Paramters:
      fem - if set, overplot Yohko ephemeris grid (call fem_grid)
      fillnight - (pass to fem_grid) - polyfill Yohkoh nights
      fillsaa   - (pass to fem_grid) - polyfill Yohkoh saas
      saa       - (pass to fem_grid) - show saa events overlay grid
      low 	 - if set, only plot low energy
      high      - if set, only plot high energy
      title     - user title (appended to default title predicate)
      nodeftitle- if set, dont append default title predicate
      color    - color of lines

 CALLS: ***
	ADDTIME [1], ADDTIME [2], GBO_STRUCT [1], GBO_STRUCT [2], GET_RANGE, PLOT_GOES
	REVERSE, Rd_Roadmap [2], UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5]
	UTPLOT [6], UTPLOT_ALL, anytim2ex [1], anytim2ex [2], anytim2ints [1]
	anytim2ints [2], data_chk [1], data_chk [2], fem_grid [1], fem_grid [2]
	fmt_tim [1], fmt_tim [2], gt_day [1], gt_day [2], gt_grs1, gt_hxs [1], gt_hxs [2]
	gt_rbmsc, gt_sum_h [1], gt_sum_h [2], gt_sum_l [1], gt_sum_l [2], gt_sum_m1 [1]
	gt_sum_m1 [2], gt_sum_m2 [1], gt_sum_m2 [2], gt_sxs1 [1], gt_sxs1 [2]
	newfiles [1], newfiles [2], newfiles [3], rd_gxt, rd_obs, rd_roadmap [1]
	restsys [1], restsys [2], savesys [1], savesys [2], str_concat [1], str_concat [2]
	str_replace [1], str_replace [2], syst2ex [1], syst2ex [2], syst2ex [3]
     History:
	22-Nov-1993 (SLF) butchered a version of plot_goes
        6-Dec-1993 (SLF) call savesys and restsys (avoid global side effects)

savesys,/aplot
debug=keyword_set(debug)

case 1 of
   keyword_set(all): notyet='ALL'
   keyword_set(wbs): notyet='WBS'
   else:
endcase
if n_elements(noyet) ne 0 then begin
   message,/info,'Keyword: ' + notyet  +  ' not yet supported'
   return
endif


lastgbo $SSW/yohkoh/gen/idl/gbo/lastgbo.pro
[Previous] [Next]
 NAME:
      	lastgbo
 PURPOSE:
	reads the last gki image (NSO/KP He 10830 images)
       reads the last gbh image (Big Bear H-alpha)
       reads the last gkm image (NSO/KP magnetogram)
       reads the last gnt image (Nobeyama radioheliograph)
 CATEGORY:
 CALLING SEQUENCE:

  lastgbo,gkiimg,gbhimg,gkmimg,gntimggkitime=t1,gbhtime=t2,
          gkmtime=t3,gnttime=t3

 OPTIONAL (KEYWORD) INPUT PARAMETERS:
	gbotime is the start time of the image scan, fmt_tim style
 OUTPUTS:
	img1 (477,477), img2 (640,481), img3 (477,477), img4 (512,512)
 CALLS: ***
	GBO_MASK, RFITS2 [1], RFITS2 [2], file_list [1], file_list [2], fmt_tim [1]
	fmt_tim [2], gbo_paths [1], gbo_paths [2], gntcleen, str_replace [1]
	str_replace [2], wc_where [1], wc_where [2]
 COMMON BLOCKS:
 ROUTINES CALLED:
	gbo_paths, file_list, rfits, rfits2, anytim
 MODIFICATION HISTORY:
	DA, HSH, RAS written 13-Apr-94
       SLF 13-Apr-94 use /NOSHELL keyword in gbo_path call (inhibit shell)
	HSH 18-Apr-94 fixed end-of-week problem with finding GKI's
       DA  26-apr-94 modified lastgki to include several ground based images
       DA  23-May-94 modified to do better job cleaning up GNT image
       DA  21-Jun-94 corrected for change to gkm header
	BNH  1-Jul-94 revamped method of aquiring time stamps to be much 
	              more robust
	BNH  7-Jul-94 Added /scale to RFITS call to scale gki, gkm data 
                     correctly consistently...I hope.
       SLF 15-Sep-94 use rfits2 instead of rfits (allow compressed data)
       SLF  8-oct-94 use gbo_mask instead of hardcoded gbh indices


lastgki $SSW/yohkoh/gen/idl/gbo/lastgki.pro
[Previous] [Next]
 NAME:
      	lastgki
 PURPOSE:
	reads the last gki image (NSO/KP He 10830 images
 CATEGORY:
 CALLING SEQUENCE:
	img = lastgki()
	img = lastgki(gkitime=tt)
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
	gkitime is the start time of the image scan, fmt_tim style
 OUTPUTS:
	img is (477,477)
 CALLS: ***
	ARR2STR [1], Arr2Str [2], REVERSE, RFITS [1], RFITS [2], RFITS [3], STR2ARR [1]
	STR2ARR [2], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	file_list [1], file_list [2], gbo_paths [1], gbo_paths [2]
 COMMON BLOCKS:
 ROUTINES CALLED:
	gbo_paths, file_list, rfits, anytim
 MODIFICATION HISTORY:
	DA, HSH, RAS written 13-Apr-94
       SLF 13-Apr-94 use /NOSHELL keyword in gbo_path call (inhibit shell)
	HSH 18-Apr-94 fixed end-of-week problem with finding GKI's


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

   Purpose: read and display most recent sfd or sfr image(s) 

   Output Paramters:
      index - sxt index
      data  - sxt data (image or cube)

   Input Parameters
      nimg (optional) - number to read (default is 1) - last nimg images read

   Optional Keyword Parameters:
      nar -   if set, overlay noaa active regions
      notv -  if set, just return index/data (no image display)
      obsr -  if set,  read corresponding spr and overlay observing region
      color - if set, load color table 3, tone down grid brighteness 
      sfr   - if set, use sfr, not sfd
      spr   - if set, usd spr (PFI) files, not sfd
      spd   - if set, usd spd (processed PFI) files, not sfd
      rebin - if set, rebin to size (512 or 256 only)
      halfres - if set, select most recent Half Res image (if available) 
                according to the following priority...
		 1:AlMg(half)  2:-Al.1(half) 3:Quarter(last image in file)
                Note - /halfres is ignored if nimg is present

   Calling Examples:
      lastsfd, /movie [,/goes]     ; last ~ 30 imgs "prepped" , spawn xstepper
      lastsfd, /nar		    ; display sxt image and overlay NOAA regions
      lastsfd, /nar,/obsr	    ; same with recent OR    
      lastsfd, /nar,/obsr,/color   ; same with standard colors
      lastsfd, index,data,10,/notv ; return index/data for last 10 sfd images
      lastsfd, index,data,10	    ; same with display of last
      lastsfd, index,data,5,/sfr,/stepper ; use sfr files - select w/stepper
      lastsfd, /allobs	    	    ; boxes for uniq sprs in corresponding file
      lastsfd, /allobs,/oldfile    ; same in next to last file
      lastsfd, /allobs, oldfile=5  ; same in 5th to last file
      lastsfd, /spd,index,data,50  ; return last 50 SPD (pre-processsed pfi)
      lastsfd, index,data,/half    ; Last Half-Res image if available
      lastsfd, index,data,/sss     ; access 'sss' data base (8bit log)
      lastsfd, index,data,/ssc     ; access 'ssc' data base (floating)

   Calls newsfd.pro to get recent SFD image(s)

 CALLS: ***
	FILE_EXIST [2], RD_SDA [1], RD_SDA [2], RD_SDA [3], Rd_Roadmap [2], STEPPER [1]
	STEPPER [2], STEPPER [3], STEPPER [4], STEPPER [5], STEPPER [6], STEPPER [7]
	WDEF [1], WDEF [2], file_exist [1], file_exist [3], fmt_tim [1], fmt_tim [2]
	gt_filtb, gt_res, gt_time [1], gt_time [2], newsfd, plot_nar [1], plot_nar [2]
	rd_roadmap [1], stepper_title [1], stepper_title [2], str_replace [1]
	str_replace [2], sxt_uniq [1], sxt_uniq [2], tim2dset [1], tim2dset [2]
	tim2orbit [1], tim2orbit [2], xrayss
 CALLED BY:
	FAKE_PATROL, FAXABLE_SFD, FIRST_LIGHT [1], FIRST_LIGHT [2], NAR2COORD, SFD_CDS
	SFD_TEK, SOHO_COORDS, TERM_QUICK, TERM_REVIEW, TERM_REVIEW_GIF, chk_pointing
	fl_summary [1], fl_summary [2], fl_summary [3], fl_suntoday [1], fl_suntoday [2]
	fl_suntoday [3], fl_sxtobsnar [1], fl_sxtobsnar [2], gbo_obs_coord, lastspd
	sun_today [1], sun_today [2], sun_today [3], sxt_summary, term_score2, xspr [1]
	xspr [2]
   Side effects:
      may open new window

   History:      7-May-1993 SLF (Written)
	         10-may-1993 add obsr, color
		 13-may-1993 add stepper keyword and sfr
		 30-aug-1993 add /allobs keyword
			     (filter out night PFIs)
		  9-Dec-1993 add /spd and /spr switches
                14-Jul-1994 zbuffer switch to plot_nar
		 17-Jul-1994 Filter out Non-Xray images in obs plot
			     (dont display dark-cal / diffuser)
                 1-Dec-1994 (SLF) update header (spd,spr,half keywords)
                22-aug-1995 (SLF) made /half the default
                30-aug-1995 (SLF) fixed bug caused by 22-aug (3rd paramter caused crash)
                10-feb-1997 (SLF) add /MOVIE and /GOES keywords
                8-Aug-2000 (SLF) add /SSC and /SSS


LASTSFD_DIFF $SSW/yohkoh/ucon/idl/sxt_co/lastsfd_diff.pro
[Previous] [Next]
 NAME:
     LASTSFD_DIFF
 PURPOSE:
     Compare two SFDs as a difference on an exaggerated color table.
     Shows Q res AlMg's or Al.1 upon demand, otherwise defaults to
       half-res Al.1.
     Main purpose is to do the most recent daily difference to search
       for emerging flux and/or other interesting variations.
 CATEGORY:
 CALLING SEQUENCE:
     lastsfd_diff
     lastsfd_diff, number = 10
 INPUTS:
     infil (optional) a range of file ID's. Default is the last few (see
       NUMBER below).  
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     diff_range, the DN range bytescaled out to the image
     /scale, calls DIFF_SCALE to show the double-square-root version
     /thinal, requires an Al.1 difference
     n_start is the most recent file to consider
     number = number of files to get (default 5 normally handles a
       one-day operations cycle)
 OUTPUTS:
 CALLS: ***
	DATA_PATHS, DIFF_SCALE, FILE2TIME, RD_XDA [1], RD_XDA [2], Rd_Roadmap [2]
	file_list [1], file_list [2], fmt_tim [1], fmt_tim [2], gt_filtb, gt_res
	rd_roadmap [1], sfd_decomp
 COMMON BLOCKS:
 SIDE EFFECTS:
     works best with color table 0
     puts an image up on your current window
 RESTRICTIONS:
 MODIFICATION HISTORY:
     23-Oct-98, written by HSH
      6-Nov-98, added /thinal and number (HSH)
     22-Nov-98, complete lube and oil job on the logic (HSH)
      7-Jan-99, made thin Al the default (replaced /thinal with /dag) 
        and reset the default diff_range (HSH)
     14-May-99, debugged and changed some parameters. Replaced
        FINDFILE with FILE_LIST (HSH)
     10-jan-99, sorted infil by time.  (y2k) (PGS)


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

   Purpose: quick and dirty test routine 
 CALLS:


LATEST_SFDS_GIF $SSW/yohkoh/ucon/idl/sxt_co/latest_sfds_gif.pro
[Previous] [Next]
 NAME:
     LATEST_SFDS_GIF
 PURPOSE:
     write .gif files on the ftp directory (sxt_co/quick)
 CATEGORY:
     Yohkoh operations
 CALLING SEQUENCE:
 INPUTS:
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], FILE2TIME, LOADCT, MORE [1], MORE [2], OVER, RD_XDA [1], RD_XDA [2]
	Rd_Roadmap [2], SXT_GRID [1], SXT_GRID [2], SXT_GRID [3], TIME2FILE, WDEF [1]
	WDEF [2], break_file [4], concat_dir [4], fmt_tim [1], fmt_tim [2], grid, gt_filtb
	gt_res, last_nelem, mkthumb, newfiles [1], newfiles [2], newfiles [3]
	rd_roadmap [1], str_replace [1], str_replace [2], zbuff2file [1], zbuff2file [2]
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     22-aug-98, written (HSH)
     26-Aug-98, converted to environmentals (HSH); added thumbnail
     03-FEB-99, writes full set of thumbnails.
     06-jan 00, y2k fix (PGS)
     23-aug-00, changed findfile to file_list(,/cd)
     12-apr-01, use SSS instead of SFD / use some SSW shortcuts


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

   Purpose: return yohkoh launch day (default) or days since 

   Optional Keyword Parameter:
      dsince - if set,  returns number of days since launch

 CALLS: ***
	ADDTIME [1], ADDTIME [2], anytim2ex [1], anytim2ex [2], syst2ex [1], syst2ex [2]
	syst2ex [3]
 CALLED BY:
	chk_flares [1], chk_flares [2]
   History: slf, 25-Mar-92


LAY1GKM $SSW/yohkoh/ucon/idl/hudson/lay1gkm.pro
[Previous] [Next]
 NAME:
     LAY1GKM
 PURPOSE:
     overlay a file Kitt Peak magnetogram on an SXT image by simple projection
       on a PFI. The /other switch allows one to go to the next nearest
       available magnetogram in the opposite time sense, ie ideally to
       straddle the data, to see if the rotation correction is coming
       out about right.
 CATEGORY:
     Yohkoh
 CALLING SEQUENCE:
     mag = lay1gkm(index, full=full)
     mag = lay1gkm(index, data=data, /blink)
 INPUTS:
     index entry of SXT data
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
     data = data, if /blink desired
     blink, blinks the output magnetogram and the specified data
     full returns the full magnetogram as used for coalignment (restored
       to 447x447 pixels but shifted to match the location)
     other, looks for a GKM on the other side of the target time
       for comparison
     head, returns FITS header of magnetogram
 ROUTINES CALLED
     DSK_LOCB, GET1GBO, GT_CENTER, STEPPER, CONV_P2H etc., SXT_CEN,
       CONGRID, DIFF_ROT, INT2SECARR, ANYTIM, GT_CENTER, etc., etc. 
 OUTPUTS:
     Magnetogram in same format and scale as the target PFI
 CALLS: ***
	CONGRID [1], CONGRID [2], CONGRID [3], DIFF_ROT [1], DIFF_ROT [2], STEPPER [1]
	STEPPER [2], STEPPER [3], STEPPER [4], STEPPER [5], STEPPER [6], STEPPER [7]
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], conv_h2p [1]
	conv_h2p [2], dsk_locb, fmt_tim [1], fmt_tim [2], get1gbo, get_rb0p [1]
	get_rb0p [2], gt_center, gt_corner, gt_pix_size, gt_res, gt_shape, int2secarr [1]
	int2secarr [2], sxt_cen [1], sxt_cen [2]
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     14-Nov-95, HSH, written
     16-Nov-95, HSH, added various features (blink, other) 
      6-Apr-96, HSH, corrected the call to DIFF_ROT
     21-May-96, HSH, corrected the call to DIFF_ROT in /other
      3-Sep-97, HSH, added FITS header output


lc_array formerly actonpro $SSW/yohkoh/ucon/idl/acton/lc_array.pro
[Previous] [Next]
 NAME:
   lc_array [formerly acton.pro]

 WARNING - THIS PROGRAM STILL HAS SOME PARAMETERS AND CAPABILITIES LEFT
   OVER FROM ITS PARENT PROGRAM THAT MAY NOT WORK IN THE REINCARNATION!

 PURPOSE:
   This procedure creates a multiwindow plot showing the
   light curve at each pixel in a 2-D region.  The input parameter is a
   3-D array, with time being the abcissa.  By default, each plot
   is expanded to touch its neighbors, and only the bottom row of
   abscissas and the left column of ordinates are labeled.  Pixel
   coordinates are written along the left and bottom axes (see optional
   keyword XYOFF).
   Experience has shown that a 20x20 region is about the limit of comfortable
   readability when the actongram is plotted on a sheet of letter-size paper
   using the PS and LS keywords.
   Optionally, preflare profile, difference profiles, and/or line bisectors
      may be overplotted.
   The user may modify IDL system variables such as !X.TICKS and !X.TICKV to
   create a satisfactory plot.
 CALLING SEQUENCE:
   lc_array, data, index, [out, ind, wave], 
     ry=ry, xyoff=xyoff, adjust=adjust, noerase=noerase, color=color
     maintit=maintit, titles=titles, xyout=xyout, /keepmargin, /all_axes,
     /ps, /ls, /print, help=help, norm=norm, scale=scale, sub=sub, bin=bin
 INPUTS:
   data = 3-D data array.
   index = index array
   wave = *optional* wavelength vector or velocity vector.  If not
      specified, data points are labeled with consecutive integers.
 OPTIONAL INPUT PARAMETERS:
   adjust = nonzero to compensate for continuum variations when plotting
      difference profiles.  The difference profile is moved up or down such
      that its minimum value is plotted at 0 on the ordinate.
   ry = ordinate range (default is from 0 [or min(data) if < 0] to max(data)).
   xyoff = 2-element vector specifying coordinate of lower-left pixel.
      X and Y coordinates increase to the right and upwards, respectively.
   maintit = overall plot title (e.g., time) to be written above plots.
   titles = individual plot titles (written inside plot region).
   xyout = 2-element vector specifying location of individual TITLES (default
      is to put text at upper left of plot region).
 OPTIONAL OUTPUT PARAMETERS:
   out = selected data array
   ind = selected index array
 KEYWORD PARAMETERS:
   norm = switch to exposure normalize the data, index not required if
      this is not used.
   scale = set this keyword if you want the plots scaled globally
   sub = set this to display and select sub array of data
   bin = rebin factor for selection of sub array for easy viewing
   noerase = do not erase the screen before plotting, default is to erase.
   color = sets color of plots, default is color=255
   keepmargin = set to *not* expand plot to maximum area.
   all_axes = set to label all axes, not just the abscissas of the bottom row
      and the ordinates of the left-hand column.
   ps = set for PostScript output
   ls = set for PostScript output with landscape orientation
   print = set to automatically print PostScript file (if /PS or /LS selected).
      The file (idl.ps) is *not* automatically deleted.
   help = set to display calling sequence summary (procedure is not executed)
 CALLS: ***
	LC_ARRAY, SUBIMG, clearplot [1], clearplot [2], exp_norm [1], exp_norm [2]
 MODIFICATION HISTORY:
   Original routine (BISEC.PRO) written by J-P Wuelser. [version 1.0]
   1991 Sep 04: XBISEC, YBISEC and TITLES keywords added by J-F de La
                Beaujardiere. [1.1]
   1991 Sep 09: Documentation block (";+" to ";-") added; HELP and XYOUT
                keywords added; T keyword replaced by MAINTIT. (JdLB) [1.2]
   1991 Sep 10: OUTSIDE_AXES keyword added and default axis labeling scheme
                established. (JdLB) [1.3]
   1991 Sep 12: Function of BI keyword modified to specify linestyle. (JdLB)
                [1.3.1]
   1991 Sep 18: COL keyword added. (JdLB) [1.4]
   1991 Nov 21: PRINT keyword added. (JdLB) [1.5]
   1991 Dec 10: Plotting order corrected to yield proper orientation.
                Labeling of pixel coordinates, and XYOFF keyword, added.
                COL keyword removed.  KEEPMARGIN keyword added.  WAVE
                argument made optional. (JdLB) [1.6]
   1992 Jan 10: PFDATA, PREFLARE and DIFF keywords added. (JdLB) [1.7]
   1992 Jan 30: Handling of axis tick names improved. (JdLB) [1.7.1]
   1992 Apr 20: ADJUST keyword added. (JdLB) [1.8]
   1992 Sep 22: Function of DIFF and PREFLARE keywords modified to specify
                linestyle.  LS keyword modified to not require PS keyword.
                (JdLB) [1.8.1]
   1992 Oct 05: ADJUST keyword modified to merely move the difference profile
                such that its minimum falls at 0. (JdLB) [1.8.2]
   1992 Oct 28: Adapted to plot an array of single pixel light curves
                (LWA)


lc_array1 formerly actonpro $SSW/yohkoh/ucon/idl/mctiernan/lc_array1.pro
[Previous] [Next]
 NAME:
   lc_array1 [formerly acton.pro]
 PURPOSE:
   This procedure creates a multiwindow plot showing the
   light curve at each pixel in a 2-D region.  The input parameter is a
   3-D array, with time being the abcissa.  By default, each plot
   is expanded to touch its neighbors, and only the bottom row of
   abscissas and the left column of ordinates are labeled.  Pixel
   coordinates are written along the left and bottom axes (see optional
   keyword XYOFF).
   Experience has shown that a 20x20 region is about the limit of comfortable
   readability when the actongram is plotted on a sheet of letter-size paper
   The user may modify IDL system variables such as !X.TICKS and !X.TICKV to
   create a satisfactory plot.
 CALLING SEQUENCE:
   lc_array1, data, index, wave,
     bin=bin, ry=ry, xyoff=xyoff, noerase=noerase, color=color,
     maintit=maintit, titles=titles, xyout=xyout, /keepmargin, /all_axes,
     /ps, /ls, /print, help=help, norm=norm, scale=scale,
     lc_oplot=lc_oplot, tim_oplot=tim_oplot, clr_oplot=clr_oplot,
     psym=psym, oplot_psym=oplot_psym
 INPUTS:
   data = 3-D data array.
   index = index array
   wave = *optional* wavelength vector or velocity vector.  If not
      specified, data points are labeled with time, from index. This
      way you can pass in a non-time vector to plot against, index
      must still be passed in, however, it will not be used if wave
      is passed in, unless the NORM keyword is set, or if wave doesn't
      have the right number of elements.
 OUTPUTS:
   wave = if not passed in, an array of seconds is passed out
 KEYWORD PARAMETERS:
   bin = a binning factor for easy viewing
   ry = ordinate range (default is from 0 [or min(data) if < 0] to max(data)).
   xyoff = 2-element vector specifying coordinate of lower-left pixel.
      X and Y coordinates increase to the right and upwards, respectively.
   maintit = overall plot title (e.g., time) to be written above plots.
   titles = individual plot titles (written inside plot region).
   xyout = 2-element vector specifying location of individual TITLES (default
      is to put text at upper left of plot region).
   norm = switch to exposure normalize the data
   scale = set this keyword if you want the plots scaled globally
   sub = set this to display and select sub array of data
   noerase = do not erase the screen before plotting, default is to erase.
   color = sets color of plots, default is color=255
   keepmargin = set to *not* expand plot to maximum area.
   all_axes = set to label all axes, not just the abscissas of the bottom row
      and the ordinates of the left-hand column.
   ps = set for PostScript output
   ls = set for PostScript output with landscape orientation
   print = set to automatically print PostScript file (if /PS or /LS selected)
   help = set to display calling sequence summary (procedure is not executed)
   lc_oplot = a light curve to overplot the data, this can be a data cube
              of the same size (in pixels, not necessarily time) as the input data.
              similar to the pfdata keyword, that once existed. Note that the
              BIN keyword will operate on lc_oplot if it is a cube.
   tim_oplot = a time array (structure or seconds), for the overplotted lc, if
               not passed in, the wave variable will be used, or index if wave
               is not passed in.
   clr_oplot = a color for the overplotted curve
   psym= psym for the plot
   oplot_psym = psym for the oplotted curve
 CALLS: ***
	DOC_LIBRARY, LC_ARRAY1, clearplot [1], clearplot [2], dn_pix_sum, exp_norm [1]
	exp_norm [2], int2secarr [1], int2secarr [2], pprint [1], pprint [2]
 MODIFICATION HISTORY:
   Original routine (BISEC.PRO) written by J-P Wuelser. [version 1.0]
   1991 Sep 04: XBISEC, YBISEC and TITLES keywords added by J-F de La
                Beaujardiere. [1.1]
   1991 Sep 09: Documentation block (";+" to ";-") added; HELP and XYOUT
                keywords added; T keyword replaced by MAINTIT. (JdLB) [1.2]
   1991 Sep 10: OUTSIDE_AXES keyword added and default axis labeling scheme
                established. (JdLB) [1.3]
   1991 Sep 12: Function of BI keyword modified to specify linestyle. (JdLB)
                [1.3.1]
   1991 Sep 18: COL keyword added. (JdLB) [1.4]
   1991 Nov 21: PRINT keyword added. (JdLB) [1.5]
   1991 Dec 10: Plotting order corrected to yield proper orientation.
                Labeling of pixel coordinates, and XYOFF keyword, added.
                COL keyword removed.  KEEPMARGIN keyword added.  WAVE
                argument made optional. (JdLB) [1.6]
   1992 Jan 10: PFDATA, PREFLARE and DIFF keywords added. (JdLB) [1.7]
   1992 Jan 30: Handling of axis tick names improved. (JdLB) [1.7.1]
   1992 Apr 20: ADJUST keyword added. (JdLB) [1.8]
   1992 Sep 22: Function of DIFF and PREFLARE keywords modified to specify
                linestyle.  LS keyword modified to not require PS keyword.
                (JdLB) [1.8.1]
   1992 Oct 05: ADJUST keyword modified to merely move the difference profile
                such that its minimum falls at 0. (JdLB) [1.8.2]
   1992 Oct 28: Adapted to plot an array of single pixel light curves
                (LWA)
   6-mar-95: (JMM) Added lc_oplot and tim_oplot keywords, stripped alot of stuff,
             OUT, an optional parameter is gone, IND, another output parameter
             which was always returned undefined, is gone, WAVE, an optional input
             is retained, but if it is not passed in, then the default is to plot
             vs. time as given by INDEX, instead of integers, the keyword ADJUST
             is gone, references to preflare data in the code, are gone, the
             corresponding keywords, DIFF, PFDATA, and PREFLARE had been
             removed in previos versions. The keyword BIN was defined, but it
             was designed to be used in a routine SUBIMG that is no longer on
             line, it still is here, and will result in rebinning the image.


LC_BSC $SSW/yohkoh/bcs/idl/bsc/lc_bsc.pro
[Previous] [Next]
 NAME:
       LC_BSC
 PURPOSE:
       plot BSC lightcurves of selected intervals
 CALLING SEQUENCE:
       LC_BSC,BSC_INDEX,BSC_DATA,CHAN=CHAN
 INPUTS:
       BSC_INDEX    - BSC index structure
       BSC_DATA     - BSC data structure
       CHAN         - channel to plot
 OUTPUTS:
       TIME         - data time array
       RATE         - lightcurve array
 CALLS: ***
	BSC_CHAN, BSC_CHECK [1], BSC_CHECK [2], GT_BSC_TIME, SEL_BSC, lsplot
 PROCEDURE:
       Calls LSPLOT
 HISTORY:
       Written, April'93 by D. Zarro (ARC)
       Modified, Feb'94, DMZ


LCBDA $SSW/yohkoh/bcs/idl/bda/lcbda.pro
[Previous] [Next]
 NAME:
 	LCBDA
 PURPOSE:
 	Plot out some or all of the light curves for the BCS channels
 CALLING SEQUENCE:  
	LCBDA,index [,chans=[2,3,4],psym=psym,charsize=charsize,/log,/landsc]
	LCBDA,index [,chans='2-3',.....]
 INPUTS:
	index	index (or roadmap) structure
 OPTIONAL INPUTS:
	chans	channels to be plotted (1=Fe XXV1, 2=Fe XXV, 3=Ca XIX, 4= SV)
		if more than one, specify as an array (e.g. [3,4] )
		OR 
		Specify as a string with regexp (e.g. '2-4', '*', '1,2') 
	psym 	plot symbol (default = 0)
	charsize Character size
	log  	keyword switch to turn on log plots
                 Only data greater than 1 are plotted, anything below
		  1 will be rounded up to 1, if log plot selected.
	landscape If plot device is ps then use landscape orientation

	obselete keyword
         bcs = [0,1,2,3] - array of values 0 = FeXXVI 
					    1 = FeXXV
					    2 = CaXIX
					    3 = SXV
	 OR 
	  bcs = '1,2,3,4' - string with regexp

 OUTPUTS:

 OPTIONAL OUTPUTS:

 CALLS: ***
	PS_LONG [1], PS_LONG [2], PS_LONG [3], PS_RESET [1], PS_RESET [2], PS_RESET [3]
	UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6], gt_blockid
	gt_total_cnts [1], gt_total_cnts [2], range
 RESTRICTIONS:

 PROCEDURE:
         Plot is produced, either on Xterminal (idl7) or to postscript.

 MODIFICATION HISTORY:
 	atp  27/3/92 	vn 0.3
	RDB  18-Jul-92	CHAN keyword, changed plot stuff
			used GT_BLOCKID
	atp  23/11/92   v 0.5 rationalised changes btween mssl isas
			cleaned up channel selection


lcbsd $SSW/yohkoh/bcs/idl/bsd/lcbsd.pro
[Previous] [Next]
 NAME:				lcbsd.pro

 PURPOSE:			plots the count rate in a bsd file, 
				as a function of time.

 CALLING SEQUENCE:		LCBSD[,bsdfilename][,channel='1,2,3',psym=4 $ 
				  spectra='1,2,3-4,*',/landscape,chars=1.6,/stack]  
				or

				LCBSD,bsd_index,bsd_data[,...etc...]

 INPUTS:			bsd filename - filename and path of a bsd file
				 if null then prompted for a wildcard search.

				or

				  bsd_index and data structures

 keywords:			channel - string, '1,2,3,4' or '1-3' etc 
				spectra - string, '1,2-40' (see Range.pro) 
				plot_page - plot all channels on one page
				quiet - eliminate extra info
				psym  - the plotsymbol
				stack - stack plots vertically (lcbda)
				landscape - if plot device is ps then
					use landscape orientation


 OUTPUTS:			plots to graphics devices

 OPTIONAL OUTPUTS:		none

 CALLS: ***
	BCS_GETFILE, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], OUTPLOT [1]
	OUTPLOT [2], OUTPLOT [3], PS_LONG [1], PS_LONG [2], PS_LONG [3], PS_RESET [1]
	PS_RESET [2], PS_RESET [3], RD_BSD_DATA, RD_BSD_HEADER, RD_BSD_RDMAP, UTPLOT [1]
	UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6], break_file [4]
	int2secarr [1], int2secarr [2], range
 CALLED BY:
	PLOTBSD v306 IDL2, plotbth v30 IDL2
 RESTRICTIONS:			use pprint.pro or site dependent equivalent 
				to printout postscript files.

 PROCEDURE:			read file, extr index section, plot light curve

 MODIFICATION HISTORY:
		author:        Andy Phillips , mssl 1991
		atp 14.7.92 atp v1.2 - new structures, use of utplot etc...


lchda $SSW/yohkoh/ucon/idl/phillips/lchda.pro
[Previous] [Next]
 pro lchda - plot out light curves for all hxt

 Author: atp - 27/3/1992 vn 0.3

 Purpose: Plot out some or all of the light curves for hxt 0-3 channels
          at a max time resolution of 2 seconds. (1 sample per major frame) 

 Calling Sequence:
         LCHDA,index[,hxt=[0,1,2,3],psym=psym,/log]
         
 Inputs:
         index - index structure

 Optional inputs:
         hxt = [0,1,2,3] - array of values 0 = low (15-24.4) KeV
					    1 = medium (24.4-35.2) KeV
					    2 = medium (35.2-56.8) KeV
					    3 = high   (56.8-100)  KeV

         psym = psym = plot symbol default = 0
         log  = keyword switch to turn on log plots
                 Only data greater than 1 are plotted, anything below
		  1 will be rounded up to 1, if log plot selected.

 Example:
         The default plot is equivalent to,
         lchda,index,hxt=[0,1,2,3]
          will plot all of the hxt channels 

 CALLS: ***
	UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6], gt_sum_h [1]
	gt_sum_h [2], gt_sum_l [1], gt_sum_l [2], gt_sum_m1 [1], gt_sum_m1 [2]
	gt_sum_m2 [1], gt_sum_m2 [2]
 Side Effects:
         Plot is produced, either on Xterminal (idl7) or to postscript.
         postscript plot is designed to fit on 8.5x11 paper.


lcobs $SSW/yohkoh/ucon/idl/phillips/lcobs.pro
[Previous] [Next]
 pro lcobs - plot out light curves for all bcs channels

 Author: atp - 27/11/1992 vn 0.01

 Purpose: Plot out some or all of the observing logs

 Calling Sequence:
         LCOBS[,bcs='1,2,3,4',wbs='1,2,3,4',psym=psym,win=win, - 
             start_time=[hh,mm,ss,msec,dd,mm,yy],dur=hours]
 Inputs:

 Optional inputs:
         bcs = '1,2,3,4' - string of values  1 = FeXXVI 
					      2 = FeXXV
					      3 = CaXIX
					      4 = SXV
	         Wild cards are allowed '-,*'

	  wbs = '1,2,3'   - string of values  1 = hxs 20-600 KeV
					      2 = sxsm 7.5-15 KeV
					      3 = sxsl 2.6-7.5 KeV
	
         psym = psym = plot symbol default = 3
         log  = keyword switch to turn on log plots
                 Only data greater than 1 are plotted, anything below
		  1 will be rounded up to 1, if log plot selected.

 Example:
         The default plot is equivalent to,
         lcobs,bcs='3',wbs='1'
          will plot all of the bcs channels 

 CALLS: ***
	HXT_DECOMP, PS_LONG [1], PS_LONG [2], PS_LONG [3], UTPLOT [1], UTPLOT [2]
	UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6], gt_blockid, gt_total_cnts [1]
	gt_total_cnts [2], range, rd_obs
 Side Effects:
         Plot is produced, either on Xterminal (idl7) or to postscript.
         postscript plot is designed to fit on 8.5x11 paper.


lcwda $SSW/yohkoh/ucon/idl/phillips/lcwda.pro
[Previous] [Next]
 pro lcwda - plot out light curves for all wbs data hxs,sxs1,sxs2

 Author: atp - 24/3/1992 vn 0.2

 Purpose: Plot out some or all of the WBS light curves for HXS,SXS-1.SXS-2

 Calling Sequence:
         LCWDA,index,data[,hxs=[0,1],sxs1=[0,1],sxs2=[0,1],psym=psym]
         
 Inputs:
         index - index structure
         data  - wbs data structure
 Optional inputs:
         hxs = [0,1] - array of values 0 = hxs_pc1, 1 = hxs_pc2
         sxs1 = [0,1]- array of values 0 = sxs_pc11, 1 = hxs_pc21
         sxs2 = [0,1]- array of values 0 = sxs_pc12, 1 = hxs_pc22
         psym = psym = plot symbol default = 0
 Example:
         The default plot is equivalent to,
         lcwda,index,data,hxs=[0,1],sxs1=[0],sxs2=[0]
          will plot hxs_pc1, hxs_pc2, sxs_pc11, sxs_pc12

 CALLS: ***
	HXT_DECOMP, SUMROW [1], SUMROW [2], SUMROW [3], UTPLOT [1], UTPLOT [2], UTPLOT [3]
	UTPLOT [4], UTPLOT [5], UTPLOT [6]
 Side Effects:
         Plot is produced, either on Xterminal (idl7) or to postscript.
         postscript plot is designed to fit on 8.5x11 paper.

 History:
	
 Author: atp - 24/3/1992 vn 0.1
	  atp - 2/7/1992  vn 0.2 - fixed factor of 100 off.


leak_sub [1] $SSW/yohkoh/gen/galileo/idl/lmsal/leak_sub.pro
[Previous] [Next]
NAME:
	leak_sub
PURPOSE:
	Subtract the Scattered light image from input FFI images.  This is
	needed for Thin-Al and AlMg images taken after 13-Nov-92. 
CALLING SEQUENCE:
	data_out = leak_sub(index, data, index_out)
	data_out = leak_sub(index, data, /update_index)
INPUT:
	index	- The index structure for each image
	data	- The data array (NX x NY x N).  It should have had the
		  dark current already subtracted.  If the input is
		  byte type, then DARK_SUB is called.
OUTPUT:
	data_out- The leak (scattered light) subtracted image
	index_out- The modified index header
 CALLS: ***
	BOX_MESSAGE, DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], dark_sub [1]
	dark_sub [2], dark_sub [3], data_type [1], data_type [2], delvarx [5], fmt_tim [1]
	fmt_tim [2], get_leak_image [1], get_leak_image [2], get_leak_image [3]
	get_logenv [1], get_logenv [2], gt_corner, gt_expdur [1], gt_expdur [2], gt_filta
	gt_filtb, gt_pfi_ffi, gt_res, gt_shape, his_index, int2secarr [1], int2secarr [2]
	mk_syn_sfc [1], mk_syn_sfc [2], sel_leak_image [1], sel_leak_image [2]
	sel_leak_image [3], sel_leak_image [4], ssw_deltat, sxt_deleak [1]
	sxt_deleak [2], sxt_get_grill [1], sxt_get_grill [2]
 CALLED BY:
	RD_AR, SXT_PREP0, mk_sfd [1], mk_sfd [2], mk_sfd [3], mk_sfd [4], sacpeak_image
	sxt_prep [1], sxt_prep [2], sxt_prep [3]
OPTIONAL KEYWORD INPUT:
       udata_in - the uncertainty in the data array, passed through to DARK_SUB
       udata_out(INPUT/OUTPUT) - The uncertainty in the output array, passed out of DARK_SUB,
                   This must be set to a variable before the call, i.e.
                   YOU (the user) have a statement like "udata_out=1"
                   before calling LEAK_SUB with the udata_out keyword, the calculation
                   will not be done if a zero or undefined value is passed in.
                   Note that leak_only data "officially" has no uncertainty,
                   So don't use this with the leak_only keyword, you will get an array of zeros
	leak_only- If set, the output is only the scattered light
		  images that go with each index.
	save	- If set, store the data in a common block to avoid 
		  having to read it from memory many times.
	dc_interpolate - If set, do integration time interpolation on
		  the dark current subtraction images.
	dc_scalar - If set, use a scalar value for the dark current
		  subtraction
	force_darksub - If set, then call DARK_SUB even if the data type 
		  is non-byte.  This is needed with restore low-8 data.
       noleak - if set, subtrace leak(!) (seems silly in a routine called
                leak_sub, but needed for leak bybass from callers
                like sxt_prep...)
       synthetic_sfc - if set, generate and apply synthetic SFC
                       [ hook for P.G.Shirts routines ]
       force_standard_sfc - if set, override synthetic_sfc keyword 
                            and environmental (used for recursive calls
                            when synthetic SFC not available or invalid
       loud - if set, print some ~useless albeit historical info

OPTIONAL KEYWORD OUTPUT:
	leak_index- Return the index of the reference images
METHOD:
	1. Call DARK_SUB if "data" is byte type
	2. For PFI, extract the relevant portion of the images
	3. Scale the scattered light image for exposure duration.
	4. Subtract off the scattered light
HISTORY:
	Written 7-Jan-93 by M.Morrison
	14-Jan-93 (MDM) - Modification to perform leak subtraction 
			  properly for quarter resolution images.
	 3-Feb-93 (MDM) - Modified to correct AlMg leak images also.
			- Added /SAVE option to store the leak image
			  in a common block - avoids reading it multiple
			  times, but uses memory up.
	 9-mar-93 (JRL) - Fixed a bug in case no leak images are available.
	 7-Apr-93 (MDM) - Modified to work with PFI images
			  Adjusted code to do REBIN only once per uniq resolution
			  (faster/more memory efficient)
			- Added check to see if leak calibration images exist.
			- Corrected an error that leak subtraction would not
			  have been performed if the neutral density filter was
			  in place!!
V2.0	 6-Jun-93 (MDM) - Added version number, and started calls to HIS_INDEX
V2.1	 9-Jul-93 (MDM) - Corrected an error caused when a smaller image is 
			  imbedded in a larger array (256x256 inside a 512x512xN)
V2.11	 3-Aug-93 (MDM) - Modification for handling unassembled ORs
V3.00	 4-Aug-93 (MDM) - Modified to use EXT_SUBIMG2 which is much faster than
			  rebinning the whole image.
			- Added INDEX_OUT parameter
			- Do not do a "fix" of data when it is non-byte type
			  when creating the DATA_OUT variable
V3.01	26-Aug-93 (MDM) - Modified to use ALIGN1IMG instead of EXT_SUBIMG2
			- Added /UPDATE_INDEX option
	26-Aug-93 (MDM) - Replaced Al.1 image sfc921127.0947 with sfc930819.1607
				** V3.xx was never put on-line **
V4.00	27-Aug-93 (MDM) - Replaced code with the essence of DARK_SUB
V4.01  11-Oct-93 (MDM) - Made sure that the output index was passed to 
			  HIS_INDEX so that the .HIS structure was appended
V4.02	13-Oct-93 (MDM) - Added /DC_INTERPOLATE and /DC_SCALAR options
			- Adjusted code since the DARK_SUB history was not being
			  preserved
V4.03	 8-Feb-95 (MDM) - Added /FLOAT keyword to be passed through to DARK_SUB
	12-Feb-95 (jmm) - Added the UDATA keywords
V4.04	27-Feb-95 (MDM) - Put McTiernan modifications on-line
V4.05	23-Mar-95 (MDM) - Added /force_darksub
V4.06	 9-May-95 (MDM) - Modified how the /FLOAT option worked (it was always
			  doing a FIX before on the leak image).
			- Use ROUND instead of FIX when not going to floating
			  output
V4.07   11-Feb-98 (SLF) - add ORBIT_CORRECT (pass to dark_sub)
        26-Oct-98 (SLF) - add /NOLEAK keyword and function
V4.08   10-Jan-2000 - S.L.Freeland add /SECOND_ORDER keyword and function
                      Add history bit
V4.09   23-Aug-2000 - Add /SYNTHETIC_SFC keyword and function
                      Add history bit
V4.10    8-Jan-2001 - S.L.Freeland - add Al.1 Grill correction option
                      (no longer applied to SFCs)
V4.20   13-Nov-2001 - S.L.Freeland - remove a call to 'fix' - why it
                      was there at all is TBD (ask mons...)
V4.21   14-Jan-2002 - S.L.Freeland - add /FORCE_STANDARD_SFC 
V4.22    7-Mar-2003 - S.L.Freeland - add /LOUD and made default quieter
V4.23   30-May-2003 - S.L.Freeland - merge LWA Long Word Overflow fix
                                     (val=...) per Oct 16 2002 email
V5.0    24-Jul-2003 - S.L.Freeland - do grill correction for both synthetic
                                     and standard in same place  
V5.1    21-Jan-2005 - S.L.Freeland - avoid global side affect with 
                                     SYNTHETIC_SFC (possible cube processing
                                     problem with toggle during recursion)
V5.2    28-Jan-2005 - S.L.Freeland - continue Syn Vs Term mods - fix
                                     logic flaw introduced in 28-jan-mod
V5.3     2-Feb-2005 - S.L.Freeland - fixed typo...
V5.4    21-Jan-2005 - L. W. Acton  - Added code to handle early and late
                      straylight drifts.
 		       Boxmessage, 'Synthetic requested but ...' only for /loud. 
	 28-Mar-2005 - LWA - Commented out early straylight drift commands.
	 18-May-2006 - LWA - Removed . in 2^15. to make compatible with
			IDL 6+ on linux machines.


leak_sub [2] $SSW/yohkoh/sxt/idl/atest/leak_sub.pro
[Previous] [Next]
NAME:
	leak_sub
PURPOSE:
	Subtract the Scattered light image from input FFI images.  This is
	needed for Thin-Al and AlMg images taken after 13-Nov-92. 
CALLING SEQUENCE:
	data_out = leak_sub(index, data, index_out)
	data_out = leak_sub(index, data, /update_index)
INPUT:
	index	- The index structure for each image
	data	- The data array (NX x NY x N).  It should have had the
		  dark current already subtracted.  If the input is
		  byte type, then DARK_SUB is called.
OUTPUT:
	data_out- The leak (scattered light) subtracted image
	index_out- The modified index header
 CALLS: ***
	BOX_MESSAGE, DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], dark_sub [1]
	dark_sub [2], dark_sub [3], data_type [1], data_type [2], delvarx [5], fmt_tim [1]
	fmt_tim [2], get_leak_image [1], get_leak_image [2], get_leak_image [3]
	get_logenv [1], get_logenv [2], gt_corner, gt_expdur [1], gt_expdur [2], gt_filta
	gt_filtb, gt_pfi_ffi, gt_res, gt_shape, his_index, int2secarr [1], int2secarr [2]
	mk_syn_sfc [1], mk_syn_sfc [2], sel_leak_image [1], sel_leak_image [2]
	sel_leak_image [3], sel_leak_image [4], ssw_deltat, sxt_deleak [1]
	sxt_deleak [2], sxt_get_grill [1], sxt_get_grill [2]
 CALLED BY:
	RD_AR, SXT_PREP0, mk_sfd [1], mk_sfd [2], mk_sfd [3], mk_sfd [4], sacpeak_image
	sxt_prep [1], sxt_prep [2], sxt_prep [3]
OPTIONAL KEYWORD INPUT:
       udata_in - the uncertainty in the data array, passed through to DARK_SUB
       udata_out(INPUT/OUTPUT) - The uncertainty in the output array, passed out of DARK_SUB,
                   This must be set to a variable before the call, i.e.
                   YOU (the user) have a statement like "udata_out=1"
                   before calling LEAK_SUB with the udata_out keyword, the calculation
                   will not be done if a zero or undefined value is passed in.
                   Note that leak_only data "officially" has no uncertainty,
                   So don't use this with the leak_only keyword, you will get an array of zeros
	leak_only- If set, the output is only the scattered light
		  images that go with each index.
	save	- If set, store the data in a common block to avoid 
		  having to read it from memory many times.
	dc_interpolate - If set, do integration time interpolation on
		  the dark current subtraction images.
	dc_scalar - If set, use a scalar value for the dark current
		  subtraction
	force_darksub - If set, then call DARK_SUB even if the data type 
		  is non-byte.  This is needed with restore low-8 data.
       noleak - if set, subtrace leak(!) (seems silly in a routine called
                leak_sub, but needed for leak bybass from callers
                like sxt_prep...)
       synthetic_sfc - if set, generate and apply synthetic SFC
                       [ hook for P.G.Shirts routines ]
       force_standard_sfc - if set, override synthetic_sfc keyword 
                            and environmental (used for recursive calls
                            when synthetic SFC not available or invalid
       loud - if set, print some ~useless albeit historical info

OPTIONAL KEYWORD OUTPUT:
	leak_index- Return the index of the reference images
METHOD:
	1. Call DARK_SUB if "data" is byte type
	2. For PFI, extract the relevant portion of the images
	3. Scale the scattered light image for exposure duration.
	4. Subtract off the scattered light
HISTORY:
	Written 7-Jan-93 by M.Morrison
	14-Jan-93 (MDM) - Modification to perform leak subtraction 
			  properly for quarter resolution images.
	 3-Feb-93 (MDM) - Modified to correct AlMg leak images also.
			- Added /SAVE option to store the leak image
			  in a common block - avoids reading it multiple
			  times, but uses memory up.
	 9-mar-93 (JRL) - Fixed a bug in case no leak images are available.
	 7-Apr-93 (MDM) - Modified to work with PFI images
			  Adjusted code to do REBIN only once per uniq resolution
			  (faster/more memory efficient)
			- Added check to see if leak calibration images exist.
			- Corrected an error that leak subtraction would not
			  have been performed if the neutral density filter was
			  in place!!
V2.0	 6-Jun-93 (MDM) - Added version number, and started calls to HIS_INDEX
V2.1	 9-Jul-93 (MDM) - Corrected an error caused when a smaller image is 
			  imbedded in a larger array (256x256 inside a 512x512xN)
V2.11	 3-Aug-93 (MDM) - Modification for handling unassembled ORs
V3.00	 4-Aug-93 (MDM) - Modified to use EXT_SUBIMG2 which is much faster than
			  rebinning the whole image.
			- Added INDEX_OUT parameter
			- Do not do a "fix" of data when it is non-byte type
			  when creating the DATA_OUT variable
V3.01	26-Aug-93 (MDM) - Modified to use ALIGN1IMG instead of EXT_SUBIMG2
			- Added /UPDATE_INDEX option
	26-Aug-93 (MDM) - Replaced Al.1 image sfc921127.0947 with sfc930819.1607
				** V3.xx was never put on-line **
V4.00	27-Aug-93 (MDM) - Replaced code with the essence of DARK_SUB
V4.01  11-Oct-93 (MDM) - Made sure that the output index was passed to 
			  HIS_INDEX so that the .HIS structure was appended
V4.02	13-Oct-93 (MDM) - Added /DC_INTERPOLATE and /DC_SCALAR options
			- Adjusted code since the DARK_SUB history was not being
			  preserved
V4.03	 8-Feb-95 (MDM) - Added /FLOAT keyword to be passed through to DARK_SUB
	12-Feb-95 (jmm) - Added the UDATA keywords
V4.04	27-Feb-95 (MDM) - Put McTiernan modifications on-line
V4.05	23-Mar-95 (MDM) - Added /force_darksub
V4.06	 9-May-95 (MDM) - Modified how the /FLOAT option worked (it was always
			  doing a FIX before on the leak image).
			- Use ROUND instead of FIX when not going to floating
			  output
V4.07   11-Feb-98 (SLF) - add ORBIT_CORRECT (pass to dark_sub)
        26-Oct-98 (SLF) - add /NOLEAK keyword and function
V4.08   10-Jan-2000 - S.L.Freeland add /SECOND_ORDER keyword and function
                      Add history bit
V4.09   23-Aug-2000 - Add /SYNTHETIC_SFC keyword and function
                      Add history bit
V4.10    8-Jan-2001 - S.L.Freeland - add Al.1 Grill correction option
                      (no longer applied to SFCs)
V4.20   13-Nov-2001 - S.L.Freeland - remove a call to 'fix' - why it
                      was there at all is TBD (ask mons...)
V4.21   14-Jan-2002 - S.L.Freeland - add /FORCE_STANDARD_SFC 
V4.22    7-Mar-2003 - S.L.Freeland - add /LOUD and made default quieter
V4.23   30-May-2003 - S.L.Freeland - merge LWA Long Word Overflow fix
                                     (val=...) per Oct 16 2002 email
V5.0    24-Jul-2003 - S.L.Freeland - do grill correction for both synthetic
                                     and standard in same place  


leak_sub [3] $SSW/yohkoh/sxt/idl/util/leak_sub.pro
[Previous] [Next]
NAME:
	leak_sub
PURPOSE:
	Subtract the Scattered light image from input FFI images.  This is
	needed for Thin-Al and AlMg images taken after 13-Nov-92. 
CALLING SEQUENCE:
	data_out = leak_sub(index, data, index_out)
	data_out = leak_sub(index, data, /update_index)
INPUT:
	index	- The index structure for each image
	data	- The data array (NX x NY x N).  It should have had the
		  dark current already subtracted.  If the input is
		  byte type, then DARK_SUB is called.
OUTPUT:
	data_out- The leak (scattered light) subtracted image
	index_out- The modified index header
 CALLS: ***
	BOX_MESSAGE, DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], dark_sub [1]
	dark_sub [2], dark_sub [3], data_type [1], data_type [2], delvarx [5], fmt_tim [1]
	fmt_tim [2], get_leak_image [1], get_leak_image [2], get_leak_image [3]
	get_logenv [1], get_logenv [2], gt_corner, gt_expdur [1], gt_expdur [2], gt_filta
	gt_filtb, gt_pfi_ffi, gt_res, gt_shape, his_index, int2secarr [1], int2secarr [2]
	mk_syn_sfc [1], mk_syn_sfc [2], sel_leak_image [1], sel_leak_image [2]
	sel_leak_image [3], sel_leak_image [4], ssw_deltat, sxt_deleak [1]
	sxt_deleak [2], sxt_get_grill [1], sxt_get_grill [2]
 CALLED BY:
	RD_AR, SXT_PREP0, mk_sfd [1], mk_sfd [2], mk_sfd [3], mk_sfd [4], sacpeak_image
	sxt_prep [1], sxt_prep [2], sxt_prep [3]
OPTIONAL KEYWORD INPUT:
       udata_in - the uncertainty in the data array, passed through to DARK_SUB
       udata_out(INPUT/OUTPUT) - The uncertainty in the output array, passed out of DARK_SUB,
                   This must be set to a variable before the call, i.e.
                   YOU (the user) have a statement like "udata_out=1"
                   before calling LEAK_SUB with the udata_out keyword, the calculation
                   will not be done if a zero or undefined value is passed in.
                   Note that leak_only data "officially" has no uncertainty,
                   So don't use this with the leak_only keyword, you will get an array of zeros
	leak_only- If set, the output is only the scattered light
		  images that go with each index.
	save	- If set, store the data in a common block to avoid 
		  having to read it from memory many times.
	dc_interpolate - If set, do integration time interpolation on
		  the dark current subtraction images.
	dc_scalar - If set, use a scalar value for the dark current
		  subtraction
	force_darksub - If set, then call DARK_SUB even if the data type 
		  is non-byte.  This is needed with restore low-8 data.
OPTIONAL KEYWORD OUTPUT:
	leak_index- Return the index of the reference images
METHOD:
	1. Call DARK_SUB if "data" is byte type
	2. For PFI, extract the relevant portion of the images
	3. Scale the scattered light image for exposure duration.
	4. Subtract off the scattered light
HISTORY:
	Written 7-Jan-93 by M.Morrison
	14-Jan-93 (MDM) - Modification to perform leak subtraction 
			  properly for quarter resolution images.
	 3-Feb-93 (MDM) - Modified to correct AlMg leak images also.
			- Added /SAVE option to store the leak image
			  in a common block - avoids reading it multiple
			  times, but uses memory up.
	 9-mar-93 (JRL) - Fixed a bug in case no leak images are available.
	 7-Apr-93 (MDM) - Modified to work with PFI images
			  Adjusted code to do REBIN only once per uniq resolution
			  (faster/more memory efficient)
			- Added check to see if leak calibration images exist.
			- Corrected an error that leak subtraction would not
			  have been performed if the neutral density filter was
			  in place!!
V2.0	 6-Jun-93 (MDM) - Added version number, and started calls to HIS_INDEX
V2.1	 9-Jul-93 (MDM) - Corrected an error caused when a smaller image is 
			  imbedded in a larger array (256x256 inside a 512x512xN)
V2.11	 3-Aug-93 (MDM) - Modification for handling unassembled ORs
V3.00	 4-Aug-93 (MDM) - Modified to use EXT_SUBIMG2 which is much faster than
			  rebinning the whole image.
			- Added INDEX_OUT parameter
			- Do not do a "fix" of data when it is non-byte type
			  when creating the DATA_OUT variable
V3.01	26-Aug-93 (MDM) - Modified to use ALIGN1IMG instead of EXT_SUBIMG2
			- Added /UPDATE_INDEX option
	26-Aug-93 (MDM) - Replaced Al.1 image sfc921127.0947 with sfc930819.1607
				** V3.xx was never put on-line **
V4.00	27-Aug-93 (MDM) - Replaced code with the essence of DARK_SUB
V4.01  11-Oct-93 (MDM) - Made sure that the output index was passed to 
			  HIS_INDEX so that the .HIS structure was appended
V4.02	13-Oct-93 (MDM) - Added /DC_INTERPOLATE and /DC_SCALAR options
			- Adjusted code since the DARK_SUB history was not being
			  preserved
V4.03	 8-Feb-95 (MDM) - Added /FLOAT keyword to be passed through to DARK_SUB
	12-Feb-95 (jmm) - Added the UDATA keywords
V4.04	27-Feb-95 (MDM) - Put McTiernan modifications on-line
V4.05	23-Mar-95 (MDM) - Added /force_darksub
V4.06	 9-May-95 (MDM) - Modified how the /FLOAT option worked (it was always
			  doing a FIX before on the leak image).
			- Use ROUND instead of FIX when not going to floating
			  output


leap_yr $SSW/yohkoh/ucon/idl/mctiernan/leap_yr.pro
[Previous] [Next]
 NAME:
       leap_yr
 CALLING SEQUENCE:
       lyr=leap_yr(iyr,century=century,molim=molim)
 PURPOSE:
       Determines whether a given year is a leap year, and
       returns the number of the first day of every month - 1
 INPUT:
       iyr= The year, as an integer, if the year is less than 100,
       It's assumed to be in the 20th century, if you need a
       year in the first century, use the century keyword.
       iyr may be an array. 
 OUTPUT:
       lyr= 1 if iyr is a leap year and 0 if not
 KEYWORDS:
       molim= the number you add the day of month to to obtain
              the day of the year,
       molim= [0,31,60,91,121,152,182,213,244,274,305,335] for leap years
       and  = [0,31,59,90,120,151,181,212,243,273,304,334] in general.
       century= The century you want, remember to add 1, the 1500's are the
                16th century, in order to obtain the 1st century, use
                century=1. Negative centuries are not allowed!
                And century overrides any numbers gt 100 in iyr.
                The first year in the century is considered to be the 00 year,
                which is the way it should be...
 CALLED BY:
	DAYOFYR [1], dayofyr [2], doydom, mk_daily_ints
 HISTORY:
       Written 19-OCt-93 by JM


lfit $SSW/yohkoh/ucon/idl/mctiernan/lfit.pro
[Previous] [Next]
 NAME:
	lfit
 CALLING SEQUENCE:
	Lfit,y,s2,x,ax
 PURPOSE:
	This should do a linear least squares fit, see 
	Numerical recipies, eqs. 14.2.15 to 14.2.18, 
 INPUT:
	y=obs data, 
	s2=unc. squared
	x=energies, 
 OUTPUT:
	ax, where f=a(0)+a(1)*x is fit to y
 CALLED BY:
	Ai_1pl, Ai_1pl_ecut, Ai_plppl, Break, Break2, Lfit_3 [1], Lfit_3 [2], lfit_2 [1]
	lfit_2 [2]
 HISTORY:
	Writtrn Spring '92 by JMCT


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

   Purpose: return indices for 1 reformatted file using stripped out
	     limits map from fnmap (ie. get_fninfo called previously)

   History: slf, 10/14/91


LIMB2DISK $SSW/yohkoh/ucon/idl/hudson/limb2disk.pro
[Previous] [Next]
 NAME:
     LIMB2DISK
 PURPOSE:
     rotate limb position (rr, pa) in the plane of the sky to
       a given location following differential rotation through
       a specified time. 
 CATEGORY:
     Yohkoh
 CALLING SEQUENCE:
     xy = limb2disk(deltat, rr, pa)
 INPUTS:
     deltat in days
     radial distance from sun center (R_o) and 
     position angle (degrees; W is 270)
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
 CALLS: ***
	DIFF_ROT [1], DIFF_ROT [2], get_rb0p [1], get_rb0p [2]
 CALLED BY:
	PROM_ON_DISK
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     24-nov-97 written (HSH)


limb_survey $SSW/yohkoh/ucon/idl/hudson/limb_survey.pro
[Previous] [Next]
 NAME:
	limb_survey.pro
 PURPOSE:
	find over-the-limb flares
 CATEGORY:
	Yohkoh
 CALLING SEQUENCE:
	.run
 MODIFICATION HISTORY:
	HSH, written 26-Jul-93


limb_thresh $SSW/yohkoh/ucon/idl/labonte/limb_thresh.pro
[Previous] [Next]
 IDL routine to find the limb from an intensity threshold
 Assumes image shows small field-of-view, only search
 one axis in one direction

PRO limb_thresh,image, thresh, naxis, ndirec, pos

 Input:
	image =  2-d array of image values
	thresh = threshold value
	naxis = number of axis to scan, 1 or 2
	ndirec = direction to scan, +/-1 => increasing/decreasing
 Output:
	pos = position of limb, vector; = -1. if limb not found 

	Plan is to scan out toward sky, find last place brighter
	than threshold.  Then go back and linearly interpolate to
	the exact location where threshold was crossed.

	Written April 1993  Barry LaBonte


LIMB_TRACE $SSW/yohkoh/ucon/idl/hudson/limb_trace.pro
[Previous] [Next]
 NAME:
       LIMB_TRACE
 PURPOSE:
	overplot the limb position found by FIND_LIMB (or any lesser
	program that returns (x,y,r)  
 CALLING SEQUENCE:
       limb_trace, x, y, r, two=two
 	if keyword two is set, the parameters are divided by two
 INPUTS:
       x, y, r from FIND_LIMB 
 KEYWORDS
	two
	thick
	linestyle
 OUTPUTS:
	circular line on plot
 MODIFICATION HISTORY
       HSH Sep. 1991
       Added /two keyword, Aug. 1992
	HSH, added more keywords Nov. 1993
	KR, added more keywords Jan. 1994
 CALLED BY
	PROTRACTOR


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


       PURPOSE: Find limb points for spectral images

       METHOD:  Take estimated center and take rays of points.
		 Call CUT_LEV to estimate background and subtract. Take 
		 first non-zero values as the limb. 
		 When there are spurious points, either inside or outside
		 the limb they are left out. If there are many increasing NP is 
		 recomemended. Adjusting them tended to through of the ellipse 
		 fitter.
		 When the limb is cropped, points on the image edge are not 
		 returned.

       CALLING SEQUENCE: limb=limbpnts(solar,cent,np,/quiet)


       PARAMETERS:	solar	input image
			cent	estimated image centroid
			np	number of points to select
			limb	limb points returned in [x,y] form. 
 CALLS: ***
	coord_l2v, coord_v2l, cut_lev
 CALLED BY:
	DSK_LOCG
				NOTE: this is not necessarily the same number as NP.

	KEYWORDS:	quiet	when NOT set display image and points

       HISTORY:	drafted by A.McAllister nov. 1993
			corrected the limb search to come in from the outside, AMcA, mar. 1995
			reworked to compare inward and outward sweeps, remove mismatches, AMcA, apr. 1996
			changed to leave out cropped points, AMcA, apr. 1996.

	CAUTION:  	This new version should be checked on various data.


LINCOL $SSW/yohkoh/ucon/idl/bentley/lincol.pro
[Previous] [Next]
 NAME:
	LINCOL
 PURPOSE:
	Sets a distinct pattern of colors in values 0-15 for line plots
 CALLING SEQUENCE:  
	lincol
 INPUTS:
	none
 OUTPUTS:
	none
 SIDE EFFECTS
	Changes current color table, loading bottom 16 values
	Reset using LOADCT
 CALLED BY:
	OBS_PLOT
 RESTRICTIONS:

 PROCEDURE:
	Uses TVLCT to load bottom 16 locations of table
 MODIFICATION HISTORY:
	RDB  21-Jun-94	Written, based on SDAC routine


LINE [1] $SSW/yohkoh/sxt/idl/util/plot_sxt_vig.pro
[Previous] [Next]
 NAME:
	LINE
 PURPOSE:
	Evaluate a function of a cone-shaped and optionally
	return the value of its partial derivatives.
	This function is used by CURVEFITA to fit this function and
	a constant background to the data.

	The routine CURVEFIT as supplied as an IDL user function has
	been modified by Jim Lemen and subsequently by Rich Fuller
       to compute a surface based on a singular dependent value, R,
   	with an input of X and Y coordinates.

 CATEGORY:
	E2 - SURFACE FITTING.
 CALLING SEQUENCE:
	FUNCTA,X,A,F,PDER
 INPUTS:
	A = PARAMETERS OF EQUATION DESCRIBED BELOW.
 OUTPUTS:
	F = VALUE OF FUNCTION AT EACH R(I).

 OPTIONAL OUTPUT PARAMETERS:
	PDER = (N_ELEMENTS(X),N_ELEMENTS(Y),4) ARRAY CONTAINING THE
		PARTIAL DERIVATIVES.  P(I,J,K) = DERIVATIVE
		AT ITH and JTH POINTS W/RESPECT TO KTH PARAMETER.
 COMMON BLOCKS:
	NONE.
 SIDE EFFECTS:
	NONE.
 RESTRICTIONS:
	NONE.
 PROCEDURE:
       F = A(2) + A(3)*R
       R ===>  given (3/23/93, RAF)
 MODIFICATION HISTORY:
       Written by R. Fuller, July 1992
       Updated by R. Fuller, Jan 1993
       Changed to input R directly by R Fuller, March 1993


line [2] $SSW/yohkoh/ucon/idl/acton/line.pro
[Previous] [Next]
 NAME:
	line
 PURPOSE
	Draw a straight line on a window between 2 cursor clicked points
         Printed coordinates will be in image coordinates.
	  Plot is done in device coorinates.
 CALLING SEQUENCE
	line [, bin=bin, color=color]
 OPTIONAL KEYWORD INPUT
	bin - rebin factor
 HISTORY
	LWA  22-JUN-94


LINE_RESET $SSW/yohkoh/ucon/idl/hudson/line_reset.pro
[Previous] [Next]
 NAME:
        LINE_RESET 
 PURPOSE:
        Add increments of 256 counts to data in order to compensate
        for "low eight bit syndrome". Uses the simplest possible
	 algorithm of next-neighbor comparison.
 CATEGORY:
        Yohkoh analysis 
 CALLING SEQUENCE:
	 line_reset, line_in, line_out
 OUTPUTS:
 CALLED BY:
	CUBE_FILL
 MODIFICATION HISTORY:
        HSH, Nov 1991


LINE_TRACE $SSW/yohkoh/ucon/idl/hudson/line_trace.pro
[Previous] [Next]
 NAME:
       LINE_TRACE
 PURPOSE:
	overplot a line on an image
 CALLING SEQUENCE:
       line_trace, x1, x2, y1, y2
 INPUTS:
       x, y in device coordinates 
 OUTPUTS:
	line on plot
 MODIFICATION HISTORY
       HSH Aug. 1993


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

 PURPOSE
  Do a 

 CALLING SEQUENCE
  lineofsight,model=model,/with,flux,rr,wi2,wi3

 INPUT
  model : 1 = Polar Coronal Hole at Solar Max 
        : 3 = Polar Coronal Hole at for Solar Min 
        : 2 = Equatorial Coronal Hole at for Solar Min
        : 0 = Quiet Corona - Temperatures inconsistent with SXT observations

  temp  : temp (MK)
  min_dist : Minimum radial extent of the coronal hole in solar radii

 OUTPUT
 flux :     The sxt flux in DN/sec/half res pixel, for the Al and 
            Dagwood filters. SXT_FLUX(0,*) is the Al filter each element 
            is for 0.01 Solar Radii, in the range 0-10 solar radii.
            To plot results use rad=dindgen(1000)/100d and then
            plot,rad,fl(0,*),ys=1,xr=[0.5,1.5],xs=1
            oplot,rad,fl(1,*),linestyle=1

 OPTIONAL OUTPUT
  none
 OPTIONAL KEYWORD INPUT
  none	
 RESTRICTION
  none
 HISTORY
 22 April 97 Carl Foley
 CALLS:


lineofsight [2] $SSW/yohkoh/ucon/idl/foley/lineofsight1.pro
[Previous] [Next]
 NAME:
  lineofsight

 PURPOSE
  Do a 

 CALLING SEQUENCE
  lineofsight,model=model,/with,flux,rr,wi2,wi3

 INPUT
  model : 1 = Polar Coronal Hole at Solar Max 
        : 3 = Polar Coronal Hole at for Solar Min 
        : 2 = Equatorial Coronal Hole at for Solar Min
        : 0 = Quiet Corona - Temperatures inconsistent with SXT observations

  temp  : temp (MK)
  min_dist : Minimum radial extent of the coronal hole in solar radii

 OUTPUT
 flux :     The sxt flux in DN/sec/half res pixel, for the Al and 
            Dagwood filters. SXT_FLUX(0,*) is the Al filter each element 
            is for 0.01 Solar Radii, in the range 0-10 solar radii.
            To plot results use rad=dindgen(1000)/100d and then
            plot,rad,fl(0,*),ys=1,xr=[0.5,1.5],xs=1
            oplot,rad,fl(1,*),linestyle=1

 OPTIONAL OUTPUT
  none
 OPTIONAL KEYWORD INPUT
  none	
 RESTRICTION
  none
 HISTORY
 22 April 97 Carl Foley
 CALLS:


linflx [2] $SSW/yohkoh/gen/idl/spectra/linflx.pro
[Previous] [Next]
  NAME:
   linflx
  PURPOSE:
   Compute the Mewe line spectrum for EM=1.e44 cm^-3
  CALLING SEQUENCE:
    linflx,Te6,wave,Flux               ; ph s-1
    linflx,Te6,wave,Flux,/photon       ; ph s-1
    linflx,Te6,wave,Flux,/erg          ; erg s-1
    linflx,Te6,wave,Flux,wave_range=wave_range
    linflx,Te6,wave,Flux,/cosmic	; Use cosmic abudances
    linflx,Te6,wave,Flux,Line,Trans	; Return line information

  INPUTS:
    Te6        = Electron Temperature in MK
  OUTPUTS:
    wave       = Wavelengths of lines
    Flux       = Fluxes of lines.  If Te6 is
                 a vector, then Flux = fltarr(N_elements(Te6),N_elements(wave))
  OPTIONAL INPUT KEYWORDS:
    photon     = If set, calculation is made in ph s-1 (default)
    erg        = If set, calculation is made in erg s-1
    wave_range = A 2-element vector with the desired lower and upper wavelength
                 limits (Ang).  For example, wave_range = [2.,60.] will 
                 calculate only those lines between 2 and 60 A.
    cosmic	= If set, read the cosmic abundance file
    file_in	= To explicitly specify the Mewe line-list file.
  OPTIONAL OUTPUTS:
    Line	= Character string with ion information
    Trans	= Character string with transition informaiton
  OPTIONAL OUTPUT KEYWORDS:
    Abun	= Abundances used for calculation
    elem	= Elements corresponding to the abundances

  METHOD:
    Reads $DIR_SXT_SENSITIVE/mewe_solar.genx
       or $DIR_SXT_SENSITIVE/mewe_cosmic.genx if /cosmic switch is specified.

 CALLS: ***
	DOC_LIBRARY, DSPLINE, INTERPOL, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
	PICKLAMBDA [1], PICKLAMBDA [2], SPLINE, restgen [1], restgen [2]
 CALLED BY:
	mewe_spec  mewe_spec_lwa, mewe_spec [1], mewe_spec [2]
    Note:  	If Line argument is present, then picklambda is not called
       	to sum up lines at the same wavelength

  MODIFICATION HISTORY:
    29-oct-92, Written, J. R. Lemen, LPARL
    25-jan-93, JRL  -- change call to picklambda
    25-feb-93, JRL  -- Mewe file converted to genx file.
     8-apr-93, JRL  -- Added optional output parameter
     7-jul-93, JRL  -- Added file_in keyword
    18-may-94, JRL  -- Fixed up check to prevent unnecessary file reads.
    21-jun-95, JRL  -- Minor change to make 171A line calculation work with
			with the SPEX85 data files.  And change to be able
			work with the SPEX95 data files.
			Changed the units to return in terms of 1.e44


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

       PURPOSE: Select, and optionally confirm, a line of points from an
		 image or data cube		 		 

       METHOD: 	Display the image in a new window (if requested)
			and intereactively select two points with the mouse.
			If DRAW option selected then "draw" the line defined
			by the two points on the image or cube.		 

       CALLING SEQUENCE: linss=linsel(datain,ind,/mark,/draw,/noconfirm,/nodisplay)

       PARAMETERS:	data		the input image/cube to operate on
			ind		index to indicate which image in a cube
					 display for the selection process
	
	KEYWORDS:	mark		pass through to SELPNT to mark points 
					as they are selected
			draw		if set draw the line on the input image or
					data cube
			newwin		if set open a new window to work in
			nodisplay	if set do not redisplay the image
			quiet		if set do not print instructions on first
					pass either
			noconfirm 	if set turn off the confirmation process

	NOTES:	The input data cube will return the same images but with
		the line drawn on them if the DRAW keyword is selected.	

	CALLS:  SELPNT,OPLIN,NEW_WIN,YES_NO_F,LNPNT		
       HISTORY: Drafted AMcA, Nov. 1994.


LIST_BDA $SSW/yohkoh/bcs/idl/bda/list_bda.pro
[Previous] [Next]
 NAME:
	LIST_BDA
 PURPOSE:
	Provides a list of the ROADMAP or INDEX of the BDA file
 CALLING SEQUENCE:  
	LIST_BDA,item[,ista,nda]
	LIST_BDA,item,ista,nda [,ss=ss]
	LIST_BDA,item,time=time[,nrec=nrec [,ss=ss]]
 INPUT:
	item		Structure, either ROADMAP or INDEX of BDA file
 OPTIONAL INPUTS:
	ista, nda	Start record and number of records
			(if both not provided, values will be requested
	TIME=time	String containing required time and/or date.
       ENDTIME=endtime String containing required end time and/or date
	NREC=nrec	Number of records required with TIME option.
			(10 assumed if field not present and no ENDTIME)
	chan=chan	Channel whose c/r is listed [Def = 3, Ca XIX]
	BLOCKID=blockid ID of blocks to be viewed. By default all 
			are reported
 KEYWORD INPUTS:
	hc		If set, listing sent to file "list_bda.tmp" 
	print		If set, above file is printed and deleted by dprint
 OUTPUT:
	SS=SS		If present, the SS vector used in TEST_RD is 
			returned. Only blockID's of 0 and 1 are included
			unless the BLOCKID switch is used.
 HISTORY
	RDB  Oct '91	Written
	RDB  26-Feb-92	Large time gaps and BLOCKID > 1 flagged
			TOTAL_CNTS now scaled *10
	RDB  03-Mar-92	SS=SS option refined + other corrections
	RDB  26-Oct-92	Added CHAN keyword, small format corrections
	RDB  04-Nov-92	Corrected logic error than missed gap recs 1,2
	RDB  10-Nov-92	Changed so use either ROADMAP or INDEX stuctures
	RDB  16-Nov-92	Small adjustment to format statement
	RDB  14-Dec-92	Added quit if "q" typed within the FOR loop
	RDB  01-Mar-93	Defaults to 10 rec. if 0 entered
	RDB  07-May-94	Added 1st two decimal places to time field.
			Added /hc switch
	RDB  14-May-94	Corrected problem of file under unix; added /print
 CALLS:


LIST_BSC [1] $SSW/yohkoh/bcs/idl/atest/list_bsc.pro
[Previous] [Next]
 NAME:
       LIST_BSC
 PURPOSE:
       list times of spectra in a BSC file for a given channel
 CALLING SEQUENCE:
       LIST_BSC,BSC_INDEX,CHAN,OUT=OUT,FILE=FILE
 INPUTS:
       BSC_INDEX    - BSC index structures
       CHAN         - BCS channel
 KEYWORDS:
       OUT          - string array into which output can be dumped 
       FILE         - file from which to read BSC index and data
 CALLS: ***
	BSC_CHAN, BSC_CHECK [1], BSC_CHECK [2], DATATYPE [1], DATATYPE [2], DATATYPE [3]
	gt_day [1], gt_day [2], gt_time [1], gt_time [2], rd_bsc
 PROCEDURE:        
       Simple read and print
 HISTORY:
       Written Nov'92 by D. Zarro (ARC)
       Modified, Jun'94, (DMZ), added extra format field to spectrum number
       Modified, Apr'95, (DMZ), added mode and block fields


LIST_BSC [2] $SSW/yohkoh/bcs/idl/bsc/list_bsc.pro
[Previous] [Next]
 NAME:
       LIST_BSC
 PURPOSE:
       list times of spectra in a BSC file for a given channel
 CALLING SEQUENCE:
       LIST_BSC,BSC_INDEX,CHAN,OUT=OUT,FILE=FILE
 INPUTS:
       BSC_INDEX    - BSC index structures
       CHAN         - BCS channel
 KEYWORDS:
       OUT          - string array into which output can be dumped 
       FILE         - file from which to read BSC index and data
 CALLS: ***
	BSC_CHAN, BSC_CHECK [1], BSC_CHECK [2], DATATYPE [1], DATATYPE [2], DATATYPE [3]
	gt_day [1], gt_day [2], gt_time [1], gt_time [2], rd_bsc
 PROCEDURE:        
       Simple read and print
 HISTORY:
       Written Nov'92 by D. Zarro (ARC)
       Modified, Jun'94, (DMZ), added extra format field to spectrum number
       Modified, Apr'95, (DMZ), added mode and block fields


list_mo_log [1] $SSW/yohkoh/gen/idl/atest/list_mo_log.pro
[Previous] [Next]
NAME:
	list_mo_log
PURPOSE:
	To read the log entries when an MO disk is made and make a listing.
SAMPLE CALLING SEQUENCE:
	list_mo_log
 CALLS: ***
	ARR2STR [1], Arr2Str [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], UNIQ [1]
	UNIQ [2], UNIQ [3], concat_dir [4], fmt_tim [1], fmt_tim [2], mk_mo_list
	restgen [1], restgen [2]
 CALLED BY:
	mk_mo2 [1], mk_mo2 [2], mk_mo_log
OPTIONAL KEYWORD INPUT:
	outfil	- The name of the output file to write to
	short	- Print shortened entries
	last_n	- Print last n mo entries only	
HISTORY:
	Written 31-May-93 by M.Morrison
               30-Jun-94 SLF - remove file before writting 


list_mo_log [2] $SSW/yohkoh/gen/idl/mo_disk/list_mo_log.pro
[Previous] [Next]
NAME:
	list_mo_log
PURPOSE:
	To read the log entries when an MO disk is made and make a listing.
SAMPLE CALLING SEQUENCE:
	list_mo_log
 CALLS: ***
	ARR2STR [1], Arr2Str [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], UNIQ [1]
	UNIQ [2], UNIQ [3], concat_dir [4], fmt_tim [1], fmt_tim [2], mk_mo_list
	restgen [1], restgen [2]
 CALLED BY:
	mk_mo2 [1], mk_mo2 [2], mk_mo_log
OPTIONAL KEYWORD INPUT:
	outfil	- The name of the output file to write to
HISTORY:
	Written 31-May-93 by M.Morrison
               30-Jun-94 SLF - remove file before writting 


LOAD2IHEX $SSW/yohkoh/bcs/idl/micro/load2ihex.pro
[Previous] [Next]
 NAME:
	LOAD2IHEX
 PURPOSE:
	Creates Intel-hex load module from BCS parameter area that can 
	be converted to required form by BCS_CONV
 CATEGORY:
 CALLING SEQUENCE:
	.run load2ihex
 INPUTS:
	Plan area should have been read (and modified) in first!
 OPTIONAL INPUT PARAMETERS:
 KEYWORD PARAMETERS:
 OUTPUTS:
	produces file "seqn.hex" on current directory
 OPTIONAL OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
	Asks for area of parameter area required, creates laod for each
	untile offset and length of zero entered
 MODIFICATION HISTORY:
	RDB   5-May-94


load_hd $SSW/yohkoh/gen/idl/tape/load_hd.pro
[Previous] [Next]
	NAME:
		load_hd
	PURPOSE:
		load SATDF header

 CALLS: ***
	ARR2STR [1], Arr2Str [2], GET_NBYTES
 CALLED BY:
	TapDir
	HISTORY: written 13-Sep-91, GAL
		17-Feb-92 updated with wklst 
		19-Feb-92 updated with wkextlst and wkprelst


Load_recs $SSW/yohkoh/gen/idl/tape/load_recs.pro
[Previous] [Next]
	NAME:
		Load_recs
	PURPOSE:
		load logical data-records for each day of the archive.
		When fstTme flag is true (1) the first data-record will
		contain information for the weekly files only (obs, pnt,...).
	CALLING SEQUENCE:
		d_recs = Load_Recs(fprefixs, obsID, fileids, fstTme, 
				reforVer, wkprelst, wkextlst, weekDir)
	INPUT:
		fprefixs	string-arr list of valid file prefix
		obsID           string giving the observing log fileID
		fileIds         a complete list of fileIDs for refomatted files
		fstTme		firstTime flag for valid archive data 
				within the week
		weekDir		weekly files dir
	OUTPUT:
		reforVer        reformatter version number from ref. data file
				header.
		wkprelst	string with list of weekly log file prefixes
		wkextlst	Intarr with of weekly log file extensions
 CALLS: ***
	ARR2STR [1], Arr2Str [2], POPD, PUSHD, Rd_fHeader [1], Rd_fHeader [2]
	Rd_fHeader [3], STR2ARR [1], STR2ARR [2], curdir [1], curdir [2], getwkextlst
	getwkprelst
 CALLED BY:
	TapDir
	History:
		written 12-Sep-91 by GAL
	        23-Sep-91, debug and extended to real world 
		21-Oct-91, updated for ascii cpio headers...
		28-Oct-91, bug fix in fileName length 
		17-Feb-92, added weekly log entries for 1st cpio record
			which include obs log. 
		19-Feb-92, added wkextlst,wkprelst
		2-Mar-92, finished update for weekly cpio archive file
			updated computed length of the type filename.
		5-Mar-92, update for case when NO weekly files are 
			present. and removed file size checks.
		17-Apr-92, added weekDir
		11-Jun-93, updated for loop for increase in the max #
			of weeklys from 10 to 20. for loop was 0,9 now 0,19.
		24-Apr-95, updated err check from getwkprelst.


LOCAL_SCALE $SSW/yohkoh/ucon/idl/metcalf/local_scale.pro
[Previous] [Next]

function local_scale,data,top=top,bottom=bottom

NAME:
     LOCAL_SCALE
PURPOSE:
     Computes the local correlation scale of a 2-D data array
CATEGORY:
CALLING SEQUENCE:
     lcs = local_scale(data)
INPUTS:
     data = 2-D data array
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     top = largest scale value
     bottom = smallest scale value
OUTPUTS:
     lcs = 2-D array of local correlation scale (1.0<scale<top)
 CALLS: ***
	STDEV
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
    The local scale is not allowed to be less than 1.0 or greater than
    half the array size.
PROCEDURE:
    Computes an average spatial derivative of the image and uses this
    to compute the number of pixels it would take for the data to change by 
    one sigma, assuming that the image changes linearly in x and y.
MODIFICATION HISTORY:
    T. Metcalf June 8, 1994


LOCAL_SMOOTH $SSW/yohkoh/ucon/idl/metcalf/local_smooth.pro
[Previous] [Next]

function local_smooth,image,lcs,inpixon_sizes,sfunctions,sdels,xcen,ycen, $
                      noconserve=noconserve,recompute=recompute, $
                      fftconvolution=fftconvolution,quiet=quiet

NAME:
     LOCAL_SMOOTH
PURPOSE:
     Smooth an image locally using a local correlation scale
CATEGORY:
CALLING SEQUENCE:
     smoothed = local_smooth(image,lcs,pixon_sizes,nx=nx,ny=ny)
INPUTS:
     image = image to be smoothed
     lcs = array specifying the local correlation scale (in pixels)
     pixon_sizes = List of valid pixon sizes.  All elements of lcs
                   should have a value from this list.
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     /fftconvolution = Use FFT for the convolutions rather than CONVOL.
                       This is considerably faster when the size of
                       the image is a power of 2.
     /recompute = Force the smoothing functions to be recomputed.  This
                  should be used on the first call to local_smooth since
                  the smoothing functions are stored in a common block 
                  and you may be using old smoothing functions unless
                  you recompute on the first call.
     /noconserve = Alternate smoothing algortihm: does not conserve
                   counts.
OUTPUTS:
     sfunctions = the smoothing functions
     sdels = the size of the smoothing functions
     smoothed = locally smoothed image
 CALLS: ***
	FFTCONVOL, PXN_PSF, SQUEEZE, nddist2 [1], nddist2 [2]
 CALLED BY:
	HXTFPB, HXTFPB_FUZZY, HXT_ERROR, PIXON_MAP, PSFPIXON
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
     Be sure to use /recompute on the first call!
EXAMPLE:
     simage = local_smooth(image,local_scale(image), $
                           long(alog10(sqrt(nx*ny))/alog10(2.0d0)+0.5))
PROCEDURE:
 Apply the pixon map (local correlation scales) to image to obtain
 the smoothed image, pimage. 
MODIFICATION HISTORY:
      T. Metcalf June 11, 1994
      1994-09-23 TRM Fixed bug which did not conserve counts in the image.
                     Added logarithmic spacing of scales.
      1994-10-26 TRM Use logarithmic spacing of pixon sizes and use
                     parabolic pixons.
      1995-08-22 TRM No more logarithmic pixon spacing.  Use exactly the
                     pixons which are passed to the routine.  Things
                     like logarithmic spacing should be dealt with at a
                     higher level.

                     Add the recompute keyword so the routine does not have
                     to waste time checking if the smoothing functions need
                     to be recomputed.  The user must know when the functions
                     should be recomputed!
      1995-10-12 TRM Added FFT convolution option.  But it turned out to 
                     be slower, so it's not recommended.
      1996-06-17 TRM Added /edge_truncate keyword to CONVOL calls.  This
                     handles the edges much more efficiently than a guard
                     ring.
      1996-06-18 TRM Added binup factor to increase the accuracy of the 
                     pixon shape functions.  This allows a finer resolution in
                     pixon sizes.
                     FFT convolution is faster now.
      1996-09-14 TRM -Change to compute psf and fftpsf each time the psf's
                      are recomputed.  Thus, without recomputing, the routing
                      can be called with or without the /fft keyword.
                     -Changed from double to float.


LOG_DERIV $SSW/yohkoh/ucon/idl/hudson/log_deriv.pro
[Previous] [Next]
 NAME:
	LOG_DERIV
 PURPOSE:
	calculates log derivatives of the filter efficiency functions
 CATEGORY:
 CALLING SEQUENCE:
	log_deriv, i, output, /plot, /all
 INPUTS:
	i = filter number (['Noback','al1265a','almgmn','mg2p5um',$
	  'al11p6um','be119um'])
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
       /all sends all of the different scaling laws to plot
 OUTPUTS:
       temp, temperatures
       logderiv, log derivatives
 METHOD
       Various possible relationships between density and temperature
         are shown as scaling laws on the plots. For example, RTV
         predicts n to vary as T^2 for fixed geometry; "cooling scaling"
         is what I call the n proportional to T dependence that was noted
         by Jakimiec et al. (A and A 253, 269).
 CALLS: ***
	restgen [1], restgen [2]
 COMMON BLOCKS:
 SIDE EFFECTS:
 WARNING:
       The filter numbers are listed above. They're not in the filtb order!
 RESTRICTIONS:
 MODIFICATION HISTORY:
	HSH, written 22-aug-93
       HSH 5-Dec-94 add outputs
       HSH 18-Jul-95 added other scaling laws to the plots 


LOOP_WIDTH $SSW/yohkoh/ucon/idl/klimchuk/loop_width.pro
[Previous] [Next]
NAME:
     LOOP_WIDTH

PURPOSE:
     To measure the width of an X-ray loop as a function of position
     along the loop axis.

INPUTS:
     This is a program which assumes that a data cube called DATA has
     been defined and assumes that an image from that data cube is 
     displayed in window 0.

OUTPUTS:
     The most important output is an array called DATALOOP which is a
     subset image of a loop that has been straightened and that has had
     the background subtracted.  There are many graphical outputs, as
     well, including a plot of the measured width as a function of
     position along the loop axis.

     Postscript files called IMAGE.PS and PLOT.PS can be generated.

VERSION:
     V1.0    22-April-92
     V1.1    23-APril-92

HISTORY:
     Written 22-April-92, J. A. Klimchuk (Stanford).
     Modified 23-April-92 (JAK) to generate postscript files.


LOOP_WIDTH3 $SSW/yohkoh/ucon/idl/klimchuk/loop_width3.pro
[Previous] [Next]
NAME:
     LOOP_WIDTH3

PURPOSE:
     To subtract the background emission from a coronal loop and 
     determine the loop width as a function of position along the loop axis.

INPUTS:
     This program has no arguments.  It assumes that either a 2-D image 
     or a 3-D image array (data cube) called DATA has been defined and 
     that the image of interest is displayed in window 0.  Other inputs 
     are supplied from the keyboard after prompts.

     A default title for the plot can be used.  Otherwise, a character
     string variable called "title" must be predefined
     (e.g.,  IDL> title = '23-Aug-96, EIT 195')

OUTPUTS:
     The most important outputs are a 2-D array called DATALOOP which is 
     an image of the loop after it has been straightened and had
     the background subtracted, and a 1-D array called STDEV which contains 
     the standard deviations of the intensity profiles at each point along 
     the loop axis.  Under the assumption of a circular and uniform 
     cross-section, the loop diameter is 4 times the standard deviation.
     The scalars WIDTH_LEFT, WIDTH_RIGHT, and WIDTH_MIDDLE contain the 
     the 3-point running average of STDEV at positions where the loop 
     intensity falls to one-half of its maximum value and at the position
     midway between them.

     Postscript files called IMAGE.PS and PLOT.PS can be generated.

USAGE:
     IDL> .run loop_width3

COMMENTS AND WARNINGS:
     The loop must be single valued in the vertical (up/down) direction, 
     i.e., a vertical line may intersect the loop only once.  If 
     necessary, the image can be rotated to make the loop single valued.
     This should only be performed when necessary, since the quality of the 
     data may be degraded by the rotation.

     When selecting loop axis pixels (by clicking with the left mouse 
     button), it is necessary to start at the left loop footpoint and 
     progress to the right loop footpoint.

     There are two ways to trace the loop:  1. with a smooth curve, by 
     holding the left button down while moving the mouse; or 2. with 
     connected line segments, by clicking on different positions.  A 
     pixel will be included only if its lower-left corner falls within 
     the traced region.  This makes it difficult to include pixels 
     that lie along the bottom row of the image, so an option has been 
     added to extend the traced region downward to include the pixels  
     at the bottom.

     The background is determined in one of two ways:  1. a simple 
     linear interpolation between the background values at the edges 
     of the loop (at each loop axis position); or 2. a least-squares 
     polynomial surface fit to the entire region surrounding the loop.
     Interpolation is generally safer if the background is complex or 
     if the loop is faint compared with the background.

     It is dangerous to use high-order polynomials for the background 
     surface fit, since unwanted small wavelength structure may be 
     introduced in the region of the loop (the traced out data "hole").  
     Third or fourth order polynomials are generally recommended.

     It is also dangerous to make the width of the straightened loop 
     image (input from keyboard) too large, as this will allow remote 
     regions to have an undue influence on the background in the region 
     of the loop.  Experience suggests that it is best to include only 
     3 or 4 pixels on either side of the loop.

     The analysis is performed twice during each run, once with the 
     loop region defined by the tracing procedure, and a second time with 
     this region expanded by one or more pixels on each side.  We call 
     this the "error pass", since differences between this pass and the 
     first are an indication of the errors that are attributable to the 
     subjective tracing of the loop.  The amount by which the loop 
     region is expanded during the error pass can be changed by editing 
     the lines marked in the code.  Currently, the region is one pixel 
     wider on each side.

     When using pairs of images to obtain density or temperature diagnostics,
     it is advisable to use the same loop definition and background
     subtraction parameters for both images.  Thus, when the question
     'Use parameters from the previous run? (y/n)' is asked, a negative (n)
     response should be given when analyzing the first image, and an
     affirmative (y) response should be given when analyzing the second.
     Do not forget to redefine DATA and display the second image before
     running LOOP_WIDTH3 for the second time.

     Note that CDS/SOHO images must be destretched in order for the loop 
     width measurements to be accurate.  This can be done using CONGRID.PRO;
     e.g., for a 4'x4' image with 2" raster steps, use
     IDL> data = congrid(original_image, 120, 120, /cubic)

     The windows are currently set to be displayed at convenient locations 
     on a 1280 x 1024 monitor.  This can be changed by editing the arguments 
     in the "window" statements of the code.

     If the following error message is encountered when tracing the loop:
        "% Loop limit expression too large for loop variable type",
     try again with a smaller magnification factor.

HISTORY:
     Written 22-April-92, J. A. Klimchuk.
     Modified 23-April-92 (JAK) to generate postscript files.
     Modified 02-Oct-96 (JAK):
        Made changes to accomodate both individual images and data cubes;
        Added option of using parameters from previous run;
        Made sxt_decomp an option rather than automatic;
        Changed position of windows on monitor.
     Modified 16-Oct-96 (JAK) to fix bug in determination of region 
        size in runs using previous values (iold='y'). 
     Modified 28-Oct-96 (JAK) to save arrays from original pass as well as
        those from error pass (e.g., dataloop is now the background-subtracted 
        image from the original pass, and dataloop_error is the background-
        subtracted image from the error pass).
     Modified 28-Oct-96 (JAK) to include the option of extending the loop 
        region to the bottom of the straighted loop image (bottom pixels 
        cannot be easily selected with the mouse).
     Modified 18-Nov-96 (JAK):
        Commented out lines specific to SXT (call to sxt_decomp);
        Changed keyboard input variables from 0 to 'n' and from 1 to 'y'.
        Added comments and warnings in header
     Modified 11-Mar-97 (JAK):
        Corrected divide by zero problems when sumint=0;
        Changed to no longer plot zero values of standard deviation.
     Modified 12-Mar-97 (JAK):
        Added option for linear interpolation background (no surface fit);
        Changed window positioning and sizing to be case dependent;
        Added specialized plot title option;
        Made intensity normalization automatic for loop plot.


LOUGHHEAD $SSW/yohkoh/ucon/idl/hudson/loughhead.pro
[Previous] [Next]
 NAME:
     LOUGHHEAD
 PURPOSE:
     Calculate 3-D geometry of solar loop
 CATEGORY:
     Yohkoh
 CALLING SEQUENCE:
     angles = loughhead(lambda, phi, psi, omega, time)
 INPUTS:
     lambda, phi, the CMD and longitude (degrees) of the
       midpoint between the footpoints of the loop, measured
       postive to west and north, respectively.
     psi and omega are the angles (degrees) with respect
       to true west of (psi) the line joining the footpoints,
       and (omega) the axis of symmetry. See Loughhead, Wang,
       and Blows, Ap. J. 274, 883 (1983). This code follows
       their notation.
     time, the time of observation (or a Yohkoh index structure)
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 ROUTINES CALLED
     get_rb0p
 OUTPUTS:
     angles alpha and beta, the azimuth and vertical angle, 
       respectively
 CALLS: ***
	get_rb0p [1], get_rb0p [2]
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     29 May 1996, written (HSH)


LP_OBSLOG $SSW/yohkoh/ucon/idl/shimizu/lp_obslog.pro
[Previous] [Next]
 NAME:
	LP_OBSLOG
 PURPOSE:
	Make a file which contains information of the observation. If
	"file" is not defined, print information on the console.
 CALLING SEQUENCE:
	LP_OBSLOG, name, st_num, end_num  -- for print on the console.
	LP_OBSLOG, name, st_num, end_num, file= file  - for making a file.
 CATEGORY:
	LaPalma data analysis
 INPUTS:
	name - file names. For example, 'le75f2w6302m60rcpn####.strt'
	st_num - first number to be examined
	end_num - end number to be examined
 OPTIONAL INPUTS:
	file - output file name.
		if file is not specified, the information is printed 
		on the console.
 OUTPUTS:
	none.
 CALLS: ***
	F1, FNS
 HISTORY:
	26 Jan, 94  written by TShimizu (Univ. of Tokyo).
	12 May, 94  bag fixed
	14 May, 94  make a space between info(0) and info(1)


LP_STRUCT $SSW/yohkoh/ucon/idl/shimizu/lp_struct.pro
[Previous] [Next]
 NAME:
	LP_STRUCT
 PURPOSE:
	Define LaPalma Index Structure.
 CALLING SEQUENCE:
	LP_STRUCT, LaPalma_Index= LaPalma_Index
 CALLED BY:
	CONV_LP2INDEX
 HISTORY:
	10 Mar, 1994  written by TShimizu (Univ. of Tokyo)
	12 Mar, 1994  revised structure tags
	15 Mar, 1994  add day2, time2, wavelength2, offband2
	22 Mar, 1994  add comments


LP_VELMAP $SSW/yohkoh/ucon/idl/shimizu/lp_velmap.pro
[Previous] [Next]
NAME:
       LP_VELMAP
PURPOSE:
       Obtain and show velocity, rot v and div v map from the
       velocity field map.
CALLING SEQUENCE:
       LP_VELMAP, file, ks, ke, pix, rota,diva,vx,vy,vel, date= date

METHOD:
INPUT:
	file         - file name of the velecity data
       ks           - start data number for summation
                      do not start from kx=1, because the first flow
                      map is null.
       ke           - end data numver for summation
 CALLS: ***
	ARC2LEN, F1, VELOVECT3
		     Note: kx, ky is counted from kx=1 (not 0).
 	pix	     - La Palma data pixel size  ex., 0.27
OPTIONAL INPUTS:
	date         - observing day  ex, date='1-JUN-92'
	 	       used for the calculation of arcsec-km conversion.
       LENGTH: Length factor.  The default of 1.0 makes the 5.0km/s
               vector the length of a cell.
OUTPUT:
       vx,vy        - velocity field x,y components
       vel          - velocity field abosolute velocity
       rota         - rotation field
       diva         - divergence filed
           Note: coordinates
             North is always up, and the East is to the left.

KEYWORD OUTPUT:
       None
NOTE:
       1. The output file of the ANA flowplot can be used as the
          direct input to this routine. The necessary rotation of
          the flow vector is done in this routine (Up: North, Left:
	   East).
	2. The output file of the ANA flowplot should be generated
	   by sxt2:/home/shimizu/lapalma/getflow.ana, which consider
	   the observing interval.
         
HISTORY:
       2-July-93 (ST)   originally "v1.pro"
	1-June-94 T.Shimizu 
	23-Aug-94 T.Shimizu   Call VELVECT3 so that the default LENGTH 
		of 1.0 makes the 5.0km/s vector the length of a cell.
			      Added LENGTH


ls $SSW/yohkoh/ucon/idl/foley/ls.pro
[Previous] [Next]
 NAME:
   ls.pro   
 PURPOSE
   To spawn the Unix ls comand to see contents of current 
   working directory

 CALLING SEQUENCE
  ls

 INPUT
  none

 OPTIONAL OUTPUT
  none

 OPTIONAL KEYWORD INPUT
  none

 RESTRICTION
  Unix only.

 HISTORY
  Written CAF 2 MAY 96 : caf@mssl.ucl.ac.uk


LSswap $SSW/yohkoh/gen/idl/tape/lsswap.pro
[Previous] [Next]
	NAME:
		LSswap
	PURPOSE:
		Search for all occurances of 4 and 2-byte words and 
		perform the appropriate byte-swap.
	CALLING SEQUENCE:
		sDat = LSswap, dat, [longSwap=longSwap, shortSwap=shortSwap]
	INPUT/Keyword:
		dat		input data structure
	        longSwap        only swap Long words 
		shortSwap	only swap 2-byte integers
	RETURNED:
		sDat	swapped data
 CALLED BY:
	Rd_TapDir
	HISTORY:
		written 10-Oct-91, by GAL
		Note: initial version will not use the keywords.


lwa_dn_unc modified from sxt_dn_uncpro $SSW/yohkoh/ucon/idl/acton/lwa_dn_unc.pro
[Previous] [Next]
 NAME:
   lwa_dn_unc [modified from sxt_dn_unc.pro]
 PURPOSE:
   Estimate the uncertainty intensity of an SXT pixel in DN
 CALLING SEQUENCE:
   unc = lwa_dn_unc(index,data)	; Assumes Te = alog10(3.e6)
   unc = lwa_dn_unc(index,data,te=te)
   unc = lwa_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: ***
	LWA_DN_UNC, sxt_flux [1], sxt_flux [2], sxt_flux [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).
  30-oct=96, LWA, Created from sxt_dn_unc to eliminate normalization check.


lwa_plot_arc $SSW/yohkoh/ucon/idl/acton/lwa_plot_arc.pro
[Previous] [Next]
NAME:
	lwa_plot_arc
PURPOSE:
	To allow a user to mark an arc on an image and the intensity
	along that arc will be plotted
SAMPLE CALLING SEQUENCE:
	lwa_plot_arc, index, image, /notv
	lwa_plot_arc, 0, gbo_image, /sample, /notv
	lwa_plot_arc, index, image, width, bin=bin
	lwa-plot_arc, index(1), data(*,*,1), 10, bin=4, /use_poly, /notv
RESTRICTIONS:
	The image should be displayed on the first running 
	(do not use the /notv keyword) to insure that the user is marking
	the image in the proper location and proper scaling.
INPUT:
	image	- The image for which the curve wants to be plotted
OPTIONAL INPUT:
	width	- The width in original pixels of the curve.
		  (ie: the number of lines to add together)
		  This is the width of the channel for which to get
		  the light curve.
 CALLS: ***
	DEFROI [1], DEFROI [2], DERIV, PAUSE [1], POLY, POLY_FIT, SPLINE, TVPLOT, WDEF [1]
	WDEF [2], deriv_arr [1], deriv_arr [2], enhancer, gt_res, pause [2], plottime [1]
	plottime [2]
OPTIONAL KEYWORD INPUT:
	bin	- The rebinning factor.
		  If not passed, it will be set to whatever it takes
		  to make the image be 512 in the x direction.
	use_spline - If set, then use the SPLINE method for smoothing
		  the curve (Default is to use SPLINE)
	use_poly - If set, then use the POLYNOMIAL FIT method for smoothing
		  the curve (Default is to use SPLINE)
	ndeg	- The polynomial degree to be used for the fits.  If
		  not passed, it will use 4th degree polynomial.
	enhance - If you wish to use the function ENHANCE for displaying
		  the image, then pass the index in for the image being
		  displayed.
	sample	- If set, then use /SAMPLE option within REBIN instead
		  of interpolate (which is the default)
	notv	- If set, the image is not displayed, must display
		  before calling lwa_plot_arc.
OPTIONAL KEYWORD OUTPUT:
	xlcur	- The x-array for the light curve array (relative units
		  of full resolution pixels)
	lcur	- The light curve array.  The units are the same as whatever
		  is being passed in, independent of BIN or WIDTH.  
		       Prior to 21-Jul-94, the units were:
		  (whatever was passed in) * (bin factor) * (width).
METHOD:
	DEFROI is used to mark the points on the image to make the
	arc.  The default is to make a polynomial fit to the x and
	y positions separately (as a function of the distance down
	the arc). 
HISTORY:
	Written 21-Oct-93 by M.Morrison
	15-Nov-93 (MDM) - Changed the calling sequence (to index,data)
			- Added ENHANCE and SAMPLE options (as per LWA program)
	 9-Jun-94 (MDM) - Modified to not crash when passing in a 1024x512
			  image (make bin = 0.5 for that case).
			- Corrected a bug for cases when bin = 0.5.
 V2.0	21-Jul-94 (MDM) - Corrected to not use the ENHANCED data for the
			  arc signal (when /enhance was set)
			- Corrected to normalize for the width and binning used,
			  so that units are in the same units as what is passed
			  in.
			- Added documentation information
	23-July-94 (LWA)- Added /notv option to eliminate redisplay of image
			  in order to make nice illustrations for publication.


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

 Make a scattered light image from an SXT composite image.


PRO lwa_scatter, composite, scatter, level=level, power=power, $
	index=index


 INPUT PARAMETERS:
	composite = composite image, Full frame.

 KEYWORD INPUT PARAMETER
	index, SXT index structure or integer [0=FR, 1=HR, 2=QR]

 CALLING SEQUENCE
	sxt_scatter,index=index,composite, scatter
	sxt_scatter,index=2, qr_composite, qr_scatter

 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

 CALLS: ***
	gt_pix_size
 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
	30-Oct-96 [LWA]  Generalized method of determining pixel size.


LWA_TE $SSW/yohkoh/ucon/idl/acton/lwa_te.pro
[Previous] [Next]
 NAME:
       LWA_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, dark=dark, 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:
	dark	 = dark frame signal level
       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]
 CALLED BY:
	lwa_te_intact
 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 < or = to zero.
       Compute em by using thin filter.
  LWA corrected following note.
       em = alog10(ithin_db/ gain_ccd / 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.
	LWA, Name changed and 'dark' included, May 1992.
	LWA, corrected (inverted) use of ccd_gain, May 1992.


lwa_te_intact $SSW/yohkoh/ucon/idl/acton/lwa_te_intact.pro
[Previous] [Next]
 NAME:
       lwa_te_intact
 PURPOSE:
       Compute temperature TE and display the images interactively.
 CALLING SEQUENCE:
       te=sxt_te_intact, arg1, arg2, arg3, arg4, arg5, arg6, dark=dark,  $
          getem=getem, em=em, getratio=getratio, ratio_r=ratio_r,   $
          ratio_db=ratio_db, interp=interp, $
          gain=gain, version = version, cutoff=cutoff
 INPUTS:
       arg1, arg2, arg3, arg4, arg5, arg6
       Type I:
         arg1   = oi1
         arg2   = oi2
         arg3   = periph1
         arg4   = periph2
         arg5   = t1
         arg6   = t2
       Type II:
         arg1   = oi1
         arg2   = oi2
         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"
       oi1      = vector of number of electron for filter 1.
       oi2      = vector of number of electron for filter 2.
       periph1  = number 1 periph byte parameter 
       periph2  = number 2 periph byte parameter
       t1       = time period of oi1, default value is 1.
       t2       = time period of oi2, default value is 1.
 OPTIONAL INPUT PARAMETERS:
	dark	 = dark background
       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.
       cutoff   = "cutoff" value, if I1/t1(or i2/t2) is less than or
                  equal to cutoff value then the data is invalid.
 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: ***
	LWA_TE, Periph, SXT_TE_DRAW4, SXT_TE_POSITION, SXT_TE_VALID, XMANAGER, XMENU [1]
	XMENU [2], gt_expdur [1], gt_expdur [2], gt_filta, gt_filtb, sxt_decomp [1]
	sxt_decomp [2]
 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)

       common sxt_te_comint,npt_x, npt_y, xsize, ysize, iposx, iposy, 
              lposx, lposy, mposx, mposy,sposx, sposy, mxy, n_image,  
              pos_name, em_flag, ffb1, ffb2, tnd1, tnd2, s_flag, 
              lun, vd_flag
       npt_x      = number of points in x direction
       npt_y      = number of points in y direction
       xsize      = size of widget in x direction
       ysize      = size of widget in y direction
       iposx      = array of starting position in x direction for
                    image display
       iposy      = array of starting position in y direction for
                    image display
       lposx      = array of starting position in x direction for
                    label drawing(name of images, TE, I2, I4, EM etc)
       lposy      = array of starting position in y direction for
                    label drawing(name of images, TE, I2, I4, EM etc)
       mposx      = array of starting position in x direction for
                    mode name box drawing(temode, summode etc)
       mposy      = array of starting position in y direction for
                    mode name box drawing(temode, summode etc)
       sposx      = array of starting position in x direction for
                    size box drawing(256 x 256, 128 x 256 etc)
       sposy      = array of starting position in y direction for
                    size box drawing(256 x 256, 128 x 256 etc)
       mxy        = image expanding factor. npt_x=n_x * mxy
       n_image    = number of images to display at one time
       pos_name   = list of the corresponding image names(I1, I2, Te,
                    EM etc)
       em_flag    = flag of EM calculation, em_flag=1 then compute emo
       ffb1       = corresponding filter b1 id number
       ffb2       = corresponding filter b2 id number
       tnd1       = flag for T_ND information. If ffa1=6, then
                    i1=i1*T_ND, mark i1 output with '*'
       tnd2       = flag for T_ND information. If ffa2=6, then
                    i2=i2*T_ND, mark i2 output with '*'
       s_flag     = flag for save output. If s_flat=1 then save the
                    information to output file(unit number "lun")
       lun        = output file unit number.(If s_flag=1)
       vd_flag    = flag for valid data display. if vd_flag=1 then
                    display valid region data instead of em data
 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...........
                 index_1, index_2 are from "test_rd" program.
                 Use index to compute periph1,2(filter a,b position),
                 and t1,t2.
       Thpe 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.
       Use any one of the input type. This program wil compute 
       periph1,periph2,t1 and t2 from the input. Then call LWA_TE by
       using type I input(i1,i2,p1,p2,t1,t2,.........) to get temperature
       te.

       This program will decompress the data if the data is compressed
       data. One can input compressed or decompressed data, integer or
       floating point or byte.
  
       This program will recompute temperature te for summed pixel, but
       only return the original temperature te without expanding and
       without summing. and return the original ratio_r instead of
       expanded or summed ratio.

       If one wants to exam some data, simply press "STOP" button to
       escape to IDL. After exam the data can use "return" to continue
       the program.
       The data one want exam. are in
         instance.te_new -- expanded temperature array.(Dissplayed image)
         instance.ste_new-- expanded sum_pixel temperature array.
         instance.ratio_r-- sum_pixel ratio(without expansion)
         do help, instance,/st  to see other instance values.

       If keyword INTERP is supplied, then use spline interpolation in
       LWA_TE. Otherwise use INTERPOL routine to interpolate.
       
       Use Widgets(BASE, BUTTON, TEXT, DRAW etc) display the images
       of I1, I2, Te, EM and VD data. Also display the Te value at
       any pixel.
       Display alog10 of the images. But one can turn on and off the
       Log10 flag to plot original image or Log10 of the image.
       In order to be able to sum 2x2, 4x4, 8x8 or 16x16 pixels, this
       program rescales the i1 and i2 to multiple of 16 pixels size.
       Also convert to floating point data if i1 and i2 are integers.
       Call procedure lwa_te to compute temperature(see PROCEDURE of
       lwa_te.pro) interactively.
       If the size of image is less than or equal to 256x256, then
       display 4 images at the same time

                  position          image
                  --------          -----
                     0               i1
                     1               i2
                     2               Te
                     3               EM or VD  if em_flag = 1
                                     VD or blank if em_flag =0

       If the size is less than or equal to 128x128, then expand the
       data to maximum of 256 x 256.
       * position is same definition of TV, TVSCL in image display
       If the size of image is greater than 256x256, then display one
       image at a time, also does not expand the data, and always display
       at left bottom corner.

       The widget buttons are:
       If display one image at a time(n_image = 1) then

          col00         col01         col02         col03       
          ----------    ----------    ----------    ----------
          Sum-pixels    Sum2by2       i1            Te
          SumPix-OFF    Sum4by4       i2            Sum
          XLOADCT       Sum8by8       TE            Sum-reset
          Log10-on      Sum16by16     EM            Refresh
          Log10-off     Prev-Sum      VD            Journal
          STOP                                      Log10-on
          QUIT                                      Log10-off
                                                    STOP
                                                    quit

       If display four images at a time (n_image=4) then

                        col01         col02
                        ----------    ----------
                        Te            Sum2by2
                        Sum           Sum4by4
                        Sum-reset     Sum8by8
                        Refresh       Sum16by16
                        Journal       Prev-Sum
                        draw-vd
                        draw-em
                        Sum-pixels
                        SumPix-OFF
                        XLOADCT
                        Log10-on
                        Log10-off
                        STOP
                        QUIT

       The function of the buttons are:
       Sum-Pixels  - To sum pixels of the i1 and i2 then compute Te
                     of summed image. If one push this button, col01
                     (col02 if n_image=4) will appear on the screen.
                     one can choose one of the summing size from 5
                     buttons. If one want to change summing size, also
                     can push this button again.
       SumPix-OFF  - Will display original images(before summing). 
       XLOADCT     - Load color table
       Log10-on    - plot log10 of the image(turn on Log10 flag)
       Log10-off   - plot original image (turn off Log10 flag)
       STOP        - Escape to idl(type xmanager back to program)
       QUIT        - Stop the program.
       Sum*by*     - Will sum (*by*) pixels to generate new images.
       Prev-Sum    - Will use the previously summed images.(no need to
                     re calculate te)
                     This is good only from "no sum"(original image)
                     stage.  If one is already in "sum" mode, will give
                     the warning message and ask to select another
                     button to change summing size.
       i1          - will display i1 (first filter b) data(n_image=1)
       i2          - will display i2 (second filter b) data(n_image=1)
       TE          - will display Te data(n_image=1)
       EM          - will display EM data(only if compute EM)(n_image=1)
       VD          - will display valid area data(n_image=1)
       Te          - display temperature Te. Click any position in any
                     image(i1,i2,TE or EM if n_image=4), will display the
                     temperature at that pixel, and pixel position etc.
       Sum         - will compute Te of sum of the enclosed area.
                     Click any two cornor of the box. This program will
                     draw the box and display the results of sum of the
                     box calculation. Will draw the box for all the 
                     images(i1, i2, TE and EM, if n_image=4)
       Sum-reset   - same as "Sum", except this will erase previous
                     box. Only one box present at a time.
       Refresh     - Flush the image, redraw image(redraw all 4 images
                     if n_image=4)
       Journal     - If push this button, will start save the output
                     data to the file.
       quit        - n_image=1 case only, will get back to col00 and
                     col02. choose the display image or summing pixels.
       draw_vd     - will display valid data VD at position 3(only for
                     n_image=4)
       draw_em     - will display EM data at position 3(only for
                     n_image=4)
                     At position 3 one can display VD or EM by pushing
                     "draw_vd" or "draw_em" button.
 PROCEDURES CALLED:
       periph, sxt_te_position, lwa_te, sxt_te_valid, sxtte1_event,
       sxtte4_event
       sxt_te_draw1, sxt_te_draw4, sxt_te_temode, sxt_te_summode,
       sxt_te_sumpx
       (rd_gen, interpol) 
       (rebin, widget_base, widget_text, widget_control, 
        xmenu, xmanager, tvscl, tv, xyouts)
 MODIFICATION HISTORY:
       Written by Fei-Mei Lee Chou, Oct 15, 1991.
	Input variable "dark" added by LWA and name changed 5/12/92
       Included 'gain' in call to lwa_te.  lwa 5/13/92