favviewer $SSW/trace/idl/util/favviewer.pro
[Previous] [Next]
NAME:
	favviewer
PURPOSE:
	Ingests the ANA Browser's Fav Img file and displays the images and
	allows one to write out the images locally as flat fits, gif with 
       color table currently loaded, load personal IDL color table or send 
	over to the SOHO archive as flat fits.
SAMPLE CALLING SEQUENCE:
	favviewer,'fav img file name'
 CALLS: ***
	XMANAGER, XMENU [1], XMENU [2], get_xfont [1], get_xfont [2], set_font
HISTORY:
	Created 11-May-98 by J. Covington

	23-Jun-98 (JFC) - added ability to zoom and save zoomed image as gif



NOTES: The image that is sent over to the SOHO archive is a flat fits
	with no color table so if you play with the color tables and
	send it over to the SOHO archive it won't have any color. If
	you want to save a nice image with color save it as gif.



common favview1,line,imgfilename,imgnumber,shdr,data,index,datatemp,percentcutoff,coorbutupx,coorbutupy,coorbutdownx,coorbutdowny,datazoom,zoomonce,datasend

imgdirect = '/disk02/people/covingto/idl/favimg/'
set_font, 10, /widget_only
font = get_xfont(closest=9,/only_one,/fixed)
percentcutoff=0.100
disp_size = 512

files = ''
file=favimgfile
infil=favimgfile
spawn,['cat',file],line,/noshell

nlines = n_elements(line)
print,nlines
imgfilename=strarr(n_elements(line))
imgnumber=strarr(n_elements(line))

for i = 0, n_elements(line)-1 do begin
pathend=strpos(line(i),' ')
print,'pathend: ',pathend
imgfilename(i) =strmid(line(i),0,pathend)
imgnumber(i)=strmid(line(i),pathend+1,pathend+4)
imgline = line(i)
endfor

base00=widget_base(/column,title='Favorite Image Viewer')
xmenu, ['QUIT', 'Set Fav IMG File','Save as fits locally','Save as gif locally','Adjust Color','Personal Color Table','Send SOHO Archive-Planning','Send SOHO Archive-Summary'], $
	base00, $
	/row,/frame,xpad=2

base0=widget_base(base00, /row)
base1=widget_base(base00, /row)


filter_1d $SSW/trace/idl/util/filter_1d.pro
[Previous] [Next]
   Name: filter_1d

   Purpose: Filter y=f(x) vector (remove glitches).

   Input Parameters:
      x array, y array
 
   Optional Keyword Parameters:
      smth_wid                 - Smoothing width (default 100).
      passes			- Number of passes through y (default 1)
      n_of_sigs		- Number of sigmas used to eliminate bad data (default 3).

   Output:
      ix_good			- Array of indeces where y is good.
      y_good			- Array of good y values.
      y_padded                 - Array of good y values with bad values replaced by interpolated values.

   Calling Examples:
      filter_1d, x, y, smth_wid=50, passes=2, n_of_sigs=2, ix_good=ix_good, y_padded=y_padded

 CALLS: ***
	INTERPOL, STDEV
   History:
      Written 15-Apr-98 by F.Zele
	16-Apr-98 (MDM) - Changed into a function
			- Made "x" a keyword input


find_grid $SSW/trace/idl/egse/find_grid.pro
[Previous] [Next]
NAME:
	find_grid
PURPOSE:
	Determine the location of the grid crossing
SAMPLE CALLING SEQUENCE:
	find_grid, img, coord, angles, vals, coeff_arr
	find_grid, img, coord, angles, vals, coeff_arr, navg=25, /qplot, /qdeb
METHOD:
	The image must have a single vertical and single horiztonal
	grid.  The edge "navg" lines or columns are averaged and
	a GAUSS fit is performed to find the center.  The
	geometry is then used to find the center cross point
	coordinates
INPUT:
	img	- The image
OUTPUT:
	coord	- 2 element array with the coordinates of the grid
		  crossing
	angles	- 2 element array with the rotation angle.  If there
		  is no rotation, it should be [0, 90].  Angle is
		  in degrees counterclockwise.
	vals	- 2x4 element array with the X/Y coordinate for
		  the four cuts (top, right, bottom, left)
	coeff_arr- 6x4 element array with the 6 gaussfit coordinates
		  for the four cuts.
 CALLS: ***
	GAUSSFIT [1], GAUSSFIT [2], GAUSSFIT [3], GAUSSFIT [4], GAUSSFIT [5]
 CALLED BY:
	focus_trace [1], focus_trace [2], xdisp_fits, xdisp_trace [1], xdisp_trace2
	xdisp_trace3
OPTIONAL KEYWORD INPUT:
	navg	- The number of rows or columns to average
	qplot	- If set, then plot the gaussfit results
	qdebug	- If set, then print out intermediate results.
HISTORY:
	Written 18-Dec-96 by M.Morrison


focus_trace [2] $SSW/trace/idl/egse/focus_trace.pro
[Previous] [Next]
NAME:
	focus_trace
PURPOSE:
	To analyze a single set of TRACE grid target focus data
SAMPLE CALLING SEQUENCES:
	focus_trace, /get_files
	focus_trace, /get_files, /hc
	focus_trace, /get_files, /hc, /dark_sub
(or)
	ff = file_list('/td02/log/rawimage', '*')
	ss = wmenu_sel(ff)
	ff = ff(ss)
	focus_trace, ff
	focus_trace, ff, next=512, pos=[-40, -20, 15, 40]
	focus_trace, ff, dark_sub='filename'
INPUTS:
	ff	- files to read
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], FOCUS3, break_file [4]
	data_type [1], data_type [2], disp1focus [1], disp1focus [2], find_grid
	rd_trace_i0 [1], rd_trace_i0 [2], tr_decode_head [1], tr_decode_head [2]
	xrd_trace, yesnox [1], yesnox [2]
OPTIONAL KEYWORD INPUT:
	get_files- if set, then put up a menu prompt for the files
	hc	- make hardcopy
	next	- extract next x next pixels to search for grid (def = 300)
	pos	- An array with the focus position values
	dark_sub- The file name for the dark subtraction.
		  If using the "GET_FILES" option, it can be
		  simply set as an integer and you will be prompted
		  with a menu for the dark file name.
	xcen, ycen  - Center of extracted next x next sub-image.
		  Uses centered extract if xcen or ycen not given.
	ncr	- size of extract centered on grid crossing (def = 100)
	quad	- if set, use squared derivatives for sharpness, not abs()

HISTORY:
	Written 19-Sep-96 by M.Morrison
	21-Oct-96 (MDM) - Rename from trcfocus to focus_trace
			- Added documentation header
	31-Oct-96 (MDM) - Gutted some code and added call to XRD_TRACE
	16-Dec-96 (MDM) - Added DARK_SUB
			- Added writing out info about the frame
	25-Feb-97 (TDT)	- Derived from focus_trace to use focus3 for sharpness
	12-Mar-97 (TDT) - Ver 1.1 in title, fixed bug (hardcopy displaying img)
V2.0	 9-Jul-97 (MDM) - Renamed from focus3_trace to focus_trace
			- Patched extract 9:1032 code
V2.1	 9-Jul-97 (MDM) - Made the POS get the data out of DP header
V2.2	 9-Jul-97 (MDM) - Made hardcopy use proper title (progver)


focus_trace [3] $SSW/trace/idl/egse/focus_trace0.pro
[Previous] [Next]
NAME:
	focus_trace
PURPOSE:
	To analyze a single set of TRACE focus data
SAMPLE CALLING SEQUENCES:
	focus_trace, /get_files
	focus_trace, /get_files, /hc
	focus_trace, /get_files, /hc, /dark_sub
(or)
	ff = file_list('/td02/log/rawimage', '*')
	ss = wmenu_sel(ff)
	ff = ff(ss)
	focus_trace, ff
	focus_trace, ff, next=512, pos=[-40, -20, 15, 40]
	focus_trace, ff, dark_sub='filename'
INPUTS:
	ff	- files to read
OPTIONAL KEYWORD INPUT:
	get_files- if set, then put up a menu prompt for the files
	hc	- make hardcopy
	next	- extract the center "NxN" pixels
	pos	- An array with the focus position values
	dark_sub- The file name for the dark subtraction.
		  If using the "GET_FILES" option, it can be
		  simply set as an integer and you will be prompted
		  with a menu for the dark file name.
HISTORY:
	Written 19-Sep-96 by M.Morrison
	21-Oct-96 (MDM) - Rename from trcfocus to focus_trace
			- Added documentation header
	31-Oct-96 (MDM) - Gutted some code and added call to XRD_TRACE
	16-Dec-96 (MDM) - Added DARK_SUB
			- Added writing out info about the frame


focus_trace_flt $SSW/trace/idl/egse/focus_trace_flt.pro
[Previous] [Next]
NAME:
	focus_trace_flt
PURPOSE:
	To analyze a single set of TRACE focus images
SAMPLE CALLING SEQUENCES:
	focus_trace_flt, infiles, /get_files
	focus_trace_flt, infiles, /get_files, dark=dark
	focus_trace_flt, infiles, img, /get_files, dark=dark, pos=pos, labels=labels
	focus_trace_flt, labels, img, pos=pos, dark=dark, dfile='My Dark'
	focus_trace_flt, labels, img, pos=pos, dark=dark, next=300, ncr=200, xcen=400, ycen=400
INPUTS:
	infiles	- files to read if /get_files is set
		- otherwise list of labels to go with data in img
	img	- datacube of image data, in monotonic focus order
 CALLS: ***
	CONGRID [1], CONGRID [2], CONGRID [3], FOCUS3, RFITS2 [1], RFITS2 [2], TRACE_PREP
	XMENU_SEL [1], XMENU_SEL [2], disp1focus_flt, read_trace, trace_unspike
	yesnox [1], yesnox [2]
OPTIONAL KEYWORD INPUT:
	get_files- if set, then read 1-hour data files
	labels	- labels for images constructed from keywords
	hc	- make hardcopy
	next	- extract next x next pixels to search for grid (def = 400)
	pos	- An array with the focus position values
	dark	- 2-D array of dark image to be subtracted
	dfile	- label identifying dark
	xcen, ycen  - Center of extracted next x next sub-image.
		  Uses centered extract if xcen or ycen not given.
	ncr	- size of extract centered on grid crossing (def = 100)
	quad	- if set, use squared derivatives for sharpness, not abs()
	diagonal- if set, rotate images by -45 degrees before analyzing
	drift	- [delta_x,delta-y] image motion between focus steps
		  Roughly [-9,2] for B (UV) quadrant and 20 focus steps
	unspike - remove cosmic rays; set to about 3. for EUV and 1216 prominences

HISTORY:
	Written 19-Sep-96 by M.Morrison
	21-Oct-96 (MDM) - Rename from trcfocus to focus_trace
			- Added documentation header
	31-Oct-96 (MDM) - Gutted some code and added call to XRD_TRACE
	16-Dec-96 (MDM) - Added DARK_SUB
			- Added writing out info about the frame
	25-Feb-97 (TDT)	- Derived from focus_trace to use focus3 for sharpness
	12-Mar-97 (TDT) - Ver 1.1 in title, fixed bug (hardcopy displaying img)
V2.0	 9-Jul-97 (MDM) - Renamed from focus3_trace to focus_trace
			- Patched extract 9:1032 code
V2.1	 9-Jul-97 (MDM) - Made the POS get the data out of DP header
V2.2	 9-Jul-97 (MDM) - Made hardcopy use proper title (progver)
V2.3	10-Jul-97 (TDT)	- NOGRID option: can work on any image
			- DIAGONAL option: rotates images -45 degrees
			- DRIFT option:  compensate image motion with focus
V2.4	19-Apr-97 (TDT) - change to reading flat fits files
V2.5	19-Apr-97 (TDT) - flight version for D-Day; dark must be an array