qBar $SSW/smei/ucsd/sat/idl/widget/qbar/qbar.pro
[Previous] [Next]
 NAME:
	qBar
 PURPOSE:
	Make bar graph or histogram plot
 CATEGORY:
	Widget
 CALLING SEQUENCE:
	qBar, array [, /histogram, xtitle=xtitle, ytitle=ytitle, title=title]
 INPUTS:
	array			array; type: any
						array for which a bargraph or histogram is to be made
 OPTIONAL INPUT PARAMETERS:
	/histogram		if set, the IDL histogram is called with argument 'array'
						The output from histogram is plotted as bargraph
	title =title	scalar; type: string; default: BIN
						main plot title (at top of plot)
	xtitle=xtitle	scalar; type: string
						title for x-axis
	ytitle=ytitle	scalar; type: string
						title for y-axis
 OUTPUTS:
	(plot in widget)
 CALLS: ***
	CW_FIELD, FILEPATH, InitVar, IsDisplay, IsType, QBAR_EVENT, QBAR_REDRAW, XMANAGER
	XREGISTERED, bargraph, qBar_Print
 CALLED BY:
	qGlitch_Show, qImage_cw_Histogram, vu_whatis
 RESTRICTIONS:
	The average and median are calculated over the bins actually
	displayed. Note that this will only be part of the total
	distribution depending on how the minimum and maximum bin
	values are selected.
 PROCEDURE:
	bargraph does the actual plotting
 MODIFICATION HISTORY:
	APR-2000, Paul Hick (UCSD/CASS)
	SEP-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added max keyword to IDL histogram calls


qBar_Print $SSW/smei/ucsd/sat/idl/widget/qbar/qbar_print.pro
[Previous] [Next]
 NAME:
	qBar_Print
 PURPOSE:
	Print current qBar display
 CATEGORY:
	Widget qBar
 CALLING SEQUENCE:
	qBar_Print, state
 INPUTS:
	state			array[1]; type: structure
						qPlot state structure
 OUTPUTS:
	(hardcopy or EPS file)
 CALLS: ***
	Get_Page, QBAR_REDRAW, qSet_Page
 CALLED BY:
	qBar
 PROCEDURE:
	Call qSet_Page to set up output device.
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


QD_ELONG $SSW/smei/bham/idl/utils/qd_elong.pro
[Previous] [Next]
 NAME:
	QD_ELONG


 PURPOSE:
	Quick & dirty routine to calculate path of lines of a given
	elongation 


 CATEGORY:
	utils


 CALLING SEQUENCE:
	qd_elong, elong, longin, lat, longout


 INPUTS:
	elong	float	The elongation line desired.
	longin	float	The longitudes at which to calculate its
			latitude


 OUTPUTS:
	lat	float	The latitudes computed
	longout	float	The longitudes of those latitudes.


 CALLS: ***
	REVERSE
 CALLED BY:
	PE_GRID
 RESTRICTIONS:
	Care must be take with elongations > 90 to ensure that there
	are no discontinuities in the outputs (only do one side and
	start from the edge).


 MODIFICATION HISTORY:
	Original: 17/6/03; SJT
	Add dirty fix for the broken lines at 80 & 100: 24/7/03; SJT


QD_POSANG $SSW/smei/bham/idl/utils/qd_posang.pro
[Previous] [Next]
 NAME:
	QD_POSANG


 PURPOSE:
	Quick and dirty routine to compute tracks of specified
	position angles.


 CATEGORY:
	Utils


 CALLING SEQUENCE:
	qd_posang, pa, longin, lat, longout


 INPUTS:
	pa	float	The desired position angle (all 4 quadrants
			are generated)
	longin	float	The elongations at which to calculate its
			latitude


 OUTPUTS:
	lat	float	The latitudes computed
	longout	float	The longitudes of those latitudes.

 CALLS: ***
	REVERSE
 CALLED BY:
	PE_GRID
 RESTRICTIONS:
	Only angles between 0 and 90 exclusive really mean anything.


 MODIFICATION HISTORY:
	Original: 17/6/03; SJT


qEphem $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qephem/qephem.pro
[Previous] [Next]
 NAME:
	qEphem
 PURPOSE:
	Retrieves ephemeris information
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
	event		array[1]; type: structure
					event from state.wid_smei button
 OUTPUTS:
	Result		scalar; type: byte
					1B: display needs to be refreshed completely
						(by call to qImage_cw_Set_Value)
					0B: display does not need to be redrawn
 CALLS: ***
	CW_FIELD, FILEPATH, InitVar, IsType, QEPHEM_EVENT, TimeString, TimeSystem, TimeUnit
	XMANAGER, qEphem_State, unexpected_event
 CALLED BY:
	qImage_cw_Ephem
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qEphem_State $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qephem/qephem_state.pro
[Previous] [Next]
 NAME:
	qEphem_State
 PURPOSE:
	Gets positions from ephemeris
 CATEGORY:
	sat/widget/qephem
 CALLING SEQUENCE:
	FUNCTION qEphem_State, state, event, send=send, silent=silent
 INPUTS:
	state
 OPTIONAL INPUT PARAMETERS:
	/send
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	AngleUnits, BadValue, InitVar, IsType, TimeSet, big_eph, jpl_body, jpl_mag
	smei_star_info, smei_star_list
 CALLED BY:
	qEphem, qImage_cw_Ephem
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qFramestamp $SSW/smei/ucsd/sat/idl/widget/qview/qframestamp.pro
[Previous] [Next]
 NAME:
	qFramestamp
 PURPOSE:
	Calles compound widget to prompt for frame stamping information
 CATEGORY:
	Compound widget
 CALLING SEQUENCE:
	val = qFramestmap(chk_time)
 INPUTS:
	chk_time			integer 0 or 1
					will determine if the checkbox
					for 'Timestamp' is able to be
					manipulated.
					Call with 0 if frames do not have
					timestamp data available.
					Call with 1 if they do.
 OUTPUTS:
	Result				integer 0 if canceled or exited.
					array[3] with 3 string values
					Null if the checkbox is un-selected
					otherwise they contain the position
					for the timestamp in cardinal coords
					northeast, northwest, southeast, southwest
					the last element contains the user
					inputted string to be placed in
					the image frames.
 CALLS:
 CALLED BY
	mk_flick


qGlitch $SSW/smei/ucsd/sat/idl/widget/qglitch/qglitch.pro
[Previous] [Next]
 NAME:
	qGlitch
 PURPOSE:
	Search and (optionally) remove glitches from an image cube
 CATEGORY:
	Widget qGlitch
 CALLING SEQUENCE:
	qGlitch, group=group, frames, wid_frames=wid_frames, img_offset=img_offset,	$
		img_id=img_id, mask_smei_fov=mask_smei_fov
 INPUTS:
	group=group		scalar; type: long integer
						group leader passed to XMANAGER
	frames			array[n,m,k]; type: any
						image cube of k images of n x m pixels
 OPTIONAL INPUT PARAMETERS:
	wid_frames=wid_frames
					scalar; type: long integer
						if this is the widget ID of a valid ID then the user value
						of this widget should be an image cube.
						This image cube is used instead of the 'frames' argument.
	img_offset=img_offset
					array[2]; type: integer
						offset of images in cube; the offset is added to all pixel
						coordinates displayed in the qImage_cw compound widget.
	img_id=img_id	array[k]; type: integer
						by default images are numbered 0..k in the display made
						by qGlitch_Show. If img_id is specified then img_id[0,,k]
						is used instead
	/mask_smei_fov	if set the SMEI fov is not searched for glitches
 OUTPUTS:
	(to widgets)
 CALLS: ***
	CW_FIELD, FILEPATH, QGLITCH_EVENT, XMANAGER, qGlitch_Run, qImage_cw
 CALLED BY:
	qImage_Clean, qView_Glitch
 PROCEDURE:
	The state structure is as follows:

	state = {STATE_QGLITCH,		$
	wid_done		: 0L,			$		'Done' button
											user value: img_id; argument to qGlitch
	wid_run			: 0L,			$		'Run' button
											user value: frames array; only if 'frames' is specified
												as argument to qGlitch instead of 'wid_frames'
	wid_sum			: 0L,			$		cw_field
											user value: none
	wid_spot		: 0L,			$		cw_field
											user value: none
	wid_sigma		: 0L,			$		cw_field
											user value: Loc array; output from Find2DGlitch
	wid_min			: 0L,			$		cw_field
											user value: none
	wid_exclude		: 0L,			$		non-exclusive button
											user value: on/off status
	wid_remove		: 0L,			$		non-exclusive button
											user value: on/off status
	wid_qimage_cw	: 0L,			$		widget ID of qImage_cw compound widget
											user value: mask_smei_fov; keyword to qGlitch
	wid_frames		: 0L			$		widget ID of widget with the 'frames' array as user value.
											This may be state.wid_run (if the 'frames' array was
											passed as argument to qGlitch) or it may be the ID
											of some external widget (e.g, the wid_data widget
											from qView) if keyword 'wid_frames' was used.
	}
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qGlitch_Run $SSW/smei/ucsd/sat/idl/widget/qglitch/qglitch_run.pro
[Previous] [Next]
 NAME:
	qGlitch_Run
 PURPOSE:
	Search for glitches through an image cube
 CATEGORY:
	Widget qGlitch
 CALLING SEQUENCE:
	qGlitch_Run, state, event
 INPUTS:
	state		array[1]; type: structure
					qGlitch state structure
 OUTPUTS:
	(none)
 CALLS: ***
	BadValue, CV_COORD, Find2DGlitch, Inside_Wedge, destroyvar, gridgen, qGlitch_Show
	smei_camera
 CALLED BY:
	qGlitch
 SIDE EFFECTS:
 RESTRICTIONS:
	Find2DGlitch is incredibly memory intensive ....
 PROCEDURE:
	The call to Find2DGlitch is set up using values from the qGlitch widgets.
	The output of Find2DGlitch is passed to qGlitch_Show for display.
 STATE INFO USED:
	widget_control, state.wid_frames , get_uvalue=frames, /no_copy
	widget_control, state.wid_sum	 , get_value = SumWidth
	widget_control, state.wid_spot	 , get_value = SpotWidth
	widget_control, state.wid_sigma	 , get_value = SigmaThreshold
	widget_control, state.wid_min	 , get_value = MinThreshold
	widget_control, state.wid_exclude, get_uvalue= exclude
	widget_control, state.wid_remove , get_uvalue= remove
	widget_control, state.wid_qimage_cw, get_uvalue=mask_smei_fov
 STATE INFO MODIFIED:
	widget_control, state.wid_sigma  , set_uvalue=Loc   , /no_copy
	widget_control, state.wid_frames , set_uvalue=frames, /no_copy
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qGlitch_Show $SSW/smei/ucsd/sat/idl/widget/qglitch/qglitch_show.pro
[Previous] [Next]
 NAME:
	qGlitch_Show
 PURPOSE:
	Display results of a search for glitches through an image cube
 CATEGORY:
	Widget qGlitch
 CALLING SEQUENCE:
	qGlitch_Show, state, nGroup, pGroup, lGroup
 INPUTS:
	state			array[1]; type: structure
						qGlitch state structure
	nGroup			scalar; type: integer
	pGroup			array[nGroup]; type: integer
	lGroup			array[nGroup]; type: integer
						output from Find2DGlitch (called in qGlitch_Run)
						contains a description of the glitches found.
	fGroup
 OUTPUTS:
	(to qImage_cw compound widget)
 CALLS: ***
	ArrayLocation, Reset_Colors, qBar
 CALLED BY:
	qGlitch_Run
 PROCEDURE:
	The information returned from Find2DGlitch describes the glitches:
	there are nGroup glitches of lGroup pixels. The locations are
	specified in pGroup as indices into the Loc array stored as user
	value to state.wid_frames (also return from Find2DGlitch).
	For each glitch a circle is drawn on an image plane with the
	same size as the images searched for glitches. The image number
	is plotted next to the glitch.
 STATE INFO USED:
	widget_control, state.wid_sigma , get_uvalue=Loc   , /no_copy
	widget_control, state.wid_frames, get_uvalue=frames, /no_copy
 STATE INFO MODIFIED:
	widget_control, state.wid_frames, set_uvalue=frames, /no_copy
	widget_control, state.wid_sigma , set_uvalue=Loc   , /no_copy
	widget_control, state.wid_qimage_cw, set_value=template
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage $SSW/smei/ucsd/sat/idl/widget/qimage/qimage.pro
[Previous] [Next]
 NAME:
	qImage
 PURPOSE:
	Widget 'wrapper' for the compound widget qImage_cw
 CATEGORY:
	Widgets
 CALLING SEQUENCE:
	qImage, filter, image=image, group=group, img_offset=img_offset, wid_base=wid_base
 INPUTS:
	filter			scalar; type: string; default: *.*
						file name filter for file selection
						If the filter does not contain a wildcard (i.e. is the
						name of a single file) then an attempt is made to load
						the image from the file.
 OPTIONAL INPUT PARAMETERS:
	group=group		scalar; type: long integer
						group leader passed to XMANAGER
	image=image		array[n,m]; type: any
						image array to be displayed. If specified this image
						is displayed, overriding the filter specification.
	wid_base=wid_base
					scalar; type: long integer
						if this is the widget ID of a valid widget, then
						qImage assumes that it is an existing instance of
						itself and will use it to display the image
						Otherwise qImage will create a new instance.
 OUTPUTS:
	(to widget)
 CALLS: ***
	CW_FIELD, FILEPATH, GetFileSpec, IsType, QIMAGE_EVENT, SetFileSpec, XMANAGER, hide_env
	qImage_Clean, qImage_FileInfo, qImage_Gain, qImage_Pick, qImage_Save, qImage_Send
	qImage_TrackPeak, qImage_cw, unexpected_event
 CALLED BY:
	qImage_cw_Where, qView_Image, qView_SetBox
 PROCEDURE:
	The state structure is as follows:

	state = {STATE_QIMAGE,	$
		wid_send		: 0L, 	$		Row base widget
										user value: widget ID of widget to receive QIMAGE_SEND
											events (set by qImage_SendDestination)
		wid_exit		: 0L,	$		'Done' button
										user value: none
		wid_pick		: 0L,	$		'Image' button for selection of image file
										user value: none
		wid_filter		: 0L,	$		cw_field for entering file filter for image file selection
										user value: none
		wid_qimage_cw	: 0L,	$		compound widget qimage_cw
										user value: none
		wid_info		: 0L,	$		'Info' button to display information about the current image
										user value: string array containing information about image
		wid_clean		: 0L,	$
		wid_save		: 0L,	$
		foreign			: 0		$		set by qImage_SendDestination using keyword 'foreign'; controls how
										qImage reacts to QIMAGE_CW_UPDATE events from qImage_cw compound widget.
										foreign=0: ignore events
										foreign=1,2: call qImage_TrackPeak (used by the 'Track' option in qView).
		boxes			: fltarr(2,2,2)		$
		}
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_Clean $SSW/smei/ucsd/sat/idl/widget/qimage/qimage_clean.pro
[Previous] [Next]
 NAME:
	qImage_Clean
 PURPOSE:
	Removes glitches from single image
 CATEGORY:
	Widget qImage
 CALLING SEQUENCE:
	qImage_Clean, state, event
 INPUTS:
	state		array[1]; type: structure
					qImage state structure
	event		array[1]; type: structure
					event structure send by 'Clean' widget
 OUTPUTS:
	(none)
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	qGlitch, qImage_cw_Box, qImage_cw_BoxImage
 CALLED BY:
	qImage
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
	APR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw.pro
[Previous] [Next]
 NAME:
	qImage_cw
 PURPOSE:
	Also contains qImage_cw_Event
	Display and manipulate single image
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	wid = qImage_cw(wid_parent, uvalue=uvalue)
 INPUTS:
	wid_parent			scalar; type: long integer
						ID of the parent widget
 OPTIONAL INPUT PARAMETERS:
	uvalue=uvalue	anything; user-defined
 OUTPUTS:
	(none)
 CALLS: ***
	CW_FIELD, InitVar, IsType, QIMAGE_CW_EVENT, qImage_cw_Box, qImage_cw_CrossSection
	qImage_cw_Ephem, qImage_cw_Mouse, qImage_cw_SMEI, qImage_cw_Save
	qImage_cw_Slider, qImage_cw_SmeiMask, qImage_cw_Tool, qImage_cw_Update
	qImage_cw_WedgeSection, qImage_cw_Where, qImage_cw_ZUpdate, qTool_State [1]
	qTool_State [2], unexpected_event
 EXTERNAL:
	qImage_cw_state__define
 CALLED BY:
	qGlitch, qImage, qsmei_sky
 PROCEDURE:
	The state structure used is the following:

	state = {STATE_QIMAGE_CW,		$

		wid_win 		: lonarr( 2),	$		cw_field's for window size (horizontal and vertical)
												user value: actual size of current window
		wid_xyz			: lonarr(10),	$		cw_field's for positional and intensity (z-value)
												image information
												user value: none
				wid_xyz[8]		x-coordinate of center of mass (centroid)
									user value: array[2]; type: double: the centroid again
				wid_xyz[9]		y-coordinate of center of mass (centroid)
									user value: array[3]; type: float; background used for centroid
										calculation, # pixels in center area, # pixels in background area
		wid_draw_wrap	: 0L,			$
		wid_draw		: 0L,			$		draw widget; main display
		wid_blowup		: 0L,			$		draw widget; displays a small blowup centered on the current box
												user value: none
		wid_xcross		: 0L,			$		draw widget; displays horizontal cross section
												user value: none
		wid_ycross		: 0L,			$		draw widget: displays vertical cross section
												user value: none
		wid_image		: 0L,			$		base widget; 2nd child of the root widget
												user value: array[*,*,2], the image
		wid_xslide		: 0L,			$		slider for moving the center of the display horizontally
												user value: scalar; horizontal index of pixel in magnified image
														at lower left corner of window
		wid_yslide		: 0L,			$		slider for moving the center of the display vertically
												user value: scalar; vertical index of pixel in magnified image
														at lower left corner of window

		wid_tool		: 0L,			$		non-exclusive button: on/off button for tool widget
												user value: the state of the tool widget
		wid_smei		: 0L,			$		non-exclusive button; on/off button for using wedge instead of square
												user value: 0 or 1; updated when button is pressed
		wid_smei_base	: 0L,			$
		wid_prorate		: lonarr(3),	$		non-exclusive button: on/off button for pro-rating z-values
												user value: 0 or 1; updated when button is pressed
		wid_center		: lonarr(2),	$		cw_field's for the center of the SMEI fov
												get: qimage_cw_box, qimage_zupdate
												user value: none
		wid_phi			: lonarr(4),	$		cw_field's for setting the azimuthal extent of a wedge
												(min- and max azimuth, azimuth step size
												[0:1]: min & max azimuth: get/set in qimage_cw_box
												[2  ]  azimuthal step size: get in qimage_cw_wedgesection
												[3  ]: centroid azimuth	: set in qimage_cw_zupdate
												user value: none
		wid_rad			: lonarr(4),	$		cw_field's for setting the radial extent of a wedge
												(min- and max radius, radial step size
												[0:1]: min & max radius	: get/set in qimage_cw_box
												[2  ]: radial step size	: get in qimage_cw_wedgesection
												[3  ]: centroid radius	: set in qimage_cw_zupdate
												user value: none
		wid_azimuthal	: 0L,			$		button for initiating qLine widget for azimuthal section
												user value: none
		wid_radial		: 0L,			$		button for initiating qLine widget for radial section
												user value: none
		wid_smeifov		: 0L,			$		button for resetting wedge size to the full SMEI fov
												user value: none
		wid_smeimask	: 0L,			$		user value: none
												button for writing mask for SMEI fov to file
		wid_cos			: 0L,			$		non-exclusive button for activating cosine correction
												user-value: current setting
		wid_axis		: lonarr(2),	$		cw_field widgets for position of optical axis
												user value: none
		wid_background	: 0L,			$		cw_field widgets for constant pedestal
												user value: extra pedestal used for centroid calculation
		wid_zavg2back	: 0L,			$		button for transferring current average to wid_background
												user value: none
		img_size		: intarr(2),	$		array[2]; dimensions of the image on display
													set: qImage_cw, qImage_cw_Set_Value
		img_offset		: intarr(2)		$		array[2]; position of lower left corner of image
													on display if extracted from a larger image
													the offset iz [0,0] unless set by the widget
													calling qImage_cw
	}
 MODIFICATION HISTORY:
	JAN-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_Blowup $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_blowup.pro
[Previous] [Next]
 NAME:
	qImage_cw_Blowup
 PURPOSE:
	Get small portion of image in main draw widget and put it in the small
	draw widget at the top right
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	qImage_cw_Blowup, state, image, edge
 INPUTS:
	state			array[1]; type: structure
						qImage_cw state structure
 OUTPUTS:
	(to state.wid_blowup draw widget)
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	MagnifyArray, qImage_cw_Box, qImage_cw_BoxImage, qImage_cw_Property
	qImage_cw_Transform
 CALLED BY:
	qImage_cw_Update
 PROCEDURE:
	The current box setting is setting is extracted using qImage_cwBox.
	A small section centered on the box center is extracted from the curren
	image and is put in the blowup draw widget.
	If the current box is very close to the edge than the blowup will be
	shifted relative to the center to prevent it from moving outside the
	image boundary.
 STATE INFO USED:
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_Box $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_box.pro
[Previous] [Next]
 NAME:
	qImage_cw_Box
 PURPOSE:
	Set or retrieve the values of the current box boundaries
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	qImage_cw_Box, state, box, fullsize=fullsize, oldbox=oldbox, get=get, nobox=nobox
	qImage_cw_Box, state, box, /center
 INPUTS:
	state			array[1]; type: structure
						qImage_cw state structure
	box				array[2,2]; type: integer
						defines two corners of box in the form [ [x1,y1], [x2,y2] ]
 OPTIONAL INPUT PARAMETERS:
	/polar			get a box in polar coordinates; then use it to update
					the box widgets.
					The box in polar coordinates is selected as
					- keyword p_box if /put is set
					- set to the SMEI fov is /smeifov is set
					- read from the polar box widgets in the SMEI widget section
					The polar box is then used to update all box widgets as if
					/put was set.

	If /put and /polar are set:

	p_box=p_box		array[2,2]; float
						limiting values in azimuth and radius of the wedge-shaped
						area corresponding to the two corners of 'box'
						in the form [[angle1,radius1],[angle2,radius2]].
						Angle1 and angle2 are in radians between [-!pi,+!pi].
						The wedge runs counterclockwise from 'angle1' to 'angle2'
						over less than 180 degrees: either angle2 > angle1 with
						angle2-angle1 < !pi or angle2 < angle1 with
						angle+2*!pi-angle1 < !pi. Always radius1 < radius2.

						The pixel coordinates of the two corners are rounded to the
						nearest integer value.

	/smeifov		setting /smeifov, implies setting /polar and /put.
						Selects the full SMEI fov (retrieved from the widget).

	/fullsize		setting this keyword is the same as setting box to the full size of the
						image: box = [ [0,0], [state.img_size-1] ]
	/get			retrieves the current settings, and returns them in 'box'
	/put			updates the current setting using the values in 'box'
						(this is the default if neither /put nor /get are set)
	/center			if set then the center for polar transformations is returned
						(with the state.img_offset subtracted) in 'box'.
						'p_box' returns the full SMEI FOV.

 OUTPUTS:
	If keyword /get is set:

	box				array[2,2]; type: integer
						defines two corners of box in the form [ [x1,y1], [x2,y2] ]
	p_box=p_box		array[2,2]; float
						limiting values in azimuth and radius of the wedge-shaped
						area corresponding to the two corners of 'box'
						in the form [[angle1,radius1],[angle2,radius2]].
						Angle1 and angle2 are in radians between [-!pi,+!pi].
						The wedge runs counterclockwise from 'angle1' to 'angle2'
						over less than 180 degrees: either angle2 > angle1 with
						angle2-angle1 < !pi or angle2 < angle1 with
						angle+2*!pi-angle1 < !pi. Always radius1 < radius2.

	If keyword /center is set:

	box				array[2]; type: integer
						the pixel coordinates of the center used for polar transformations
	p_box=p_box		array[2,2]; float
						limiting values in azimuth and radius of the fov
						in the form [[angle1,radius1],[angle2,radius2]].
						Angle1 and angle2 are in radians between [-!pi,+!pi].
						The fov runs counterclockwise from 'angle1' to 'angle2'.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CV_COORD, InitVar
 CALLED BY:
	qImage_Clean, qImage_Gain, qImage_SendInfo, qImage_TrackPeak, qImage_cw
	qImage_cw_Blowup, qImage_cw_BoxCosine, qImage_cw_CrossSection
	qImage_cw_DrawCross, qImage_cw_Ellipse, qImage_cw_Histogram, qImage_cw_Mouse
	qImage_cw_SMEI, qImage_cw_Set_Value, qImage_cw_Show, qImage_cw_Slider
	qImage_cw_SmeiMask, qImage_cw_Tool, qImage_cw_Update, qImage_cw_Wedge
	qImage_cw_WedgeSection, qImage_cw_ZEllipse, qImage_cw_ZUpdate
	qImage_cw_ZWedge
 SIDE EFFECTS:
	The pixel values displayed in the widget are usually pixel coordinates in the draw widget
	where the image is displayed. If state.img_offset is set to a non-zero value this will
	be added to the displayed numbers.

	Generally the state.img_offset is set by the calling widget to a non-zero value when
	the image fed to qImage_cw is a portion of a bigger image, and the user wants to see
	pixel location in the bigger array displayed by qImage_cw (rather than pixel
	locations in the smaller subimage).
 PROCEDURE:
 >	Modification and retrieval of values in the widgets controlling the position of the box
	should be made with this routine only !!!
 >	All sanity checks are made when the fields are updated. Retrieval is just a matter of
	reading the values of the wid_xyz[0:3] widgets.

 >	The numbers in the x,y widget represent a square section in the image, specified as
	minimum and maximum x and y values. The values are usually input by two mouse
	clicks, i.e. two opposite corners of the square as pairs [x1,y1] and [x2,y2].
	The point are then stored in the appropriate minimum and maximum x,y widgets.

 > The two corners of the box define a wedge-shaped area. The area is bounded by two
	circles and two radii (defined relative to the image center defined in the widget).
	Two of the corners of the wedge coincide with the two corners of 'box'.
 STATE INFO USED:
	widget_control, state.wid_xyz[0], get_value=get_value0
	widget_control, state.wid_xyz[1], get_value=get_value2
	widget_control, state.wid_xyz[2], get_value=get_value1
	widget_control, state.wid_xyz[3], get_value=get_value3

	state.img_size			dimensions of array on display
	state.img_offset		an offset between the pixel numbers displayed in the
							x,y widgets and the pixel coordinate in the image
							(see SIDE EFFECTS above).
 STATE INFO MODIFIED:
	widget_control, state.wid_xyz[0], set_value=set_value[0]
	widget_control, state.wid_xyz[2], set_value=set_value[1]
	widget_control, state.wid_xyz[1], set_value=set_value[2]
	widget_control, state.wid_xyz[3], set_value=set_value[3]
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_BoxCosine $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_boxcosine.pro
[Previous] [Next]
 NAME:
	qImage_cw_BoxCosine
 PURPOSE:
	Applies geometric corrections to intensities in SMEI fov
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	img_box = qImage_cw_BoxCosine(state, img_box, box)
	img_box = qImage_cw_BoxCosine(state, img_box, pfov=pfov)
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
	img_box			array[n,m]; type: float
					pixel values in area to be corrected
	box			array[2,2]; type: integer
					pixel coordinates of lower-left and upper-right corners
					of area to be corrected. The coordinates must be
					relative to the lower-left corner of the image on display
					(i.e. after subtracting state.img_offset)
	pfov		array[2,n,m]; type: float
					polar coordinates of pixels in img_box
					Pixels outside the field of view should be marked with
					BadValue(0.0)
					If 'pfov' is used then 'box' is not used and need not be present
 OUTPUTS:
	img_box
				array[*,*]; type: same as input 'img_box'
					corrected subarray
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CV_COORD, InitVar, Inside_Wedge, IsType, SubArray, SuperArray, gridgen, qImage_cw_Box
 CALLED BY:
	qImage_cw_BoxImage, qView_PlotSeries
 PROCEDURE:
 STATE INFO USED:
	widget_control, state.wid_axis[0], get_value=phi
	widget_control, state.wid_axis[0], get_value=phi
	widget_control, state.wid_axis[1], get_value=rad
 MODIFICATION HISTORY:
	MAR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_BoxImage $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_boximage.pro
[Previous] [Next]
 NAME:
	qImage_cw_BoxImage
 PURPOSE:
	Extracts an area from the current image
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	status = qImage_cw_BoxImage(state, box, sub_img=sub_img, sub_box=sub_box)
	status = qImage_cw_BoxImage(state, box, image=image, sub_img=sub_img)
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
	box			array[2,2]; type: integer
					area to be extracted from the original image
					if not specified then box = [[0,0], [n-1,m-1]] (the full
					image or screen) is assumed.

					/screen NOT set:
					The box is specified as pixel indices into the original
					image, but can extend outside the image, or even lie
					completely outside the image.
 OPTIONAL INPUT PARAMETERS:
	/screen		if set the extraction is done for the byte-scaled image on the display
					rather than the raw image
	image=image	array[n,m]; type: float
					array to be used as current image, instead of the user value
					of state.wid_image
					(this keyword is used only in qImage_cw_Set_Value)
 OUTPUTS:
	status		scalar; type: byte
					0: if 'box' does not include any pixels inside the image
					1: if a valid 'sub_img' was extracted
 OPTIONAL OUTPUT PARAMETERS:
	sub_img=sub_img
				array[*,*]; type: same as current image
					subarray containing requested area
	sub_box=sub_box
				array[2,2]; box with indices into 'image' of elements
					returned in sub_img
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar, IsType, qImage_cw_BoxCosine, qImage_cw_Property
 CALLED BY:
	qImage_Clean, qImage_cw_Blowup, qImage_cw_CrossSection, qImage_cw_DrawCross
	qImage_cw_Histogram, qImage_cw_Set_Value, qImage_cw_Update, qImage_cw_ZEllipse
	qImage_cw_ZUpdate, qImage_cw_ZWedge
 PROCEDURE:
	The pedestal from the value of the state.background widget is subtracted
 STATE INFO USED:
	widget_control, state.wid_background, get_value=pedestal1
	widget_control, state.wid_image, get_uvalue=image, /no_copy
 STATE INFO MODIFIED:
	widget_control, state.wid_image, set_uvalue=image, /no_copy
 MODIFICATION HISTORY:
	MAR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_BoxZoom $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_boxzoom.pro
[Previous] [Next]
 NAME:
	qImage_cw_BoxZoom
 PURPOSE:
	Prepare zoomed part of image that fits on screen
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
	state			array[1]; type: structure
						qImage_cw state structure
	sub_img 		array[n,m]; type: any
						part of original image to be put on screen
	sub_box 		array[2,2]; type: integer
						box with indices of part of original image
						stored in sub_img
	screen			array[2]; type: integer
						screen size (# hor and vert pixels)
	zoom			scalar; type: integer
						the zoom factor (can be < 0)
 OPTIONAL INPUT PARAMETERS:
	/xzoom
	/yzoom
 OUTPUTS:
	sub_img 		array[n,m]; type: any
	sub_box 			box with location on screen where sub_img is
						to put.
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
 CALLS: ***
	InitVar, MagnifyArray, qImage_cw_Transform
 CALLED BY:
	qImage_cw_DrawCross, qImage_cw_Set_Value
 PROCEDURE:
 MODIFICATION HISTORY:
	MAY-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_CrossSection $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_crosssection.pro
[Previous] [Next]
 NAME:
	qImage_cw_CrossSection
 PURPOSE:
	Displays the horizontal and vertical cross-sections in a separate qLine widget.
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
 INPUTS:
	state			array[1]; type: structure
						qImage_cw state structure
	event		array[1]; type: structure
					event from state.wid_xcross or state.wid_ycross widgets
 OUTPUTS:
	(to qLine)
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	qImage_cw_Box, qImage_cw_BoxImage, qImage_cw_Property, qLine
 CALLED BY:
	qImage_cw
 PROCEDURE:
	The cross section is calculate the same way as for the curves
	plotted along the main draw widget in qImage_cw.
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_ctable $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_ctable.pro
[Previous] [Next]
 NAME:
	qImage_cw_ctable
 PURPOSE:
	Change color table used in draw widget
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	qImage_cw_ctable, state
 INPUTS:
	state			scalar, structure
					contains IDs for all qView widgets
 OUTPUTS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	IsType, LOADCT
 CALLED BY:
	qImage_cw_Set_Value, qImage_cw_Show, qImage_cw_Tool
 PROCEDURE:
 MODIFICATION HISTORY:
	MAY-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_DrawCross $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_drawcross.pro
[Previous] [Next]
 NAME:
	qImage_cw_DrawCross
 PURPOSE:
	Draw cross section across top and along left edge of main draw widget
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	qImage_cw_DrawCross, state
 INPUTS:
	state			array[1]; type: structure
						qImage_cw state structure
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	BadValue, IsType, qImage_cw_Box, qImage_cw_BoxImage, qImage_cw_BoxZoom
	qImage_cw_MinMax, qImage_cw_Property, qImage_cw_Transform
 CALLED BY:
	qImage_cw_Update
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 STATE INFO USED:
	widget_control, state.wid_xcross , get_value=window_number
	widget_control, state.wid_ycross , get_value=window_number
	widget_control, state.wid_xcross, get_uvalue=x, /no_copy
	widget_control, state.wid_ycross, get_uvalue=y, /no_copy
	widget_control, state.wid_tool  , get_uvalue=tool
 STATE INFO MODIFIED:
	widget_control, state.wid_xcross, set_uvalue=x, /no_copy
	widget_control, state.wid_ycross, set_uvalue=y, /no_copy
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_DrawEphem $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_drawephem.pro
[Previous] [Next]
 NAME:
	qImage_cw_DrawEphem
 PURPOSE:
	Mark locations in ephemeris on screen
 CATEGORY:
	sat/widget/qimage_cw
 CALLING SEQUENCE:
	PRO qImage_cw_DrawEphem, state, color=color
 INPUTS:
	state			array[1]; type: structure
						qImage_cw state structure
 OPTIONAL INPUT PARAMETERS:
	colot=color 	scalar; type: integer
						color in which to label locations
						(will be either !p.color or !p.background)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FXPAR [1], FXPAR [2], GetFileSpec, HEADFITS [1], HEADFITS [2], HEADFITS [3], IsType
	TimeOp, TimeSplit, TimeUnit, big_eph, destroyvar, qImage_cw_Ephem
	qImage_cw_Property, qImage_cw_Transform, smei_frm_where
 CALLED BY:
	qImage_cw_Update
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_Ellipse $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_ellipse.pro
[Previous] [Next]
 NAME:
	qImage_cw_Ellipse
 PURPOSE:
	Calculate boundary and bounding box for a wedge specified as two points
	in polar coordinates
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	Result = qImage_cw_Wedge(state, p_box, )
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
 OPTIONAL INPUT PARAMETERS:
	p_box		array[2,2]; type: float
					limiting values in phase angle and radius of the wedge
					in the form [[angle1,radius1],[angle2,radius2]].
					Angle1 and angle2 are in radians between [-!pi,+!pi].
					The wedge runs counterclockwise from 'angle1' to 'angle2'
					over less than 180 degrees: either angle2 > angle1 with
					angle2-angle1 < !pi or angle2 < angle1 with
					angle+2*!pi-angle1 < !pi. Always radius1 < radius2.

					If polar_box is not specified then the wedge specified in
					the qImage_cw widget is used.

					If polar_box is specified then the value is processed by qImage_cw_Box.
					This will update the qImage_cw widget, but will also slightly modify
					polar_box in such a way that the two corners of the wedge coincide with
					integer pixel locations (the values returned in 'box')
					(set /noupdate to bypass this step)
	/noupdate		Only used if polar_box is specified. Bypasses a call to
					qImage_cw_Box (which updates the position widgets).
 OUTPUTS:
	result		array[2,2]; type: integer
					corners of the smallest square in the image that completely encloses
					the wedge in pixel coordinates in the form [[x1,y1],[x2,y2].
					Always x1 <= x2, y1 <= y2.
 OPTIONAL OUTPUT PARAMETERS:
	wedge		array[2,n]; type: float
					boundary of wedge as a closed array (first=last point)
					in rectangular (pixel) coordinates.
	box			array[2,2]; type: float; default: content of X,Y position widgets in
					qImage_cw. Two points in the image plane, specified as pixel coordinate
					values in the same form as the bounding box.
					'box' is obtained by a call to qImage_cw_Box, and is not modified.
					If /noupdate is set then qImage_cw_Box is not called and 'box' will be undefined.
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	CV_COORD, InitVar, IsType, REVERSE, qImage_cw_Box
 PROCEDURE:
	The origin of the rectangular to polar transformation is the value of
	the state.wid_center widgets
	If p_box is specified, and keywords /noupdate and img_center are used then the state structure
	is not accessed.
 STATE INFO USED:
 STATE INFO MODIFIED:
	(none)
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_Ephem $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_ephem.pro
[Previous] [Next]
 NAME:
	qImage_cw_Ephem
 PURPOSE:
	Handles ephemeris access qImage_cw widget
 CATEGORY:
	sat/idl/widget/qimage_cw
 CALLING SEQUENCE:
	qImage_cw_Ephem, state, event
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, IsType, TimeSplit, destroyvar, qEphem, qEphem_State, qImage_cw_Property
 CALLED BY:
	qImage_cw, qImage_cw_DrawEphem
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_EphemKill [1] $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_ephemkill.pro
[Previous] [Next]
 NAME:
	qImage_cw_EphemKill
 PURPOSE:
	Destroys heap variables associated with qephem widget
 CATEGORY:
 CALLING SEQUENCE:
	PRO qImage_cw_EphemKill, wid_ephem
 INPUTS:
	wid_ephem
 OUTPUTS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	IsType, destroyvar
 PROCEDURE:
 MODIFICATION HISTORY:
	SEP-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added documentation


qImage_cw_EphemKill [2] $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_toolkill.pro
[Previous] [Next]
 NAME:
	qImage_cw_EphemKill
 PURPOSE:
	Destroys heap variables associated with qtool widget
 CATEGORY:
 CALLING SEQUENCE:
	PRO qImage_cw_ToolKill, wid_tool
 INPUTS:
	wid_tool
 OUTPUTS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	QIMAGE_CW_TOOLKILL, destroyvar
 PROCEDURE:
 MODIFICATION HISTORY:
	SEP-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added documentation


qImage_cw_Histogram $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_histogram.pro
[Previous] [Next]
 NAME:
	qImage_cw_Histogram
 PURPOSE:
	Starts the qBar widget in histogram mode using the section of the
	current image defined by the current box
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	qImage_cw_Histogram, state
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
 OUTPUTS:
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	qBar, qImage_cw_Box, qImage_cw_BoxImage
 CALLED BY:
	qImage_cw_Show, qImage_cw_Tool
 PROCEDURE:
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_ImageType $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_imagetype.pro
[Previous] [Next]
 NAME:
	qImage_cw_ImageType
 PURPOSE:
 CATEGORY:
 CALLING SEQUENCE:
	FUNCTION qImage_cw_ImageType, state, event, time=time, name=name
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	IsType, smei_frm_name
 SEE ALSO:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 EXAMPLE:
 PROCEDURE:
 MODIFICATION HISTORY:
	DEC-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_MinMax $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_minmax.pro
[Previous] [Next]
 NAME:
	qImage_cw_MinMax
 PURPOSE:
	Scale an array of function values to a given range
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	Result = qImage_cw_MinMax(state, fnc_val)
 INPUTS:
	state			array[1]; type: structure
						qImage_cw state structure
	fnc_val			array; type: any
 OUTPUTS:
	Results			array; type; same as fnc_val
						function values scaled to given range
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar, IsType
 CALLED BY:
	qImage_cw_DrawCross, qImage_cw_Set_Value, qView_Movie, qView_Save2File
	qView_Wall
 PROCEDURE:
	If the 'FixZ' option is off then the minimum and maximum used are the minimum and
	maximum of the fnc_val array. If 'FixZ' is on the the values from the qTool widget
	are used.
	The returned array is
		(fnc_val < zmax) > zmin
	or (if log scale is used, as indicated by the state.wid_tool widget)
		(alog10((fnc_val-zmin+1) > 1)) < alog10(zmax-zmin+1)
 STATE INFO USED:
	widget_control, state.wid_tool, get_uvalue=tool_state, /no_copy
 STATE INFO MODIFIED:
	(none)
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_Mouse $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_mouse.pro
[Previous] [Next]
 NAME:
	qImage_cw_Mouse
 PURPOSE:
	Processes mouse press, release and motion messages from the draw widget.
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	qImage_cw_Mouse, state, event
 INPUTS:
	state			scalar, structure
					contains IDs for all qView widgets
	event			scalar, structure
					event structure passed to qView_Event by XManager
 OUTPUTS:
	Updates the current box in the X,Y widgets, and update the user value
	of the state.wid_blowup widget
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	CV_COORD, qImage_cw_Box, qImage_cw_Transform, qImage_cw_Update
 CALLED BY:
	qImage_cw
 PROCEDURE:
	First mouse click defines the first corner of a box,
	The box boundary changes tracking dragging of the mouse.
	The second click defines the second corner.
	Roam mode:
		when the box is completed (2nd click), then continued dragging
		causes the current box to track the mouse motion
	NOT in roam mode:
		fixes the box and leaves in the same position until the
		next click (which starts a new box).
 STATE INFO USED:
	widget_control, state.wid_tool, get_uvalue=tool, /no_copy
	widget_control, state.wid_smei, get_uvalue=set
 STATE INFO MODIFIED:
	widget_control, state.wid_tool, set_uvalue=tool, /no_copy
 MODIFICATION HISTORY:
	JAN-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_Property $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_property.pro
[Previous] [Next]
 NAME:
	qImage_cw_Property
 PURPOSE:
	Extracts widget properties from state vector
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	r = qImage_cw_Property(state, /screen_size, /slider_origin, $
		/blowup_size, /image_size, window_nr=window_nr
 INPUTS:
	state	    array[1]; type: structure
					qImage_cw state structure
 OUTPUTS:
	result		depends on keyword selected
 OPTIONAL OUTPUT PARAMETERS:
	window_nr=window_nr
				window of draw widget (/screen_size set) or
				blowup window (/blowup_size set)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	GetFileSpec, IsType, TimeString, smei_TimePosn
 CALLED BY:
	qImage_cw_Blowup, qImage_cw_BoxImage, qImage_cw_CrossSection
	qImage_cw_DrawCross, qImage_cw_DrawEphem, qImage_cw_Ephem, qImage_cw_Save
	qImage_cw_Set_Value, qImage_cw_SmeiMask, qImage_cw_Transform
 PROCEDURE:
 MODIFICATION HISTORY:
	MAY-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_Save $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_save.pro
[Previous] [Next]
 NAME:
	qImage_cw_Save
 PURPOSE:
	Handles saving of image in image file
 CATEGORY:
	sat/idl/widget/qimage_cw
 CALLING SEQUENCE:
	qImage_cw_Save, state, event
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	GetFileSpec, qImage_cw_Property, qSave2File
 CALLED BY:
	qImage_cw
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_Set_Value $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_set_value.pro
[Previous] [Next]
 NAME:
	qImage_cw_Set_Value
 PURPOSE:
	'Set Value' function called by the widget event function when
	widget_control is used to set the value of the compound widget
 CATEGORY:
	Compound widget qImage
 CALLING SEQUENCE:
	qImage_cw_Set_Value, wid_root, image
 INPUTS:
	wid_root		scalar; type: long integer
						window ID of base widget of pImage
	image			array[n,m] or array[n,m,2]
						the image to be displayed
						array[n,m,1] contains the input image (without modifications)
						array[n,m,2] contains the input image (or a subsection
							if the zoom factor is unequal 1) converted to byte
 OUTPUTS:
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	BadValue, IsType, Reset_Colors, qImage_cw_Box, qImage_cw_BoxImage
	qImage_cw_BoxZoom, qImage_cw_MinMax, qImage_cw_Property, qImage_cw_Tool
	qImage_cw_Transform, qImage_cw_ctable
 PROCEDURE:

 STATE INFO USED:
	widget_info( wid_root, /child )
	widget_control, wid_child, get_uvalue=state, /no_copy
	widget_info(state.wid_draw,/valid_id)
	widget_control, state.wid_win[0], get_value=ix
	widget_control, state.wid_win[1], get_value=iy
	widget_control, state.wid_tool, get_value=tool_state, /no_copy
	widget_control, state.wid_zoomout, set_uvalue=anchor, /no_copy
	widget_control, state.wid_draw, get_value=wnew
 STATE INFO UPDATED:
	widget_control, state.wid_tool , set_uvalue=tool, /no_copy
	widget_control, state.wid_image, set_uvalue=image, /no_copy
	widget_control, wid_child      , set_uvalue=state, /no_copy
	widget_control, wid_root, send_event={QIMAGE_CW_UPDATE, id:0L, top:0L, handler:wid_root}

	state.img_size		image dimensions
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_Show $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_show.pro
[Previous] [Next]
 NAME:
	qImage_cw_Show
 PURPOSE:
	Handles zooming and rebinning in qImage_cw
 CATEGORY:
	sat/idl/widget/qimage_cw
 CALLING SEQUENCE:
	qImage_cw_Show, state, event
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, qImage_cw_Box, qImage_cw_Histogram, qImage_cw_Update, qImage_cw_ctable
	qShow
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_Slider $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_slider.pro
[Previous] [Next]
 NAME:
	qImage_cw_Slider
 PURPOSE:
	Process messages from the slider widgets
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	Result = qImage_cw_Slider(state)
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
 OUTPUTS:
	Result		scalar; type: byte
					1B: display needs to be refreshed completely
						(by call to qImage_cw_Set_Value)
					0B: display does not need to be redrawn
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	qImage_cw_Box
 CALLED BY:
	qImage_cw
 PROCEDURE:
 STATE INFO USED:
	widget_control, state.wid_tool, get_uvalue=tool
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_SMEI $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_smei.pro
[Previous] [Next]
 NAME:
	qImage_cw_SMEI
 PURPOSE:
	Creates/destroys the SMEI section of the qImage_cw widget
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	Result = qImage_cw_SMEI(state, event)
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
	event		array[1]; type: structure
					event from state.wid_smei button
 OUTPUTS:
	Result		scalar; type: byte
					1B: display needs to be refreshed completely
						(by call to qImage_cw_Set_Value)
					0B: display does not need to be redrawn
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	CW_FIELD, destroyvar, qImage_cw_Box, qImage_cw_Update, qImage_cw_smei_frm
	smei_camera
 CALLED BY:
	qImage_cw
 PROCEDURE:
	The SMEI button function acts as a toggle to create/destroy the
	SMEI section of the qImage_cw compound widget.
	While the SMEI section exists qImage_cw uses wedges instead of squares
	to calculate pixel values, centroids, etc.
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS)
	NOV-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added state.wid_corner fields


qImage_cw_smei_frm $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_smei_frm.pro
[Previous] [Next]
 NAME:
	qImage_cw_smei_frm
 PURPOSE:
 CATEGORY:
	sat/idl/widget/qimage_cw
 CALLING SEQUENCE:
	qImage_cw_smei_frm, state, event
 INPUTS:
	state			scalar, structure
					contains IDs for all pView widgets
	event			scalar, structure
					event structure passed to pView_Event by XManager
 OUTPUTS:
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar, IsType, flt_string
 CALLED BY:
	qImage_cw_SMEI
 RESTRICTIONS:
	What happens if image offset is non-zero?
 PROCEDURE:
 STATE INFO USED:
 STATE INFO MODIFIED:
 MODIFICATION HISTORY:
	MAY-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_SmeiMask $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_smeimask.pro
[Previous] [Next]
 NAME:
	qImage_cw_SmeiMask
 PURPOSE:
	Write bitmap to file specifying the current SMEI fov
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	qImage_cw_SmeiMask, state
 INPUTS:
	state			array[1]; type: structure
						qImage_cw state structure
	event			array[1]; type: structure
						event structure
 OUTPUTS:
	(binary file containing FOV mask)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CV_COORD, CheckDir, FILEPATH, GetFileSpec, Inside_Wedge, SetFileSpec, bin_write
	gridgen, qImage_cw_Box, qImage_cw_Property
 CALLED BY:
	qImage_cw
 SEE ALSO:
	smei_camera
 PROCEDURE:
	The output file will always have the extension .pph

	The file written contains a byte array with the dimensions of the input
	images (the FULL image, even if only a part of the image is being processed).
	The mask value will be zero outside and 1 inside the FOV.

	The FOV center and optical axis are taken from the appropriate widgets.
	The FOV size is determined from a call to SMEI_camera.
 MODIFICATION HISTORY:
	JAN-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_state__define $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_state__define.pro
[Previous] [Next]
 NAME:
	qImage_cw_state__define
 PURPOSE:
	Defines the state structure for the qImage_cw compound widget
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	state = {qImage_cw}
 INPUTS:
	parent			scalar; type: long integer
						ID of the parent widget
 OUTPUTS:
	(state structure)
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 EXTERNAL BY:
	qImage_cw
 PROCEDURE:
	The fields in the state structure are explained in qImage_cw (compound widget)
 MODIFICATION HISTORY:
	JAN-2000, Paul Hick (UCSD/CASS)
	JAN-2003, Paul Hick (UCSD/CASS)
		Changed structure elements img_size and img_offset from short to long integer.
		The short integer caused problems for large zoom factors: zoom*img_size gets very big.
		Added wid_smeimask.
	NOV-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added wid_corner


qImage_cw_Tool $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_tool.pro
[Previous] [Next]
 NAME:
	qImage_cw_Tool
 PURPOSE:
	Handles zooming and rebinning in qImage_cw
 CATEGORY:
	sat/idl/widget/qimage_cw
 CALLING SEQUENCE:
	qImage_cw_Tool, state, event
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, qImage_cw_Box, qImage_cw_Histogram, qImage_cw_Update, qImage_cw_ctable
	qTool
 CALLED BY:
	qImage_cw, qImage_cw_Set_Value
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_Transform $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_transform.pro
[Previous] [Next]
 NAME:
	qImage_cw_Transform
 PURPOSE:
	Coordinate transformation needed by qImage_cw widget
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	pnt_out = qImage_cw_Transfor(state, fromimage=pnt_in, /toscreen)
 INPUTS:
	state		array[1]: type: structure
					state structure of the qImage_cw compound widget
 OPTIONAL INPUT PARAMETERS:
	One of the following three MUST be specified:
	The units for all positions are the indices of the corresponding arrays.

	FromImage		array[2], array[2,n]; type: integer or float
						x and y position on the image displayed
	FromScreen		array[2], array[2,n]; type: integer or float
	FromBigImage	array[2], array[2,n]; type: integer or float

	Only one of the following should be specified
	/toimage		Convert to Image coordinates
	/tobigimage		Convert to BigImage coordinates
	/toscreen		Convert to Screen coordinates
					/image is the default if none is specified

	/parent			Only used when transforming TO Image coordinates
					i.e. if /toimage is set.
					If set then Screen or BigImage input coordinates are
					converted to the parent pixels in the original image in
					which they lie (this amounts to a 'round' operation).
	/boxedge		Should only be used when transforming a box (an integer 2x2
					element vector of the form [[xmin,ymin],[ymin,ymax]])
					in Image coordinates to Screen or BigImage coordinates.
					The result is a box in Screen or BigImage coordinates
					which bounds the area represented by the Image box.
 OUTPUTS:
	pnt_out		array[2] or array[2,*]; type: float
					requested coordinates. The array will have the same structure
					as the input array
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar, IsType, SyncDims, qImage_cw_Property
 CALLED BY:
	qImage_cw_Blowup, qImage_cw_BoxZoom, qImage_cw_DrawCross, qImage_cw_DrawEphem
	qImage_cw_Mouse, qImage_cw_Set_Value, qImage_cw_Update, qImage_cw_WedgeSection
	qImage_cw_Where
 PROCEDURE:
 >	Image[n,m]: this is the image fed to the qImage_cw
		(stored in the user value of state.wid_image)

	BigImage[N,M]: this is a magnified version of the input Image
		For magnification with factor zoom: N=zoom*n, M=zoom*m
		The zoom factor is stored in the struct in the user value of state.wid_tool.
		The coordinates of BigImage are related to the coordinates in Image by:

			pnt(BigImage) = (zoom-1)/2.0+zoom*pnt(Image)

	If zoom is odd then a pixel in Image (with integer coordinate values)
	is mapped exactly to a pixel in BigImage.

	If zoom is even then each pixel in Image is mapped midway between to
	pixels in the BigImage array.

	Screen[n,m]: this is the section of BigImage that is being displayed.

 STATE INFO USED:
	widget_control, state.wid_tool, get_uvalue=tool
 STATE INFO MODIFIED:
	None

 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_Update $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_update.pro
[Previous] [Next]
 NAME:
	qImage_cw_Update
 PURPOSE:
	Update display after the box in the x,y widgets is modified
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	qImage_cw_Update, state [, /fresh]
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
 OPTIONAL INPUT PARAMETERS:
	/fresh		If not set infomation from a previous qImage_cw_Update
				is used to redraw portions of the screen: an existing
				box, and the cross section at top and right are erased.
				If set then these redraw operations are not done. This
				options is used when a full screen has been redrawn
				after a call to qImage_cw_Set_Value.
 OUTPUTS:
	(screen updates)
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar, IsType, qImage_cw_Blowup, qImage_cw_Box, qImage_cw_BoxImage
	qImage_cw_DrawCross, qImage_cw_DrawEphem, qImage_cw_Transform, qImage_cw_Wedge
	qImage_cw_ZUpdate
 CALLED BY:
	qImage_Gain, qImage_TrackPeak, qImage_cw, qImage_cw_Mouse, qImage_cw_SMEI
	qImage_cw_Show, qImage_cw_Tool
 PROCEDURE:
	Once an image is put on the display by qImage_cw_Set_Value all updates
	to the display are made by calls to this procedure.
 STATE INFO USED:
	widget_info(state.wid_draw,/valid_id)
	widget_control, state.wid_tool , get_uvalue=tool, /no_copy
	widget_control, state.wid_draw , get_value=wdraw_main
	widget_control, state.wid_draw , get_uvalue=image_box, /no_copy
	widget_control, state.wid_smei , get_uvalue=set
 STATE INFO MODIFIED:
	widget_control, state.wid_draw , set_uvalue=image_box, /no_copy

	state.img_wedge	is set to 0 or 1 depending on whether or not a
		wedge was drawn on the display
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_Wedge $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_wedge.pro
[Previous] [Next]
 NAME:
	qImage_cw_Wedge
 PURPOSE:
	Calculate boundary and bounding box for a wedge specified as two points
	in polar coordinates
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	Result = qImage_cw_Wedge(state, p_box, /noupdate, wedge-wedge, box-box)
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
 OPTIONAL INPUT PARAMETERS:
	p_box		array[2,2]; type: float
					limiting values in phase angle and radius of the wedge
					in the form [[angle1,radius1],[angle2,radius2]].
					Angle1 and angle2 are in radians between [-!pi,+!pi].
					The wedge runs counterclockwise from 'angle1' to 'angle2'
					over less than 180 degrees: either angle2 > angle1 with
					angle2-angle1 < !pi or angle2 < angle1 with
					angle+2*!pi-angle1 < !pi. Always radius1 < radius2.

					If p_box is not specified then the wedge specified in
					the qImage_cw widget is used.

					If p_box is specified then the value is processed by qImage_cw_Box.
					This will update the qImage_cw widget, but will also slightly modify
					p_box in such a way that the two corners of the wedge coincide with
					integer pixel locations (the values returned in 'box')
					(set /noupdate to bypass this step)
	/noupdate		Only used if p_box is specified. Bypasses a call to
					qImage_cw_Box (which updates the position widgets).
 OUTPUTS:
	result		array[2,2]; type: integer
					corners of the smallest square in the image that completely encloses
					the wedge in pixel coordinates in the form [[x1,y1],[x2,y2].
					Always x1 <= x2, y1 <= y2.
 OPTIONAL OUTPUT PARAMETERS:
	wedge		array[2,n]; type: float
					boundary of wedge as a closed array (first=last point)
					in rectangular (pixel) coordinates.
	box			array[2,2]; type: float; default: content of X,Y position widgets in
					qImage_cw. Two points in the image plane, specified as pixel coordinate
					values in the same form as the bounding box.
					'box' is obtained by a call to qImage_cw_Box, and is not modified.
					If /noupdate is set then qImage_cw_Box is not called and 'box' will be undefined.
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar, IsType, qImage_cw_Box, wedge_bounding_box
 CALLED BY:
	qImage_cw_Update, qImage_cw_ZEllipse, qImage_cw_ZWedge, qView_PlotSeries
 PROCEDURE:
	The origin of the rectangular to polar transformation is the value of
	the state.wid_center widgets
	If p_box is specified, and keywords /noupdate and img_center are used then the state structure
	is not accessed.
 STATE INFO USED:
 STATE INFO MODIFIED:
	(none)
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS)
	FEB-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Split off the bounding box calculation into separate routine (wedge_bounding_box)


qImage_cw_WedgeSection $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_wedgesection.pro
[Previous] [Next]
 NAME:
	qImage_cw_WedgeSection
 PURPOSE:
	Calculate cross section in the azimuthal or radial directions in a wedge
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	qImage_cw_WedgeSection, state, f_values [, /radial, /azimuthal]
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
 OPTIONAL INPUT PARAMETERS:
	/azimuthal	if set then a cross section in the azimuthal direction is returned
	/radial		if set then a cross section in the radial direction is returned
					if neither or both are specified then both cross sections
					are returned
 OUTPUTS:
	result		array[4,*] or array[4,*,2]; type: float
					minimum, maximum, average and standard deviation are returned
					in array[0..3,*,*], respectively.
					If both /radial and /azimuthal then array[4,*,0] contains
					the azimuthal cross section and array[4,*,1] the azimuthal
					cross section.
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar, qImage_cw_Box, qImage_cw_Transform, qImage_cw_ZWedge, qLine
 CALLED BY:
	qImage_cw
 PROCEDURE:
 STATE INFO USED:
	state.img_wedge			used to determine whether a valid wedge is available
							from the last call to qImage_cw_Update
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_Where $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_where.pro
[Previous] [Next]
 NAME:
	qImage_cw_Where
 PURPOSE:
	Processes mouse press and release messages from the draw widget
	for the right mouse button only.
 CATEGORY:
	sat/idl/widget/qimage_cw
 CALLING SEQUENCE:
	qImage_cw_Where, state, event
 INPUTS:
	state			scalar, structure
					contains IDs for all pView widgets
	event			scalar, structure
					event structure passed to pView_Event by XManager
 OUTPUTS:
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
	@smei_roi_mask.pro
 CALLS: ***
	ArrayLocation, IsType, MagnifyArray, qImage, qImage_cw_Transform, smei_frm_name
	smei_frm_property, smei_setup_roi, who_am_i
 CALLED BY:
	qImage_cw
 RESTRICTIONS:
	What happens if image offset is non-zero?
 PROCEDURE:
 STATE INFO USED:
 STATE INFO MODIFIED:
 MODIFICATION HISTORY:
	MAY-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_ZEllipse $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_zellipse.pro
[Previous] [Next]
 NAME:
	qImage_cw_ZEllipse
 PURPOSE:
	Calculates the Z-values min, max, average and standard deviations
	for an ellipse in the image plane
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	qImage_cw_ZEllipse, state, box, zval=zval
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
 OPTIONAL INPUT PARAMETERS:
	box			array[2,2]; type:float
					limiting values in phase angle and radius of the wedge
					in the form [[angle1,radius1],[angle2,radius2]].
					Angle1 and angle2 are in radians between [-!pi,+!pi].
					The wedge runs counterclockwise from 'angle1' to 'angle2'
					over less than 180 degrees: either angle2 > angle1 with
					angle2-angle1 < !pi or angle2 < angle1 with
					angle+2*!pi-angle1 < !pi. Always radius1 < radius2.

					If p_box is not specified then the wedge specified in
					the qImage_cw widget is used.

	exclude_box=exclude_box
			array[2,2; type: float
					another wedge specified in the same way as p_box.
					This wedge should lie completely inside the p_box wedge.
					If this box is specified than the return values refer to the
					area in between the two wedges. This box is passed unmodified to
					Inside_Wedge.
					!!!!! If exclude_p_box is set then also /noupdate should be set:
					if /noupdate NOT set then p_box will be slightly modified, and
					exclude_p_box won't.

	/noupdate		Only used if polar_box is specified. This argument is passed to
					qImage_cw_Wedge where it bypasses a call to qImage_cw_Box
					(which updates the position widgets).

 OPTIONAL OUTPUT PARAMETERS:
	zval		array[4]; float
					minimum, maximum, average and standard deviation across the wedge
					if the wedge is empty then 4 x !values.f_nan is returned
	zpix		scalar; type: float or integer
					# pixels in wedge (non-integer values result from pro-rating)
					if the wedge is empty then zero is returned
	wedge		array[2,n]; type: float
					boundary of wedge as a closed array (first=last point)
					in rectangular (pixel) coordinates (output from qImage_cw_Wedge)
	centroid	array[2]; type: float
					centroid of the wedge
					if the wedge is empty then 2 x !values.f_nan is returned
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CV_COORD, CenterOfMass, Inside_Wedge, IsType, STDDEV, SuperArray, gridgen
	qImage_cw_Box, qImage_cw_BoxImage, qImage_cw_Wedge
 PROCEDURE:
 >	qImage_cw_Wedge is used to limit the part of the image to be included to the smallest
	square box including the whole wedge.
 >	Inside_Wedge applied to pixel centers (integer coordinate values) is used to find
	pixels entirely lying inside the wedge.
 > A similar test on pixel corners (half-integer coordinate values) in combination with
	the previous test is used to locate pixels which lie across the wedge boundary.
 >	These last group of pixels is subdivided in a 10x10 array of subpixels. A test on the
	centers on these subpixels is used to prorate the pixels with the ratio of subpixels
	inside the wedge and total number of pixels.
 >	The prorating can be switched of by setting the user value of state.wid_prorate to 0.
 >	Prorating is done only for the average value. Minimum, maximum and standard deviation
	are calculated with all pixels with centers inside the wedge weighted the same.
 STATE INFO USED:
	widget_control, state.wid_prorate, get_uvalue=set
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_cw_ZUpdate $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_zupdate.pro
[Previous] [Next]
 NAME:
	qImage_cw_ZUpdate
 PURPOSE:
	Updates fields in widget that need to be updated every time the selected
	box changes. This includes the Z-value widgets (Z-min, Z-max, Z-avg, Z-std)
	and the centroid widgets X-com, Y-com
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	qImage_cw_ZUpdate, state
 INPUTS:
	state		array[1]; type: structure
					pImage state structure
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	BadValue, CV_COORD, CenterOfMass, MEAN, STDDEV, qImage_cw_Box, qImage_cw_BoxImage
	qImage_cw_ZWedge
 CALLED BY:
	qImage_cw, qImage_cw_Update
 PROCEDURE:
	state.img_wedge	is checked to find out if the last call to
	qImage_cw_Update plotted a valid widget, instead of a square box.
	If it did then qImage_cw_ZWedge is called to calculate Z-values
	for the wedge. If not then Z-values are calculate using
	IDL function min, max, mean, and stddev (with the /nan keyword set).
 STATE INFO USED:
	widget_control, state.wid_smei, get_uvalue=smei_set
	widget_control, state.wid_center[0], get_value=x
	widget_control, state.wid_center[1], get_value=y
 STATE INFO MODIFIED:
	widget_control, state.wid_xyz[i+4], set_value=zval[i], i=0,3
	widget_control, state.wid_phi[3], set_value=centroid[0]*!radeg
	widget_control, state.wid_rad[3], set_value=centroid[1]
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS)
	NOV-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Fixed bug in calculating standard deviation (make sure there
	    are at least two good values to work with).


qImage_cw_ZWedge $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qimage_cw_zwedge.pro
[Previous] [Next]
 NAME:
	qImage_cw_ZWedge
 PURPOSE:
	Calculates the Z-values min, max, average and standard deviations
	for a wedge in the image plane
 CATEGORY:
	Compound widget qImage_cw
 CALLING SEQUENCE:
	zpix = qImage_cw_ZWedge(state, p_box, zval=zval)
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
 OPTIONAL INPUT PARAMETERS:
	p_box		array[2,2]; type:float
					limiting values in phase angle and radius of the wedge
					in the form [[angle1,radius1],[angle2,radius2]].
					Angle1 and angle2 are in radians between [-!pi,+!pi].
					The wedge runs counterclockwise from 'angle1' to 'angle2'
					over less than 180 degrees: either angle2 > angle1 with
					angle2-angle1 < !pi or angle2 < angle1 with
					angle+2*!pi-angle1 < !pi. Always radius1 < radius2.

					If p_box is not specified then the wedge specified in
					the qImage_cw widget is used.

	exclude_p_box=exclude_p_box
				array[2,2; type: float
					another wedge specified in the same way as p_box.
					This wedge should lie completely inside the p_box wedge.
					If this box is specified than the return values refer to the
					area in between the two wedges. This box is passed unmodified to
					wedge_content.
					!!!!! If exclude_p_box is set then also /noupdate should be set:
					if /noupdate NOT set then p_box will be slightly modified, and
					exclude_p_box won't.

	/noupdate		Only used if polar_box is specified. This argument is passed to
					qImage_cw_Wedge where it bypasses a call to qImage_cw_Box
					(which updates the position widgets).

	img_prorate=img_prorate
				array[2]; type: integer
					if set then pixels straddling the wedge boundary will be prorated
					by dividing them into img_prorate[0] x img_prorate[1] subpixels.
 OUTPUTS:
	zpix		scalar; type: float or integer
					# pixels in wedge (non-integer values result from pro-rating)
					if the wedge is empty then zero is returned
 OPTIONAL OUTPUT PARAMETERS:
	zval		array[4]; float
					minimum, maximum, average and standard deviation across the wedge
					if the wedge is empty then 4 x !values.f_nan is returned
	wedge		array[2,n]; type: float
					boundary of wedge as a closed array (first=last point)
					in rectangular (pixel) coordinates (output from qImage_cw_Wedge)
	centroid	array[2]; type: float
					centroid of the wedge
					if the wedge is empty then 2 x !values.f_nan is returned
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	BadValue, InitVar, IsType, qImage_cw_Box, qImage_cw_BoxImage, qImage_cw_Wedge
	wedge_content
 CALLED BY:
	qImage_cw_WedgeSection, qImage_cw_ZUpdate
 PROCEDURE:
 >	qImage_cw_Wedge is used to limit the part of the image to be included to the smallest
	square box including the whole wedge.
 >	Inside_Wedge applied to pixel centers (integer coordinate values) is used to find
	pixels entirely lying inside the wedge.
 > A similar test on pixel corners (half-integer coordinate values) in combination with
	the previous test is used to locate pixels which lie across the wedge boundary.
 >	These last group of pixels is subdivided in a 10x10 array of subpixels. A test on the
	centers on these subpixels is used to prorate the pixels with the ratio of subpixels
	inside the wedge and total number of pixels.
 >	The prorating can be switched of by setting the user value of state.wid_prorate to 0.
 >	Prorating is done only for the average value. Minimum, maximum and standard deviation
	are calculated with all pixels with centers inside the wedge weighted the same.
 STATE INFO USED:
	widget_control, state.wid_prorate, get_uvalue=set
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_FileInfo $SSW/smei/ucsd/sat/idl/widget/qimage/qimage_fileinfo.pro
[Previous] [Next]
 NAME:
	qImage_FileInfo
 PURPOSE:
	Display information about current image file
 CATEGORY:
	Widget qImage
 CALLING SEQUENCE:
	qImage_FileInfo, state
 INPUTS:
	state		array[1]; type: structure
					qImage state structure
 OUTPUTS:
	(to message dialog)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	IsType
 CALLED BY:
	qImage
 PROCEDURE:
	Displays the string stored in the user value of state.wid_info in
	a message dialog box when the state.wid_info is pushed.
	The user value is set by qImage_Pick.
 STATE INFO USED:
	widget_control, state.wid_info, get_uvalue=info
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_Gain $SSW/smei/ucsd/sat/idl/widget/qimage/qimage_gain.pro
[Previous] [Next]
 NAME:
	qImage_Gain
 PURPOSE:
	Assist qView widget in correcting for different gain through a sequence of images.
 CATEGORY:
	Widget qImage
 CALLING SEQUENCE:
	qImage_Gain, state
 INPUTS:
	state			array[1]; type: structure
						qImage state structure
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	qImage_cw_Box, qImage_cw_Update
 CALLED BY:
	qImage
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
	STILL UNDER DEVELOPMENT
 PROCEDURE:
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_Pick $SSW/smei/ucsd/sat/idl/widget/qimage/qimage_pick.pro
[Previous] [Next]
 NAME:
	qImage_Pick
 PURPOSE:
	Called by qImage_Event to select a new image using the IDL 'pickfile' dialog.
 CATEGORY:
	I/O
 CALLING SEQUENCE:
	status = qImage_Pick(state, image)
 INPUTS:
	state			scalar, type: structure
						the state structure for the qImage widget
 OUTPUTS:
	status		scalar; type: byte
					0: if no image read
					1: if image available
	image		array[n,m]; type: any
					2D array if image file succesfully read, or doesn't exist
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, GetFileSpec, IsType, SetFileSpec, img_read, unhide_env
 CALLED BY:
	qImage
 PROCEDURE:
 >	The value of state.wid_filter (displayed in the widget) is checked for
	wildcards.
 >	If a wildcard is found then the filter isused to initialize the 'pickfile'
	dialog, pick a file and read the file
 >	If no wildcard is present then the file is read
 >	The return value is 0 or 1 depending on whether an image was read succesfully.
 >	img_read is called with the /pseudo keyword set to reduce true color images to
	a 2D image array.
 >	The user value of state.wid_info is set with a string containing
	file name, image dimensions and (optionally) image info (if present).
 STATE INFO USED:
	widget_control, state.wid_filter, get_value=filter
 STATE INFO MODIFIED:
	widget_control, state.wid_info, set_uvalue=info, /no_copy
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS)
	MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added call to smei_buf_split_frame to handle SMEI L1A frame headers.


qImage_Save $SSW/smei/ucsd/sat/idl/widget/qimage/qimage_save.pro
[Previous] [Next]
 NAME:
	qImage_Save
 PURPOSE:
	Save current image to binary file
 CATEGORY:
	Widget qImage
 CALLING SEQUENCE:
	qImage_Save, state
 INPUTS:
	state		array[1]; type: structure
					qImage state structure
 OUTPUTS:
	(to disk file)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	qSave2File
 CALLED BY:
	qImage
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
	APR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_Send $SSW/smei/ucsd/sat/idl/widget/qimage/qimage_send.pro
[Previous] [Next]
 NAME:
	qImage_Send
 PURPOSE:
	Sent a QIMAGE_SEND event to the specified widget
 CATEGORY:
	Widget qImage
 CALLING SEQUENCE:
	qImage_Send, state, confirm=confirm, cancel=cancel
 INPUTS:
	state			array[1]; type: structure
						qImage state structure
 OPTIONAL INPUT PARAMETERS:
	/confirm		if set then user is prompted to confirm the sending of the event
	/cancel
 OPTIONAL OUTPUT PARAMETERS:
	cancel=cancel	set to 1B if the user canceled sending of the event.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, IsType, qImage_SendInfo
 CALLED BY:
	qImage
 PROCEDURE:
	Typically the user value of state.wid_send is the widget ID from a widget in the
	application calling pImage (e.g. qView).
	The event structure send is explained in qImage_SendStructure
 STATE INFO USED:
	widget_control, state.wid_send, get_uvalue=receive
	widget_control, wid_child, get_uvalue=qimage_cw_state, /no_copy
 STATE INFO MODIFIED:
	widget_control, wid_child, set_uvalue=qimage_cw_state, /no_copy
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_SendDestination $SSW/smei/ucsd/sat/idl/widget/qimage/qimage_senddestination.pro
[Previous] [Next]
 NAME:
	qImage_SendDestination
 PURPOSE:
	Set the destination of QIMAGE_SEND events for a qImage widget
 CATEGORY:
	Widget qImage
 CALLING SEQUENCE:
	qImage_SendDestination, wid_qimage, wid_receive, wid_send
	qImage_SendDestination, wid_qimage
 INPUTS:
	wid_qimage	scalar; type: long integer
					the widget ID of the qImage widget
 OPTIONAL INPUT PARAMETERS:
	wid_receive	scalar; type: long integer
					the widget ID of the widget to receive QIMAGE_SEND events
					If not specified then the previous "Send" destination is restored.
 OUTPUTS:
	wid_send	scalar; type: long integer
					the widget ID of the 'Send' widget in the qImage widget
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	IsType
 CALLED BY:
	qImage_TriggerSend, qView_Gain, qView_SetBox, qView_TrackPeak
 RESTRICTIONS:
	The widget ID used should be valid. There is no internal check for this.
 PROCEDURE:
	If there already is a "Send" destination this is saved by concatenating it to the
	input 'receive' value and storing the resulting 2-element array in the user value of
	'wid_send'. The original value is restored if 'receive' is not specified.
 STATE INFO USED:
	widget_control, wid_qimage, get_uvalue=qimage_state, /no_copy
	widget_control, wid_send, get_uvalue=receive, /no_copy
 STATE INFO MODIFIED:
	widget_control, wid_qimage, set_uvalue=qimage_state, /no_copy
	widget_control, wid_send, set_uvalue=receive, /no_copy
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_SendInfo $SSW/smei/ucsd/sat/idl/widget/qimage/qimage_sendinfo.pro
[Previous] [Next]
 NAME:
	qImage_SendInfo
 PURPOSE:
	Set up the event to be send by qImage to another widget
 CATEGORY:
	Widget qImage
 CALLING SEQUENCE:
	event = qImage_SendInfo(qimage_cw_state)
 INPUTS:
	qimage_cw_state		array[1]; type: structure
							qImage_cw state structure
 OUTPUTS:
	event				array[1]; type: structure
							QIMAGE_SEND event
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	qImage_SendStructure, qImage_cw_Box
 CALLED BY:
	qImage_Send
 PROCEDURE:
	The required information is extracted from the state structure
	and put into the event structure. The event structure is explained in
	qImage_SendStructure
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	FEB-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added optical axis to event structure


qImage_SendStructure $SSW/smei/ucsd/sat/idl/widget/qimage/qimage_sendstructure.pro
[Previous] [Next]
 NAME:
	qImage_SendStructure
 PURPOSE:
	Defines the structure used for QIMAGE_SEND events
 CATEGORY:
	Widgets qImage and qView
 CALLING SEQUENCE:
	S = qImage_SendStructure(dim=dim, offset=offset, box=box, subdim=subdim)
 OPTIONAL INPUT PARAMETERS:
	dim		= dim			see PROCEDURE
	offset	= offset		see PROCEDURE
	subdim	= subdim		see PROCEDURE
	box		= box			see PROCEDURE
 OUTPUTS:
	S		array[1]; type: structure
				event structure
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLED BY:
	qImage_SendInfo, qView_InitBox, qView_SetInfo
 PROCEDURE:
	Information from keywords is used to initialize some of the fields.
	The event structure has the following fields (in adddition to the three standard
	fields ID, TOP and HANDLER which are set to 0L).

	dim		array[2]; type: integer
				dimensions of the full images (as stored in image file)
	offset	array[2]; type: integer
				pixel coordinates of the lower left corner of the image cube
				currently loaded in memory
	subdim	array[2]; type: integer
				dimensions of the images in the current image cube
	box		array[2,2]; type: integer
				square area of pixels in the image, expressed as pixel coordinates
				in the full images (i.e. including 'offset');
				box[0:1,*] is the lower left corner; box[0:1,*] the upper right
				corner. Box is fully contained in the images in the current image cube.
	zval	array[4]; type: float
				min, max, average and standard deviation for the 'box' area
	zhilo	array[2]; type: float
				min and max used to limit the range of pixel values if 'fixz' is set.
	fixz	scalar; type: byte
				if set then 'zhilo' is used to limit the range of pixel values
				displayed in images and cross sections.
	zlog	scalar; type: byte
				if set then pixel values are displayed on a logarithmic scale
	zoom	scalar; type: integer
				zoom factor used in displaying a 'wall' view or and animation.

 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	FEB-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added optical axis p_axis to event structure.


qImage_TrackPeak $SSW/smei/ucsd/sat/idl/widget/qimage/qimage_trackpeak.pro
[Previous] [Next]
 NAME:
	qImage_TrackPeak
 PURPOSE:
	Assist qView widget in tracking of a peak through a sequence of images.
 CATEGORY:
	Widget qImage
 CALLING SEQUENCE:
	qImage_TrackPeak, state
 INPUTS:
	state			array[1]; type: structure
						qImage state structure
 OUTPUTS:
	(event send back to qView)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	BadValue, CV_COORD, flat_centerofmass, qImage_cw_Box, qImage_cw_Update
 CALLED BY:
	qImage
 PROCEDURE:
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qImage_TriggerSend $SSW/smei/ucsd/sat/idl/widget/qimage/qimage_triggersend.pro
[Previous] [Next]
 NAME:
	qImage_TriggerSend
 PURPOSE:
	Set up an interface with a qImage widget to force it to send a QIMAGE_SEND
	event to a specified widget.
 CATEGORY:
	Widget qImage
 CALLING SEQUENCE:
	Status = qImage_TriggerSend(state, event, wid_receive=wid_receive,	$
		wid_send=wid_send, send_event=send_event)
 INPUTS:
	event			array[1]; type: structure
						WIDGET_BUTTON event of QIMAGE_SEND event
	wid_qimage_id	scalar; type: long integer
						the user value of this widget should contain the widget ID
						of the qImage widget
	wid_receive		scalar; type: long integer
						widget ID of a widget to which QIMAGE_SEND events from
						qImage are to be send
 OUTPUTS:
	Status		scalar; type: byte
					0: no qImage widget exists, or event is not valid event (i.e. not
						a WIDGET_BUTTON or QIMAGE_SEND event
					1: indicates that a qImage widget exists and that 'send_event'
						needs to be send to 'wid_send'
					2: indicates that 'event' was a QIMAGE_SEND event
	wid_send	scalar; type: long integer
					widget ID of qImage 'Send' button to which 'send_event' is to dispatched.
	send_event	array[1]; type: structure
					empty WIDGET_BUTTON event to be dispatched to 'wid_send'
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	IsType, qImage_SendDestination
 CALLED BY:
	qView_Gain, qView_GetData, qView_Movie, qView_PlotSeries, qView_Save2File
	qView_TrackPeak, qView_Wall
 SIDE EFFECTS:
	The existing destination of QIMAGE_SEND events from the qImage widget (if there is one)
	is 'pushed' by appending it to 'wid_receive' and storing the resulting two-element array
	in the user value of the qImage 'Send' button widget. The value is restored again when the
	QIMAGE_SEND event arrives.
 RESTRICTIONS:
 PROCEDURE:
	The first event is a widget button event by e.g. the qView 'Animate' button.
	Check whether a qImage widget exists. If it does then make 'wid_receive' the widget
	to which qImage sends QIMAGE_SEND events; also pick up the widget ID of the 'Send'
	button widget of qImage: messages to this widget generate QIMAGE_SEND events.
	Pass the 'Send' widget ID and an empty message as return arguments in keywords
	'wid_send' and 'send_events'. These keywords are to be passed back to the main event handler
	and send from there before returning.

	The QIMAGE_SEND event send by qImage will end up here again. This is reported to the caller
	by returning status=2B.
 STATE INFO USED:
	widget_control, wid_qimage_id, get_uvalue=wid_qimage
 MODIFICATION HISTORY:
	MAR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine $SSW/smei/ucsd/sat/idl/widget/qline/qline.pro
[Previous] [Next]
 NAME:
	qLine
 PURPOSE:
	Plotting of curves
 CATEGORY:
	Widget qLine
 CALLING SEQUENCE:
	qLine, group=group, x, y, time=time, xsize=xsize, ysize=ysize, charsize=charsize,	$
		title		= title,		$
		xmargin		= xmargin,		$
		skip		= skip,			$
		newyaxis	= newyaxis,		$
		exact		= exact,		$
		ynozero		= ynozero,		$
		ylog		= ylog,			$
		linestyle	= linestyle,	$
		ytitle		= ytitle,		$
		use_sigma	= use_sigma,	$
		sigma_index	= sigma_index,	$
		plotstr		= plotstr
 OPTIONAL INPUT PARAMETERS:
	x			array[n] or array[m,n]; type: any
					if y is specified then x should be a 1-dim array with n x-coordinates
					if y is not specified then x[0,*] is used as x-coordinates, while
					x[1:m-1] are used as m-1 curves with n y-values
	y			array[m-1,n]
					m-1 curves with n y-values
					The x argument is used as x-coordinate

	time		= time		array[n]; type: time structure
								times corresponding to the n x-coordinates
	xsize		= xsize		scalar; type: integer; default: 640
	ysize		= ysize		scalar; type: integer; default: 480
								x and y size of plot window (device units)
	charsize	= charsize		scalar; type: float; default: 1
								character size
	plotstr		= plotstr	array[*]; type: string
								string array containing plot commands to be executed
								added to the display (executed using the IDL 'execute' command).
	group		= group		scalar; type: long integer
								widget ID of group leader if widget is called from other widget

 	The remaining keywords determine the initial display. All of these can be modified
	once the widget is displayed:

	title		= title		scalar; type: string
								main plot title
	xmargin		= xmargin	array[2]; type: integer
								same as IDL xmargin keyword
	skip		= skip		array[m]; type: byte
								0B: don't plot the curve
								1B: plot the curve
	newyaxis	= newyaxis	array[m]; type: byte
								0B: if existing y-axis is to be used
								1B: if new y-axis is to be drawn
	exact		= exact		array[m]; type: byte
								0B: if no exact y-axis needs to be drawn
								1B: if exact y-axis is needed
	ynozero		= ynozero	array[m]; type: byte
								same convention as IDL ynozero keyword
	ylog		= ylog		array[m]; type: byte
								0B: for linear y-axis
								1B: for logarithmic y-axis
	linestyle	= linestyle	array[m]; type: integer
								same convention as IDL linestyle keyword
	ytitle		= ytitle	array[m]; type: string
								titles for y-axis
	sigma_index	= sigma_index	array[m]; type: integer
								index of timeseries to be used as standard deviation
								(first index is 1)
	use_sigma	= use_sigma		array[m]; type: integer
								0: do not plot standard deviations
								1: plot standard deviations
 OUTPUTS:
	(screen or printer)
 CALLS: ***
	BadValue, CW_FIELD, FILEPATH, InitVar, IsTime, IsType, QLINE_EVENT, XMANAGER
	qLine_Curve, qLine_Fit, qLine_FitDraw, qLine_IsX, qLine_Kill, qLine_NewYAxis
	qLine_Print, qLine_Read, qLine_Sequence, qLine_Skip, qLine_Structure, qLine_Write
	qLine_XBase, qLine_YAction, qLine_YBase
 CALLED BY:
	qImage_cw_CrossSection, qImage_cw_WedgeSection, qNagoya_Plot, qView_ApplyGain
	qView_PlotSeries, qView_PlotTrack, qsmei_hdr
 RESTRICTIONS:
	Currently up to 10 curves can be manipulated (this is set in qLine_Structure)
 PROCEDURE:
	The widget is set up as a no-blocking widget. After being registered wit XMANAGER
	an event is generated to bring up the first display.

	The state structure is defined as follows:

	state = {STATE_QPLOT,		$
	wid_top		: 0L,			$		base widget along top of widget
										QPLOT_STRUCTURE events send to this widget create the
										X-Base section of the widget (main draw widget+X-axis parameters)
										The event is then passed to the wid_xbase widget to create the
										Y-Base section
										user value: none
	Top section of widget:

	wid_done	: 0L,			$		'Done' button widget
										user value: none
	wid_print	: 0L,			$		'Print' button widget
										user value: none
	wid_read	: 0L,			$		button widget for reading binary file
										user value: none
	wid_write	: 0L,			$		button widget for writing binary file
										user value: none
	wid_xysize	: [0L,0L],		$		cw_fields for setting horizontal/vertical plot window size
										user value: none
	wid_margin	: [0L,0L],		$		cw_fields for setting left and right x-margin
										user value: none
	wid_chars	: 0L,			$		cw_field for setting character size
										user value: none
	wid_title	: 0L,			$		cw_field for setting main plot label


	X-Base section of widget:

	wid_xbase	: 0L,			$		base widget containing remaining widgets
										A QPLOT_STRUCTURE event to this widget creates the Y-Base section.
										user value: none
	wid_draw	: 0L,			$		main draw widget for displaying the curves
										user value: none
	wid_time	: 0L,			$		non-exclusive button for plotting of time-axis
										user value: current on/off status
	wid_degree	: 0L,					cw_field widget setting degree of polynomial fit
										user value: two-element array specifying the x-range over which to fit
	wid_scalefit: 0L,			$		cw_field widget setting scale factor for residuals from fit
										user value: none

	Y-Base section of widget:

	wid_ybase	: 0L,			$		base widget container for rest of Y-Base section

	wid_isx			: lonarr(nmax),	$	exclusive button group selecting variable for x-axis
										user value: current setting (only one button in the group
											is 'on'; all others are 'off')
	wid_sequence	: lonarr(nmax),	$	cw_field group, setting order in which to process curves
										user value: none
	wid_ymin		: lonarr(nmax),	$	cw_field group, setting minimum for plot range
										user value: none
	wid_ymax		: lonarr(nmax),	$	cw_field group, setting maximum for plot range
										user value: none
	wid_skip		: lonarr(nmax),	$	non-exclusive button group; selects curves to be plotted
										user value: current on/off status
	wid_newyaxis	: lonarr(nmax),	$	non-exclusive button group; selects curves to be plotted with
										separate y-axis
										user value: current on/off status
	wid_exact		: lonarr(nmax),	$	non-exclusive button group; decide wheter to use exact axis or not
										user value: current on/off status
	wid_ynozero		: lonarr(nmax),	$	non-exclusive button group; decide whether to use /ynozero keyword
										user value: current on/off status
	wid_ylog		: lonarr(nmax),	$	non-exclusive button group; decide whether to use logarithmic axis
										user value: current on/off status
	wid_use_sigma	: lonarr(nmax),	$	non-exclusive button group; decide on whether to plot vertical error bars
										user value: current on/off status
	wid_sigma_index	: lonarr(nmax),	$	cw_field group; curve index of the array with standard deviations
										user value: none
	wid_fit			: lonarr(nmax),	$	non-exclusive button group for activating polynomial fitting
										user value: current on/off status
	wid_linestyle	: lonarr(nmax),	$	cw_field group; decide on linestyle
										user value: none
	wid_ytitle		: lonarr(nmax),	$	cw_field group: titles for y-axis
										user value: none



	The remaining stores the curves in heap variables:

	nmax		: nmax,			$				maximum number of curves
	n			: 0,			$				number of curves
	y			: ptr_new(/allocate_heap),	$	y-axis values
	t			: ptr_new(/allocate_heap),	$	time axis
	plotstr		: ptr_new(/allocate_heap)	$	plot strings
	}
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_Curve $SSW/smei/ucsd/sat/idl/widget/qline/qline_curve.pro
[Previous] [Next]
 NAME:
	qLine_Curve
 PURPOSE:
	Plot curves in qLine widget
 CATEGORY:
	Widget qLine
 CALLING SEQUENCE:
	qLine_Curve, state
 INPUTS:
	state			array[1]; type: structure
						qLine state structure
 OUTPUTS:
	(to draw widget)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	INTERPOL, IsDisplay, IsTime, PlotCurve, TimeGet, TimeLimits, TimeOp, TimeSet, TimeUnit
	TimeXAxis, destroyvar, qLine_FitPlot, qLine_SequenceOrder
 CALLED BY:
	qLine, qLine_Print
 PROCEDURE:
	Curves are plotted using the information in the state structure
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick
	JUN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Improved handling of time axis


qLine_Fit $SSW/smei/ucsd/sat/idl/widget/qline/qline_fit.pro
[Previous] [Next]
 NAME:
	qLine_Fit
 PURPOSE:

 CATEGORY:
	Widget qLine
 CALLING SEQUENCE:
	qLine_Fit, state, event, iy
 INPUTS:
	event			array[1]; type: structure
						mouse event from draw widget
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 CALLS:
 CALLED BY:
	qLine
 PROCEDURE:
 MODIFICATION HISTORY:
	FEB-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_FitDraw $SSW/smei/ucsd/sat/idl/widget/qline/qline_fitdraw.pro
[Previous] [Next]
 NAME:
	qLine_FitDraw
 PURPOSE:
	Handles mouse events from draw widget
 CATEGORY:
	qLine widget
 CALLING SEQUENCE:
	refresh = qLine_FitDraw(state, event, iy)
 INPUTS:
	state			array[1]; type: structure
						qLine state structure
	event			array[1]; type: structure
						event structure
 OUTPUTS:
	refresh			scalar; type: byte
						0B of 1B (1B indicating that qLine_Curve needs to be called)
						'refresh' will be 1B only for mouse release events
 CALLS:
 CALLED BY:
	qLine
 PROCEDURE:
 MODIFICATION HISTORY:
	JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_FitPlot $SSW/smei/ucsd/sat/idl/widget/qline/qline_fitplot.pro
[Previous] [Next]
 NAME:
	qLine_FitPlot
 PURPOSE:

 CATEGORY:
	Widget qLine
 CALLING SEQUENCE:
	qLine_FitPlot, state, iy, x, y
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 CALLS: ***
	IsTime, POLY_FIT, TimeScale, TimeString, TimeUnit, lsqNormalFit
 CALLED BY:
	qLine_Curve
 PROCEDURE:
 MODIFICATION HISTORY:
	FEB-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_IsX $SSW/smei/ucsd/sat/idl/widget/qline/qline_isx.pro
[Previous] [Next]
 NAME:
	qLine_IsX
 PURPOSE:
	Handles a 'select x-axis' event
 CATEGORY:
	qLine widget
 CALLING SEQUENCE:
	refresh = qLine_IsX(state, event, iy)
 INPUTS:
	state			array[1]; type: structure
						qLine state structure
	event			array[1]; type: structure
						event structure
	iy				scalar; type: integer
						index of the 'isx' widget that received the event
 OUTPUTS:
	refresh			scalar; type: byte
						0B of 1B (1B indicating that qLine_Curve needs to be called)
						'refresh' will be 1B, unless a 'skip' event is generated.on the
						new x-axis data.
 CALLS: ***
	BadValue
 CALLED BY:
	qLine
 PROCEDURE:
 >	The 'skip' status for the previous curve used for x-axis is set to 'off' by
	generating a 'skip' event (but only if 'skip' is 'on')
 >	The 'skip' status for the new x-axis curve is set to 'on by generating
	a 'skip' event (but only if 'skip' is off.
 MODIFICATION HISTORY:
	JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_Kill $SSW/smei/ucsd/sat/idl/widget/qline/qline_kill.pro
[Previous] [Next]
 NAME:
	qLine_Kill
 PURPOSE:
	Clean up heap variables used by qLine and destroy widget
 CATEGORY:
	Widget qLine
 CALLING SEQUENCE:
	qLine_Kill, state, event
 INPUTS:
	state			array[1]; type: structure
						qLine state structure
 OUTPUTS:
	(none)
 CALLED BY:
	qLine
 PROCEDURE:
	Trivial
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_NewYAxis $SSW/smei/ucsd/sat/idl/widget/qline/qline_newyaxis.pro
[Previous] [Next]
 NAME:
	qLine_NewYAxis
 PURPOSE:
	Handles a 'newyaxis' event
 CATEGORY:
	qLine widget
 CALLING SEQUENCE:
	refresh = qLine_NewYAxis(state, event, iy)
 INPUTS:
	state			array[1]; type: structure
						qLine state structure
	event			array[1]; type: structure
						event structure
	iy				scalar; type: integer
						index of the 'newyaxis' widget that received the event
 OUTPUTS:
	refresh			scalar; type: byte
						always 1B (indicating that qLine_Curve needs to be called)
 CALLED BY:
	qLine
 PROCEDURE:
	The user value of state.wid_newyaxis[iy] is updated with event.select.
	The sensitivity of state.wid_exact, state.wid_ynozero and state.wid_ylog
	are switched on/off if 'newyaxis' is selected/deselected.
 MODIFICATION HISTORY:
	JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_Print $SSW/smei/ucsd/sat/idl/widget/qline/qline_print.pro
[Previous] [Next]
 NAME:
	qLine_Print
 PURPOSE:
	Print current qLine display
 CATEGORY:
	Widget qLine
 CALLING SEQUENCE:
	qLine_Print, state
 INPUTS:
	state			array[1]; type: structure
						qLine state structure
 OUTPUTS:
	(hardcopy or EPS file)
 CALLS: ***
	Get_Page, qLine_Curve, qSet_Page
 CALLED BY:
	qLine
 PROCEDURE:
	The current selection in the droplist widget state.wid_devi is checked
	to determine whether to use the default printer or create an EPS file.
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_Read $SSW/smei/ucsd/sat/idl/widget/qline/qline_read.pro
[Previous] [Next]
 NAME:
	qLine_Read
 PURPOSE:
	Reads a binary file and loads stored curves back into qLine
 CATEGORY:
	Widget qLine
 CALLING SEQUENCE:
	qLine_Read, state
 INPUTS:
	state			array[1]; type: structure
						qLine state structure
 OUTPUTS:
	(sends event to display curves)
 CALLS: ***
	bin_read, qLine_Structure
 CALLED BY:
	qLine
 PROCEDURE:
	The binary file was presumably written using the 'Write' button in the qLine widget.
	The file is read using
		x = bin_read(file, /header)
	x[0,*  ] becomes the x-axis
	x[1:*,*] become the seperate curves
	Once the file is read a QPLOT_STRUCTURE event is set up and send on its way to
	create the qLine display.
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_Sequence $SSW/smei/ucsd/sat/idl/widget/qline/qline_sequence.pro
[Previous] [Next]
 NAME:
	qLine_Sequence
 PURPOSE:
	Handles a 'change of sequence' event, modifying the order in which
	curves are processed
 CATEGORY:
	qLine widget
 CALLING SEQUENCE:
	refresh = qLine_Sequence(state, iy)
 INPUTS:
	state			array[1]; type: structure
						qLine state structure
	iy				scalar; type: integer
						index of the 'sequence' widget that received the event
 OUTPUTS:
	refresh			scalar; type: byte
						always 1B (1B indicating that qLine_Curve needs to be called)
 CALLS: ***
	UNIQ [1], UNIQ [2], UNIQ [3], where_common
 CALLED BY:
	qLine
 PROCEDURE:
	The value of the state.wid_sequence widgets are read, and are checked to make sure
	that there are no double entries. If there are double entries then these are removed,
	subject to the constraint that widget iy (the widget on which the event was
	generated) is not changed.
 MODIFICATION HISTORY:
	JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_SequenceOrder $SSW/smei/ucsd/sat/idl/widget/qline/qline_sequenceorder.pro
[Previous] [Next]
 NAME:
	qLine_SequenceOrder
 PURPOSE:
	Returns the order in which curves are to be processed
 CATEGORY:
	qLine widget
 CALLING SEQUENCE:
	seq = qLine_SequenceOrder(state)
 INPUTS:
	state			array[1]; type: structure
						qLine state structure
 OUTPUTS:
	seq				array[state.n]; type: integer
						index array with processing order
 CALLED BY:
	qLine_Curve, qLine_Skip
 PROCEDURE:
	Reads the values of the state.wid_sequence widgets.
 MODIFICATION HISTORY:
	JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_Skip $SSW/smei/ucsd/sat/idl/widget/qline/qline_skip.pro
[Previous] [Next]
 NAME:
	qLine_Skip
 PURPOSE:
	Handles a 'skip plot' event
 CATEGORY:
	qLine widget
 CALLING SEQUENCE:
	refresh = qLine_Skip(state, event, iy)
 INPUTS:
	state			array[1]; type: structure
						qLine state structure
	event			array[1]; type: structure
						event structure
	iy				scalar; type: integer
						index of the 'skip' widget that received the event
 OUTPUTS:
	refresh			scalar; type: byte
						0B of 1B (1B indicating that qLine_Curve needs to be called)
						'refresh' will be 1B, unless a 'newyaxis' event is generated.
 CALLS: ***
	qLine_SequenceOrder
 CALLED BY:
	qLine
 PROCEDURE:
 >	The user value of state.wid_skip[iy] is updated with event.select.
	The sensitivity of state.wid_newyaxis, state.wid_exact, state.wid_ynozero and
	state.wid_ylog is updated as needed.
 >	A check is made to made sure that the first curve to be plotted has
	'newyaxis' set. If not then a 'newyaxis' event is generated to set it.
 MODIFICATION HISTORY:
	JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_Structure $SSW/smei/ucsd/sat/idl/widget/qline/qline_structure.pro
[Previous] [Next]
 NAME:
	qLine_Structure
 PURPOSE:
	Creates and initializes a QPLOT_STRUCTURE event structure
 CATEGORY:
	Widget qLine
 CALLING SEQUENCE:
	event = qLine_Structure(state, xtitle=xtitle, xmargin=xmargin,	$
		ymin=ymin, ymax=ymax, skip=skip, newyaxis=newyaxis, exact=exact, ynozero=ynozero,$
		ylog=ylog, linestyle=linestyle, ytitle=ytitle)
 OPTIONAL INPUT PARAMETERS:
	state			array[1]; type: structure
						qLine state structure

	The keywords give the plot parameters for all curves:

	ymin		= ymin		array[n]; type: float
	ymax		= ymax		array[n]; type: float
								min and max values for y-axis
	skip		= skip		array[n]; type: byte
								0B: don't plot the curve
								1B: plot the curve
	newyaxis	= newyaxis	array[n]; type: byte
								0B: if existing y-axis is to be used
								1B: if new y-axis is to be drawn
	exact		= exact		array[n]; type: byte
								0B: if no exact y-axis needs to be drawn
								1B: if exact y-axis is needed
	ynozero		= ynozero	array[n]; type: byte
								same convention as IDL ynozero keyword
	ylog		= ylog		array[n]; type: byte
								0B: for linear y-axis
								1B: for logarithmic y-axis
	linestyle	= linestyle	array[n]; type: integer
								same convention as IDL linestyle keyword
	ytitle		= ytitle	array[n]; type: string
								titles for y-axis

 OUTPUTS:
	event			array[1]; type: structure
						QPLOT_STRUCTURE event containing plot parameters for all curves
 CALLED BY:
	qLine, qLine_Read
 RESTRICTIONS:
	Currently only 10 curves can be manipulated.
 PROCEDURE:
	If 'state' is specified then information values and user values from the widgets
	in this structure are used to initialize the structure.
	If any of the keywords is specified then these are used to initialize event structure
	fields (overriding the values from the 'state' structure).
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_Write $SSW/smei/ucsd/sat/idl/widget/qline/qline_write.pro
[Previous] [Next]
 NAME:
	qLine_Write
 PURPOSE:
	Writes the currently loaded curves into a binary file
 CATEGORY:
	Widget qLine
 CALLING SEQUENCE:
	qLine_Write, state
 INPUTS:
	state			array[1]; type: structure
						qLine state structure
 OUTPUTS:
	(to disk file)
 CALLS: ***
	FILEPATH, bin_write
 CALLED BY:
	qLine
 PROCEDURE:
	The array with curve data is written to file using
		tmp = sbinar(file, write=xx)
	The resulting file can be reloaded using the 'Read' button in qLine
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_XBase $SSW/smei/ucsd/sat/idl/widget/qline/qline_xbase.pro
[Previous] [Next]
 NAME:
	qLine_XBase
 PURPOSE:
	Creates the widgets for the X-axis parameters
 CATEGORY:
	Widget qLine
 CALLING SEQUENCE:
	qLine_XBase, state, xysize=xysize
 INPUTS:
	state			array[1]; type: structure
						qLine state structure
 OPTIONAL INPUT PARAMETERS:
	xysize=xysize	array[2]; type: integer
						size of draw widget. The window size is also stored as value
						in the state.wid_xysize widgets, but may not be available yet
						if the widget has not been realized yet.
 OUTPUTS:
	(creates widgets)
 CALLS: ***
	BadValue, CW_FIELD, IsTime, IsType
 CALLED BY:
	qLine
 PROCEDURE:
	The x-base part of the widget consists of the draw widget, and other widgets
	that apply to all curves. The draw widget is not sensitive (i.e. no mouse events
	are processed (until the 'fit' widget is activated)
	The widgets are grouped under state.wid_xbase, which is a child of state.wid_top.
	Note that a call to this procedure is followed by a call to qLine_YBase, which
	creates the widgets for the individual curves.
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_YAction $SSW/smei/ucsd/sat/idl/widget/qline/qline_yaction.pro
[Previous] [Next]
 NAME:
	qLine_YAction
 PURPOSE:
	Used by the qLine event handler to test whether an event was
	received from any of the y-base widgets
 CATEGORY:
	qLine
 CALLING SEQUENCE:
	R = qLine_YAction(wid_array, wid, iy)
 INPUTS:
	wid_array		array; type: long integer
						array of widget id's (one element for each curve)
	event			array[1]; type: structure
						event structure
 OUTPUTS:
	R				scalar; type: long integer
						'wid' (event.id) if a match with one of the elements
							in 'wid_array' was found; -1 if not.
	iy				scalar: type: long integer
						index into qLine_YAction of the match found;
						-1 if no match was found.
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar
 CALLED BY:
	qLine
 PROCEDURE:
	Used as test statement in the main 'case' block in the event handler.
 MODIFICATION HISTORY:
	JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLine_YBase $SSW/smei/ucsd/sat/idl/widget/qline/qline_ybase.pro
[Previous] [Next]
 NAME:
	qLine_YBase
 PURPOSE:
	Set up the widget for the y-axis parameters
 CATEGORY:
	Widget qLine
 CALLING SEQUENCE:
	qLine_YBase, state, event
 INPUTS:
	state			array[1]; type: structure
						qLine state structure
	event			array[1]; type: structure
						QPLOT_STRUCTURE event containing plot parameters for all curves
 OUTPUTS:
	(creates widgets)
 CALLS: ***
	CW_FIELD
 CALLED BY:
	qLine
 PROCEDURE:
	Creates groups of widgets for individual curves. The whole group of widgets is
	contained in state.wid_ybase, which is a child widget of state.wid_xbase.
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qLoadCT $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qloadct/qloadct.pro
[Previous] [Next]
 NAME:
	qLoadCT
 PURPOSE:
	Load color table
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
	event		array[1]; type: structure
					event from state.wid_smei button
 OUTPUTS:
	Result		scalar; type: byte
					1B: display needs to be refreshed completely
						(by call to qImage_cw_Set_Value)
					0B: display does not need to be redrawn
 CALLS: ***
	FILEPATH, InitVar, IsType, QLOADCT_EVENT, XMANAGER, unexpected_event
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qNagoya $SSW/smei/ucsd/sat/idl/widget/qnagoya/qnagoya.pro
[Previous] [Next]
 NAME:
	qNagoya
 PURPOSE:
	Widget for looking at Nagoya IPS data
 CATEGORY:
	Widgets
 CALLING SEQUENCE:
	qNagoya, group=group, img_offset=img_offset, wid_base=wid_base
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
	group=group		scalar; type: long integer
						group leader passed to XMANAGER
 OUTPUTS:
	(to widget)
 CALLS: ***
	CW_FIELD, FILEPATH, QNAGOYA_EVENT, TimeString, TimeSystem, TimeUnit, XMANAGER
	qNagoya_Info, qNagoya_Plot, qNagoya_PointSources, qNagoya_Skymap
 EXTERNAL:
	ips_point_source__define
 PROCEDURE:
	The state structure is as follows:

	state = {STATE_QNAGOYA,	$
		wid_send		: 0L, 	$		Row base widget
										user value: widget ID of widget to receive QIMAGE_SEND
											events (set by qImage_SendDestination)
		wid_exit		: 0L,	$		'Done' button
										user value: none
		wid_pick		: 0L,	$		'Image' button for selection of image file
										user value: none
		wid_filter		: 0L,	$		cw_field for entering file filter for image file selection
										user value: none
		wid_qimage_cw	: 0L,	$		compound widget qimage_cw
										user value: none
		wid_info		: 0L,	$		'Info' button to display information about the current image
										user value: string array containing informatin
		foreign			: 0		$		set by pImage_SendDestination using keyword 'foreign'; controls how
										qImage reacts to QIMAGE_CW_UPDATE events from the
										qImage_cw compound widget.
										foreign=0: ignore events
										foreign=1,2: call qImage_TrackPeak (used by the 'Track' option in qView).
		}


qNagoya_Info $SSW/smei/ucsd/sat/idl/widget/qnagoya/qnagoya_info.pro
[Previous] [Next]
 NAME:
	qNagoya_Info
 PURPOSE:
	Display information about loaded data
 CATEGORY:
	Widget qNagoya
 CALLING SEQUENCE:
	qNagoya_Info, state
 INPUTS:
	state		array[1]; type: structure
					qNagoya state structure
 OUTPUTS:
	(to message dialog)
 CALLS: ***
	FILEPATH
 CALLED BY:
	qNagoya
 PROCEDURE:
 STATE INFO USED:
	widget_control, state.wid_info, get_uvalue=info
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qNagoya_Plot $SSW/smei/ucsd/sat/idl/widget/qnagoya/qnagoya_plot.pro
[Previous] [Next]
 NAME:
	qNagoya_Plot
 PURPOSE:
	Set up call to qLine widget to display Nagoya IPS data
 CATEGORY:
	qNagoya widget
 CALLING SEQUENCE:
	qNagoya_Plot, state
 INPUTS:
	state		array[1]; type: structure
					qNagoya state structure
 OUTPUTS:
	(none)
 CALLS: ***
	qLine, qNagoya_Skymap
 CALLED BY:
	qNagoya
 PROCEDURE:
 MODIFICATION HISTORY:
	JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qNagoya_PointSources $SSW/smei/ucsd/sat/idl/widget/qnagoya/qnagoya_pointsources.pro
[Previous] [Next]
 NAME:
	qNagoya_PointSources
 PURPOSE:
	Read Nagoya IPS data and put them in user values of qNagoya widget
 CATEGORY:
	qNagoya widget
 CALLING SEQUENCE:
	qNagoya_PointSources, state
 INPUTS:
	state			scalar; type: structure
						qNagoya state structure
 OUTPUTS:
	(to user values of widgets)
 CALLS: ***
	GetNagoyaSources, TimeSplit, TimeString, TimeUnit, UNIQ [1], UNIQ [2], UNIQ [3]
	qNagoya_Skymap
 CALLED BY:
	qNagoya
 PROCEDURE:
 MODIFICATION HISTORY:
	JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qNagoya_Skymap $SSW/smei/ucsd/sat/idl/widget/qnagoya/qnagoya_skymap.pro
[Previous] [Next]
 NAME:
	qNagoya_Skymap
 PURPOSE:
	Process IPS data for one selected source
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 CALLS: ***
	ARROW, IsDisplay, NAGOYASOURCEMAP, TimeSplit
 CALLED BY:
	qNagoya, qNagoya_Plot, qNagoya_PointSources
 SEE ALSO:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 EXAMPLE:
 PROCEDURE:
 MODIFICATION HISTORY:
	JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qSave2File $SSW/smei/ucsd/sat/idl/widget/qsave2file/qsave2file.pro
[Previous] [Next]
 NAME:
	qSave2File
 PURPOSE:
	Widget to save data arrays as binary files using bin_write
 CATEGORY:
	Widget qSave2File
 CALLING SEQUENCE:
	qSave2File, group=group, block=block, wid_save=wid_save, plane_id=plane_id, file=file,	$
		call_by_qimage=call_by_qimage, trailer=trailer
 INPUTS:
	wid_save=wid_save	scalar; type: long integer
							widget ID of a valid widget whose user value contains the array
							to be saved to disk.
 OPTIONAL INPUT PARAMETERS:
	group=Group			passed to xmanager when registering the qView widget
	/block				passed to xmanager to make the widget a blocking widget (default:
							non-blocking widget)
	file = file			scalar; type: string; default: filepath(root=getenv('TEMP'),'qsave2file.pph')
							output file name
	/call_by_image		used by save option in qImage widget (also see qSave2File_Save)
	trailer = trailer	scalar; type: string
							trailer to be added to output file[s]
							The trailer is only used if /call_by_qimage or /wid_single is set,
							and only for .pph or .nic files
 OUTPUTS:
	(none)
 CALLS: ***
	CW_FIELD, FILEPATH, GetFileSpec, InitVar, IsType, QSAVE2FILE_EVENT, XMANAGER
	qSave2File_Pick, qSave2File_Save
 CALLED BY:
	qImage_Save, qImage_cw_Save
 SIDE EFFECTS:
	It is probably best to use qSave2File as a blocking widget (while this widget exists the
	calling widget should be desensitized completely if possible). When a non-blocking widget
	is used the array stored in the user value of wid_save might change before it is saved.
 RESTRICTIONS:
 PROCEDURE:
		state = {STATE_QSAVE2FILE,		$
		wid_top		: 0L,			$					Base widget container for all child widgets
														user value: none
		wid_done	: 0L,			$					'Done' button; destroys widget withoud saving
														user value: none
		wid_save	: 0L,			$					'Save' button; first saves array, then destroys widget
														user value: keyword 'wid_save', and 'plane_id' (if present)
		wid_pick	: 0L,			$					'Pick File' button to select output file name
														user value: none
		wid_file	: 0L,			$					cw_field widget for output file name
														user value: none
		wid_single	: 0L,			$					Exclusive button for single or multiple output files
														user value: current ON/OFF setting
		wid_type	: lonarr(4),	$					Exclusive buttons to select file type
														user value: current ON/OFF setting
		type		: ['pph','nic','gif','bmp'],	$	List of valid file types
		call_by_qimage: keyword_set(call_by_qimage),$
		trailer		: ''			$					Optional trailer string to be added to file
	}
 MODIFICATION HISTORY:
	APR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qSave2File_Pick $SSW/smei/ucsd/sat/idl/widget/qsave2file/qsave2file_pick.pro
[Previous] [Next]
 NAME:
	qSave2File_Pick
 PURPOSE:
	Sets the name of the output file
 CATEGORY:
	Widget qSave2File
 CALLING SEQUENCE:
	qSave2File_Pick, type=type, /pick
 INPUTS:
	state		array[1]; type: structure
					qSave2File state structure
 OPTIONAL INPUT PARAMETERS:
	type=type	scalar; type: string
					type to be used as file name extension
	/pick		if set then the IDL pickfile dialog is used to let user set
					keyword 'type' takes precedence over /pick
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	GetFileSpec, InitVar
 CALLED BY:
	qSave2File
 PROCEDURE:
	The current file name from the wid_file widget is picked up.
	If keyword 'type' is used then the wid_file name is used with extension 'type'
	If /pick is set then the IDL pickfile dialog is called to set the filename
	If neither is set then the wid_file name is used unmodified

	The new file name is stored in the wid_file widget.
 MODIFICATION HISTORY:
	APR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qSave2File_Save $SSW/smei/ucsd/sat/idl/widget/qsave2file/qsave2file_save.pro
[Previous] [Next]
 NAME:
	qSave2File_Save
 PURPOSE:
	Saves data in binary file
 CATEGORY:
	Widget qSave2File
 CALLING SEQUENCE:
	qSave2File_Save, state, event
 INPUTS:
	state		array[1]; type: structure
					qSave2File state structure
	event		array[1]; type: structure
					event structure send by 'Save' widget
 OUTPUTS:
	(to disk file)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	GetFileSpec, Get_Page, IsType, SetFileSpec, bin_write
 CALLED BY:
	qSave2File
 PROCEDURE:
 >	The type of binary file is decided by checking the state.wid_type widgets
	Currently the types 'pph','nic','gif' and 'bmp' are supported
 >	The file name to be used is taken from the state.wid_file widget

 > The data array A to be saved is taken from the user value of the state.wid_save[0] widget.

 >	If state.call_by_qimage = 1 then only A[*,*,0] is saved. This is used by the qImage
	widget.
 > If state.wid_single = 0 then A is stored in a single file irrespective of the number of
	dimensions
 >	If state.wid_single = 1 then all images in the image cube A are stored in separate files
	Each file is given a sequence number which is appended to the file name. The sequence number
	is taken from the state.wid_save widget. If this is not present then the array index of the
	3rd array dimension is used.

 >	Once the data are saved to disk, the qSave2File widget is destroyed.
 MODIFICATION HISTORY:
	APR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qSet_Page $SSW/smei/ucsd/sat/idl/widget/qset_page/qset_page.pro
[Previous] [Next]
 NAME:
	qSet_Page
 PURPOSE:
	Widget for controlling printing and saving as disk file
 CATEGORY:
	Widget qSet_Page
 CALLING SEQUENCE:
	qSet_Page
 INPUTS:
	group=Group		passed to xmanager when registering the qView widget
 OPTIONAL INPUT PARAMETERS:
	spit=spit		integer scalar, or string array; default: 0
					set to 0 or 1; or contains an array of valid plot commands
					If /spit is set then 'Get_Page' is called before returning
					control to caller.
					If spit is set to plot command(s) these are executed,
					followed by a call to 'Get_Page'
 OUTPUTS:
	(printer output, graphics file)
 OPTIONAL OUTPUT PARAMETERS:
	status=status	scalar; type: byte
					0 or 1 depending on whether the call to Set_Page was done
					0: no Set_Page call (!ThePlotFile = '')
					1: Set_Page was called (!ThePlotFile set to valid file name)
					(if keyword spit is used then always status=0 is returned
 CALLS: ***
	CW_FIELD, FILEPATH, Get_Page, InitVar, IsType, QSET_PAGE_EVENT, XMANAGER
	qSet_Page_Kill, qSet_Page_Layout, qSet_Page_Pick, qSet_Page_Submit
 CALLED BY:
	even_light_corrections, even_light_photometry, even_light_registration
	qBar_Print, qLine_Print
 SIDE EFFECTS:
	qSet_Page is a blocking widget: control is returned to caller only after this widget
	destroys itself.
 RESTRICTIONS:
 PROCEDURE:
	Functions as a driver for Set_Page
	There are two ways of using this widget:
	1. call without using keyword 'spit':
		qSet_Page will use Set_Page to initialize an output format (for printer, or
		graphic file). Return status=1 signifies a succesful initialization.
		This is followed by one or more plot commands, writing to a printer file or
		plotting to a graphics window. Finally 'Get_Page' is called to send the print file
		to the printer or capture the window as a graphics file.
	2a. call with keyword /spit set:
		qSet_Page initializes the ouput format, then immediately calls 'Get_Page'.
		This makes sense only if a graphics windows already exists, that needs to be
		captured as a graphics file.
	2b. call with keyword spit set to a string array containg plot commands.
		qSet_Page initializes the output format, executes the plot command(s), then
		calls 'Get_Page'.

	State structure:

	state = {STATE_QSET_PAGE,		$
		wid_top		: 0L,			$	Base widget container for all other widgets
		wid_done	: 0L,			$	'Done' button; exits and destroys widget
										user value: none
		wid_print	: 0L,			$	'Print' button; calls Set_Page, then exits and destroys widget
										user value: none
		wid_pick	: 0L,			$	'Pick File' button for selecting file name for output
										user value: none
		wid_file	: 0L,			$	cw_field widget for name of file for output
										user value: none

		wid_portrait: 0L,			$	Exclusive button for setting page layout
										user value: current ON/OFF setting
		wid_landscape:0L,			$	Exclusive button for setting page layout
										user value: current ON/OFF setting
		wid_xsize	: 0L,			$	cw_field widget for setting horizontal size (cm)
										user value: none
		wid_ysize	: 0L,			$	cw_field widget for setting horizontal size (cm)
										user value: none
		wid_aspect	: 0L,			$	cw_field widget for setting aspect ratio
										user value: none
		wid_window	: 0L,			$	button for setting aspect ratio using current window size
										user value: none
		wid_swap	: 0L,			$	button for inverting the aspect ratio
										user value: none
		wid_printer	: 0L,			$	Exclusive button for selecting !ThePrinter
										user value: current ON/OFF setting
		wid_eps		: 0L,			$	Exclusive button for output as EPS file
										user value: current ON/OFF setting
		wid_gif		: 0L,			$	Exclusive button for output as GIF file
										user value: current ON/OFF setting
		wid_png		: 0L			$	Exclusive button for output as PNG file
										user value: current ON/OFF setting
		wid_bmp		: 0L			$	Exclusive button for output as BMP file
										user value: current ON/OFF setting
	}
 MODIFICATION HISTORY:
	APR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	JAN-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		added /spit keyword and associated functionality.


qSet_Page_Kill $SSW/smei/ucsd/sat/idl/widget/qset_page/qset_page_kill.pro
[Previous] [Next]
 NAME:
	qSet_Page_Kill
 PURPOSE:
	Destroys qSet_Page widget
 CATEGORY:
	Widget qSet_Page
 CALLING SEQUENCE:
	qSet_Page_Kill, state, event
 INPUTS:
	state		array[1]; type: structure
					qSet_Page state structure
	event		array[1]; type: structure
					event structure send by 'Done' widget
 OUTPUTS:
	(none)
 CALLED BY:
	qSet_Page
 SIDE EFFECTS:
	The name of the current plot file !ThePlotFile is set to the null string
 PROCEDURE:
	Calls widget_control, event.handler, /destroy
 MODIFICATION HISTORY:
	APR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qSet_Page_Layout $SSW/smei/ucsd/sat/idl/widget/qset_page/qset_page_layout.pro
[Previous] [Next]
 NAME:
	qSet_Page_Layout
 PURPOSE:
	Used to define page layout (landscape or portrait)
 CATEGORY:
	Widget qSet_Page
 CALLING SEQUENCE:
	qSet_Page_Layout, state, event
 INPUTS:
	state		array[1]; type: structure
					qSet_Page state structure
	event		array[1]; type: structure
					event structure
 OUTPUTS:
	(none)
 CALLED BY:
	qSet_Page
 SIDE EFFECTS:
	When changing from landscape to portrait or v.v. the aspect ratio is modified
	by interchanging the horizontal and vertical page sizes.
 PROCEDURE:
	Checks the event.select value of the input event, and uses it to set the
	wid_portrait or wid_landscape widget. If event.select=1 then horizontal and
	vertical size are interchanged.
 MODIFICATION HISTORY:
	APR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qSet_Page_Pick $SSW/smei/ucsd/sat/idl/widget/qset_page/qset_page_pick.pro
[Previous] [Next]
 NAME:
	qSet_Page_Pick
 PURPOSE:
	Sets the name of the file used for the graphics output
 CATEGORY:
	Widget qSet_Page
 CALLING SEQUENCE:
	qSet_Page, state, pick=pick, type=type
 INPUTS:
	state		array[1]; type: structure
					qSet_Page state structure
 OPTIONAL INPUT PARAMETERS:
	type=type	scalar; type: string
					3-char type to be used as file name extension (bmp, eps, gif)
	/pick		if set then the IDL pickfile dialog is used to let user set
					keyword 'type' takes precedence over /pick
 OUTPUTS:
	(none)
 CALLS: ***
	GetFileSpec, SetFileSpec, qSet_Page_Update
 CALLED BY:
	qSet_Page
 PROCEDURE:
	The current file name from the wid_file widget is picked up.
	If keyword 'type' is used then the wid_file name is used with extension 'type'
	If /pick is set then the IDL pickfile dialog is called to set the filename
	If neither is set then the wid_file name is used unmodified

	The new file name is stored in the wid_file widget. Then qSet_Page_Update is used
	to update the values and user values in the qSet_Page widget.
 MODIFICATION HISTORY:
	APR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qSet_Page_Submit $SSW/smei/ucsd/sat/idl/widget/qset_page/qset_page_submit.pro
[Previous] [Next]
 NAME:
	qSet_Page_Submit
 PURPOSE:
	Assembles settings from qSet_Page for a call to Set_Page; destroys
	the qSet_Page widget after calling Set_Page
 CATEGORY:
	Widget qSet_Page
 CALLING SEQUENCE:
	qSet_Page_Submit, state, event
 INPUTS:
	state		array[1]; type: structure
					qSet_Page state structure
	event		array[1]; type: structure
					event structure send by 'Print' widget
 OUTPUTS:
	(none)
 CALLS: ***
	Set_Page
 CALLED BY:
	qSet_Page
 PROCEDURE:
	The states of all relevant widgets are picked up, and used to set up the
	keywords for the call to Set_Page.
 MODIFICATION HISTORY:
	APR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qSet_Page_Update $SSW/smei/ucsd/sat/idl/widget/qset_page/qset_page_update.pro
[Previous] [Next]
 NAME:
	qSet_Page_Update
 PURPOSE:
	Updates various values and user values of qSet_Page child widgets
 CATEGORY:
	Widget qSet_Page
 CALLING SEQUENCE:
	qSet_Page_Update, state, type
 INPUTS:
	state		array[1]; type: structure
					qSet_Page state structure
 OPTIONAL INPUT PARAMETERS:
	type		scalar; type: string
					3-char type to be used as file name extension (bmp, eps, gif)
 OUTPUTS:
	(none)
 CALLED BY:
	qSet_Page_Pick
 PROCEDURE:
	Updates the exclusive buttons for the output file types
 MODIFICATION HISTORY:
	APR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qShow $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qshow/qshow.pro
[Previous] [Next]
 NAME:
	qShow
 PURPOSE:
	Controls display of image in qImage_cw
 CATEGORY:
	sat/idl/widget/qimage_cw/qshow
 CALLING SEQUENCE:
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
	event		array[1]; type: structure
					event from state.wid_smei button
 OUTPUTS:
	Result		scalar; type: byte
					1B: display needs to be refreshed completely
						(by call to qImage_cw_Set_Value)
					0B: display does not need to be redrawn
 CALLS: ***
	CW_FIELD, FILEPATH, InitVar, IsType, LOADCT, QSHOW_EVENT, QSHOW_STATE, XMANAGER
	unexpected_event
 CALLED BY:
	qImage_cw_Show
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qSlider $SSW/smei/ucsd/sat/idl/widget/qview/qslider.pro
[Previous] [Next]
 NAME:
	qSlider
 PURPOSE:
	Create sliders to return values to caller
 CATEGORY:
	Compound widget
 CALLING SEQUENCE
	val = qSlider(sld_def)
 INPUTS:
	sld_def				array[6]; type; integer
					6 values representing the
					minimum, maximum and default
					values of the two sliders.
					ex.
					[1,30,13, 300,1300, 600]
					min, max, def, min, max, def
	sld_name			array[2]; type; string
					2 values including the names
					for each slider
 OUTPUTS:
	Result				integer 0 if canceled or exited
					array[2] with 2 slider final
					values if accepted.
 CALLS:
 CALLED BY
	qView_Save2File


qslider_cw $SSW/smei/ucsd/sat/idl/widget/qslider_cw/qslider_cw.pro
[Previous] [Next]
 NAME:
	qslider_cw
 PURPOSE:
	Creates compound widget qslider_cw
 CATEGORY:
	Widget qslider_cw
 CALLING SEQUENCE:
	qslider_cw,
	wid = qslider_cw, parent, uvalue=uvalue, title=title,			$
		value=value, minimum=minimum, maximum=maximum, frame=frame,	$
		xsize=xsize, lxsize=lxsize, steps=steps, length=length
 INPUTS:
	parent		scalar; type: long integer
				widget id of parent widget creating compound widget
 OPTIONAL INPUS:
	uvalue=uvalue	user value
	title=title	scalar; type: string; default: 'title'
				title of compound widget
	value=value	scalar; type: float
				initial value
	minimum=maximum	scalar; type: float
				minimum allowed value
	maximum=maximum	scalar; type: float
				maximum allowed value
	steps=steps	scalar; type: integer: default: 100
				the slider widget used in the compound widget is an
				integer slider. The integer range [0,steps] is
				mapped to the float range [minimum,maximum].
				I.e. the step size is (maximum-minimum)/steps
	frame=frame	scalar; type: integer; default: 0
				border width around compound widget in pixels
	xsize=xsize
	lxsize=lxsize
	length=length
 OUTPUTS:
	wid	scalar; type: long integer
			widget id of compound widget
 CALLED BY:
	qvu
 RESTRICTIONS:
	The modified cw_field widget accepting keyword lxsize is needed.
 CALLS: ***
	CW_FIELD, InitVar, IsType, QSLIDER_CW_EVENT, QSLIDER_CW_GET, QSLIDER_CW_SET
	QSLIDER_CW_UPDATE, unexpected_event
 SIDE EFFECTS:
 PROCEDURE:
 >	The event returned:
		event = {SLIDER_CW, id:0L, top:0L, handler:0L, value:value}
	Probably this event is never needed. The current state of the compound widget
	can be retrieved or modified using widget_control with the get_value and
	set_value keywords.
 >	widget_control, id, get_value=value
		returns a three-element float array containg
		slider value, and slider minimum and maximum values
 >	widget_control, id, set_value=value
		expects the same three-element array.

	tmp = {QSLIDER_CW_STATE,$
		wid_value	: 0L,	$	; First child (contains slider value)
						; User value: state structure
		wid_minimum	: 0L,	$	; Contains slider minimum
		wid_slider	: 0L,	$	; Slider widget
		wid_maximum	: 0L	$	; Contains slider maximum
	}

 MODIFICATION HISTORY:
	SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qslider_cw_state__define $SSW/smei/ucsd/sat/idl/widget/qslider_cw/qslider_cw_state__define.pro
[Previous] [Next]
 NAME:
	qslider_cw_state__define
 PURPOSE:
	Defines the state structure for the qslider_cw compound widget
 CATEGORY:
	Compound widget qslider_cw
 CALLING SEQUENCE:
	state = {qslider_cw_state}
 INPUTS:
	parent			scalar; type: long integer
						ID of the parent widget
 OUTPUTS:
	(state structure)
 PROCEDURE:
	The fields in the state structure are explained in qslider_cw (compound widget)

 State structure
	The state structure is stored as user value to the first child widget.
	If the ID of the root widget is known the state can be retrieved by

	wid_child = widget_info( wid_root, /child)
	widget_control, wid_child, get_uvalue=state

	The state consist of the widget id of all widgets making up the compound widget

 MODIFICATION HISTORY:
	SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)

tmp = {QSLIDER_CW_STATE,		$

	wid_value		: 0L,	$		; First child (contains slider value)
	wid_minimum		: 0L,	$		; Contains slider minimum
	wid_slider		: 0L,	$		; Slider widget
	wid_maximum		: 0L	$		; Contains slider maximum
	}


qsmei_hdr $SSW/smei/ucsd/camera/idl/toolbox/qsmei_hdr.pro
[Previous] [Next]
 NAME:
	qsmei_hdr
 PURPOSE:
	Plot time series for quantities in SMEI frame headers
 CATEGORY:
	Widget qLine
 CALLING SEQUENCE:
	qsmei_hdr, hdr_or_time
 INPUTS:
	hdr_or_time 	array; type: header or time structure
						a time structure is passed to smei_getfile
						to get the matching headers.
 OPTIONAL INPUTS:
	get=get		array; type: string
				default: ['FRAME_NR','MODE','SHUTTER','LED_ENABLED','FLAT_ENABLED','CCD_TEMP']
				list of entries to be plotted
				To get a list of valid entries type:
				print, tag_names({smei_frm_hdr})
 OUTPUTS:
	(to draw widget)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, IsTime, IsType, qLine, smei_frm_property, smei_getfile, smei_hdr_get
 PROCEDURE:
 MODIFICATION HISTORY:
	JUN-2004, Paul Hick (UCSD/CASS)
	JAN-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		More general implementation. The old one only plotted the current
		default 'get' entries.


qsmei_sky $SSW/smei/ucsd/camera/idl/sky/qsmei_sky.pro
[Previous] [Next]
 NAME:
	qsmei_sky
 PURPOSE:
	Widget 'wrapper' for the compound widget qImage_cw
 CATEGORY:
	Widgets
 CALLING SEQUENCE:
	qsmei_sky, filter, image=image, group=group, img_offset=img_offset, wid_base=wid_base
 INPUTS:
	filter			scalar; type: string; default: *.*
						file name filter for file selection
						If the filter does not contain a wildcard (i.e. is the
						name of a single file) then an attempt is made to load
						the image from the file.
 OPTIONAL INPUT PARAMETERS:
	group=group		scalar; type: long integer
						group leader passed to XMANAGER
	image=image		array[n,m]; type: any
						image array to be displayed. If specified this image
						is displayed, overriding the filter specification.
	wid_base=wid_base
					scalar; type: long integer
						if this is the widget ID of a valid widget, then
						qImage assumes that it is an existing instance of
						itself and will use it to display the image
						Otherwise qImage will create a new instance.
 OUTPUTS:
	(to widget)
 CALLS: ***
	CW_FIELD, FILEPATH, InitVar, IsType, QSMEI_SKY_CLEAN, QSMEI_SKY_EVENT
	QSMEI_SKY_GAIN, QSMEI_SKY_SAVE, QSMEI_SKY_TRACKPEAK, XMANAGER, qImage_cw
	qsmei_sky_FileInfo, qsmei_sky_Pick, qsmei_sky_droplist, unexpected_event
 PROCEDURE:
	The state structure is as follows:

	state = {STATE_QSMEI_SKY,	$
		wid_send		: 0L, 	$		Row base widget
										user value: widget ID of widget to receive QIMAGE_SEND
											events (set by qImage_SendDestination)
		wid_exit		: 0L,	$		'Done' button
										user value: none
		wid_pick		: 0L,	$		'Image' button for selection of image file
										user value: none
		wid_filter		: 0L,	$		cw_field for entering file filter for image file selection
										user value: none
		wid_qimage_cw	: 0L,	$		compound widget qimage_cw
										user value: none
		wid_info		: 0L,	$		'Info' button to display information about the current image
										user value: string array containing information about image
		wid_clean		: 0L,	$
		wid_save		: 0L,	$
		wid_magnify		: 0L,	$
		foreign			: 0		$		set by qImage_SendDestination using keyword 'foreign'; controls how
										qImage reacts to QIMAGE_CW_UPDATE events from qImage_cw compound widget.
										foreign=0: ignore events
										foreign=1,2: call qImage_TrackPeak (used by the 'Track' option in qView).
		boxes			: fltarr(2,2,2)		$
		}
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qsmei_sky_droplist $SSW/smei/ucsd/camera/idl/sky/qsmei_sky_droplist.pro
[Previous] [Next]
 NAME:
	qsmei_sky_droplist
 PURPOSE:
	Droplist selections for maps in qsmei_sky widget
 CATEGORY:
	camera/idl/sky
 CALLING SEQUENCE:
	FUNCTION qsmei_sky_droplist, mode
 INPUTS:
	mode		scalar; type: string
				identifies type of map.
				Currently: 'sky','equ','zod','sid'
 OUTPUTS:
	lst			array; type: string
				list of maps stored in skymap (separate
				extensions in Fits file)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLED BY:
	qsmei_sky, qsmei_sky_Pick
 MODIFICATION HISTORY:
	JUN-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qsmei_sky_FileInfo $SSW/smei/ucsd/camera/idl/sky/qsmei_sky_fileinfo.pro
[Previous] [Next]
 NAME:
	qsmei_sky_FileInfo
 PURPOSE:
	Display information about current image file
 CATEGORY:
	Widget qImage
 CALLING SEQUENCE:
	PRO qsmei_sky_FileInfo, state
 INPUTS:
	state		array[1]; type: structure
					qImage state structure
 OUTPUTS:
	(to message dialog)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	IsType
 CALLED BY:
	qsmei_sky
 PROCEDURE:
	Displays the string stored in the user value of state.wid_info in
	a message dialog box when the state.wid_info is pushed.
	The user value is set by qImage_Pick.
 STATE INFO USED:
	widget_control, state.wid_info, get_uvalue=info
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qsmei_sky_Pick $SSW/smei/ucsd/camera/idl/sky/qsmei_sky_pick.pro
[Previous] [Next]
 NAME:
	qsmei_sky_Pick
 PURPOSE:
	Called by qsmei_sky_Event to select a new image using the IDL 'pickfile' dialog.
 CATEGORY:
	I/O
 CALLING SEQUENCE:
	FUNCTION qsmei_sky_Pick, state, event, skymap
 INPUTS:
	state			scalar, type: structure
						the state structure for the qImage widget
 OUTPUTS:
	status		scalar; type: byte
					0: if no image read
					1: if image available
	image		array[n,m]; type: any
					2D array if image file succesfully read, or doesn't exist
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	GetFileSpec, IsTime, IsType, TimeString, UNIQ [1], UNIQ [2], UNIQ [3], flt_string
	hide_env, qsmei_sky_droplist, smei_frm_name, smei_sky, unhide_env
 CALLED BY:
	qsmei_sky
 PROCEDURE:
 >	The value of state.wid_filter (displayed in the widget) is checked for
	wildcards.
 >	If a wildcard is found then the filter isused to initialize the 'pickfile'
	dialog, pick a file and read the file
 >	If no wildcard is present then the file is read
 >	The return value is 0 or 1 depending on whether an image was read succesfully.
 >	img_read is called with the /pseudo keyword set to reduce true color images to
	a 2D image array.
 >	The user value of state.wid_info is set with a string containing
	file name, image dimensions and (optionally) image info (if present).
 STATE INFO USED:
	widget_control, state.wid_filter, get_value=filter
 STATE INFO MODIFIED:
	widget_control, state.wid_info, set_uvalue=info, /no_copy
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS)
	MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added call to smei_buf_split_frame to handle SMEI L1A frame headers.


qTool $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qtool/qtool.pro
[Previous] [Next]
 NAME:
	qTool
 PURPOSE:
	Sets zoom and rebin factors for qImage_cw
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
	state		array[1]; type: structure
					qImage_cw state structure
	event		array[1]; type: structure
					event from state.wid_smei button
 OUTPUTS:
	Result		scalar; type: byte
					1B: display needs to be refreshed completely
						(by call to qImage_cw_Set_Value)
					0B: display does not need to be redrawn
 CALLS: ***
	CW_FIELD, FILEPATH, InitVar, IsType, LOADCT, QTOOL_EVENT, XMANAGER, qTool_State [1]
	qTool_State [2], qTool_Zoom [1], qTool_Zoom [2], qTool_rebin [1]
	qTool_rebin [2], unexpected_event
 CALLED BY:
	qImage_cw_Tool
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qTool_rebin [1] $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qloadct/qtool_rebin.pro
[Previous] [Next]
 NAME:
	qTool_rebin
 PURPOSE:
	Handles event related to rebinning operations
 CATEGORY:
	
 CALLING SEQUENCE:
	R = qTool_Rebin(state, event_id)
 INPUTS:
	state			array[1]; type: structure
						qTool state structure
	event_id		scalar; type: long integer
						widget ID of widget generating the rebin event
 OUTPUTS:
	R				scalar; type: integer
						0: screen needs to be redrawn
						1: screen does not need to be redrawn
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar
 CALLED BY:
	qTool
 PROCEDURE:
 MODIFICATION HISTORY:
	FEB-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	JUL-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Minor bug fix in update of cw_field containing rebin factor


qTool_rebin [2] $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qtool/qtool_rebin.pro
[Previous] [Next]
 NAME:
	qTool_rebin
 PURPOSE:
	Handles event related to rebinning operations
 CATEGORY:
	
 CALLING SEQUENCE:
	R = qTool_Rebin(state, event_id)
 INPUTS:
	state			array[1]; type: structure
						qTool state structure
	event_id		scalar; type: long integer
						widget ID of widget generating the rebin event
 OUTPUTS:
	R				scalar; type: integer
						0: screen needs to be redrawn
						1: screen does not need to be redrawn
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar
 CALLED BY:
	qTool
 PROCEDURE:
 MODIFICATION HISTORY:
	FEB-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	JUL-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Minor bug fix in update of cw_field containing rebin factor


qTool_State [1] $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qloadct/qtool_state.pro
[Previous] [Next]
 NAME:
	qTool_State
 PURPOSE:
 CATEGORY:
 CALLING SEQUENCE:
	qTool_State, state [, /send]
 INPUTS:
	state
 OPTIONAL INPUT PARAMETERS:
	/send
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, IsType, boost
 CALLED BY:
	qImage_cw, qTool
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qTool_State [2] $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qtool/qtool_state.pro
[Previous] [Next]
 NAME:
	qTool_State
 PURPOSE:
 CATEGORY:
 CALLING SEQUENCE:
	qTool_State, state [, /send]
 INPUTS:
	state
 OPTIONAL INPUT PARAMETERS:
	/send
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, IsType, boost
 CALLED BY:
	qImage_cw, qTool
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qTool_Zoom [1] $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qloadct/qtool_zoom.pro
[Previous] [Next]
 NAME:
	qTool_Zoom
 PURPOSE:
	Handles event related to zooming operations
 CATEGORY:
	
 CALLING SEQUENCE:
	R = qTool_Zoom(state, event_id)
 INPUTS:
	state			array[1]; type: structure
						qImage_cw state structure
	event_id		scalar; type: long integer
						widget ID of widget generating the zoom event
 OUTPUTS:
	R				scalar; type: integer
						0: screen needs to be redrawn
						1: screen does not need to be redrawn
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar
 CALLED BY:
	qTool
 PROCEDURE:
 MODIFICATION HISTORY:
	FEB-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	JUL-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Minor bug fix in update of cw_field containing zoom factor


qTool_Zoom [2] $SSW/smei/ucsd/sat/idl/widget/qimage_cw/qtool/qtool_zoom.pro
[Previous] [Next]
 NAME:
	qTool_Zoom
 PURPOSE:
	Handles event related to zooming operations
 CATEGORY:
	
 CALLING SEQUENCE:
	R = qTool_Zoom(state, event_id)
 INPUTS:
	state			array[1]; type: structure
						qImage_cw state structure
	event_id		scalar; type: long integer
						widget ID of widget generating the zoom event
 OUTPUTS:
	R				scalar; type: integer
						0: screen needs to be redrawn
						1: screen does not need to be redrawn
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar
 CALLED BY:
	qTool
 PROCEDURE:
 MODIFICATION HISTORY:
	FEB-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	JUL-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Minor bug fix in update of cw_field containing zoom factor


quadraticfit $SSW/smei/ucsd/gen/idl/toolbox/math/lsqquadraticfit.pro
[Previous] [Next]
 NAME:
	quadraticfit
 PURPOSE:
	Fits points to a quadratic polynomial
 CATEGORY:
	Math
 CALLING SEQUENCE:
	R = quadraticfit(x,y [,chisq=chisq])
 INPUTS:
	x		array[n,m] or array[2,n,m]; type: any
				m sequences of n x-coordinates
				if m=1 then the last dimension may be absent
				if y not specified then x must be of the form x[2,n,m] with
				x[0,*,*] the x-values and x[1,*,*] the y-values 
	y		array[n,m]; type: any
				m sequences of n y-coordinates matching the x-array
 OUTPUTS:
	R		array[3] or array[3,m]; type: double
				the 3 fitted constants in
					y = R[0]+R[1]*x+R[2]*x^2
 OPTIONAL OUTPUT PARAMETERS:
	chisq=chisq
			scalar, or array[m]; type: double
				residual chisq.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	LSQQUADRATICFIT, SubArray, SyncArgs
 PROCEDURE:
 >	If both x and y is called then it is allowed to specify only
	one set of x-values, x[n] and multiple sets of y-values, y[n,m]
	In that case each y-series is combined with x.
 >	The same can be accomplished with the IDL function poly_fit.
	polyfit uses a matrix inversion; here we use the analytic solution.
 MODIFICATION HISTORY:
	JAN-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView $SSW/smei/ucsd/sat/idl/widget/qview/qview.pro
[Previous] [Next]
 NAME:
	qView
 PURPOSE:
	View sequence of images
 CATEGORY:
	Widget
 CALLING SEQUENCE:
	qView, Filter, group=group
 INPUTS:
	Filter			scalar, character, default: filepath(root=getenv('SSW_SMEI_DAT'),'*.*')
 OPTIONAL INPUT PARAMETERS:
	group=Group		passed to xmanager when registering the qView widget
 OUTPUTS:
	(to widget)
 CALLS: ***
	CW_FIELD, FILEPATH, GetFileSpec, InitVar, IsType, QVIEW_EVENT, SetFileSpec, XMANAGER
	hide_env, qView_Deep, qView_Destroy, qView_Diff, qView_FileFilter, qView_Gain
	qView_GetData, qView_Glitch, qView_Image, qView_Movie, qView_PickFiles
	qView_PlotSeries, qView_Save2File, qView_SetBase, qView_SetBox, qView_ShowInfo
	qView_TrackPeak, qView_UpdateActive, qView_UpdateFiles, qView_UpdateTime
	qView_Wall, unexpected_event
 PROCEDURE:
	state = {STATE_QVIEW,		$
	wid_exit	: 0L,		$	'Done' button
	wid_info	: 0L,		$	'Info' button for displaying information about image cube
								user value: QIMAGE_SEND structure containing information
	wid_box		: 0L,		$	button widget for selecting area from image
								user value: none
	wid_init	: 0L,		$	base widget; a message to this widget is used by qView
								to initialize the file selection
								user value: none
	wid_pick	: 0L,		$	button widget for selecting files
								user value: string array with list of currently loaded files
	wid_folder	: 0L,		$	cw_field widget for entering directory
								user value: none
	wid_filter	: 0L,		$	cw_field widget for entering a file name filter
								user value: last filter for which file names were found
	wid_data	: 0L,		$	button widget for reading current file selection
								user value: the image cube read from the files
	wid_diff	: 0L,		$	droplist with options to control difference images
								user value: current selection
	wid_view	: 0L,		$	button for displaying current image
								user value: widget ID of the qImage base widget
								used for the display.
	wid_wall	: 0L,		$	'Wall' button for displaying a 'wall view'
								user value: none
	wid_movie	: 0L,		$	'Movie' button for generating a movie from the current image cube
								user value: none
	wid_series	: 0L,		$	'Series' button for displaying time series
								user value: none
	wid_track	: 0L,		$	'Track' button for starting tracking of a peak
								user value: off (0B) or on (1B) depending on wheter tracking is
								in progress.
	wid_glitch	: 0L,		$	'Deglitch' button for ininiating glitch removal
								user value: none
	wid_gain	: 0L,		$
	wid_save	: 0L,		$	button widget to save current image cube to disk
								user value: none
	wid_frst	: 0L,		$	cw_field, file index of first selected image file
								user value: none
	wid_last	: 0L,		$	cw_field, file index of last selected image file
								user value: none
	wid_incr	: 0L,		$	cw_field, file increment between selected images
								user value: none
	wid_select	: 0L,		$	label widget
								user value: none
	wid_forw	: 0L,		$	'-->' button to step to next image in sequence
								user value: none
	wid_active	: 0L,		$	cw_field displaying file index of currently selected image.
								user value: file index of displayed image; updated by
								qView_Image by copying the value into the user value each
								time a new image is displayed.
	wid_back	: 0L,		$	'<--' button to step to previous image in sequence
								user value: none
	wid_time	: 0L,		$	cw_field to set the time for image file
								user value: min and max time 
	wid_tmo		: 0L,		$	non-exclusive button for switching tracking sky motion
						in TMO data on/off
						user value: current on/off status

	setbase	: 0L,			$

	base_type	: 0L,		$
	base_ref	: 0L,		$
	base_order	: 0L,		$
	zactive	: lonarr(4)		$

	}
 MODIFICATION HISTORY:
	JAN-1999, Paul Hick (UCSD/CASS)
	FEB-2000, Paul Hick (UCSD/CASS)
		substantial facelift
	JUN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added /force to qview_UpdateActive call triggered by 
		state.wid_active to force screen update.


qView_ApplyGain $SSW/smei/ucsd/sat/idl/widget/qview/qview_applygain.pro
[Previous] [Next]
 NAME:
	qView_ApplyGain
 PURPOSE:

 CATEGORY:
	qView widget
 CALLING SEQUENCE:
	qView_ApplyGain, state, event, old, display=display, add=add
 INPUTS:
	atate
	event
	old
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CORRELATE, InitVar, IsTime, IsType, LINFIT, MEAN, TimeSplit, destroyvar, qLine
	qView_GetInfo
 CALLED BY:
	qView_Gain
 SEE ALSO:
 COMMON BLOCKS:
	common qView_Gain_Save, boxes, ngains, x , y
	(used internally only ??)
 SIDE EFFECTS:
 RESTRICTIONS:
 EXAMPLE:
 PROCEDURE:
 MODIFICATION HISTORY:
	JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_Deep $SSW/smei/ucsd/sat/idl/widget/qview/qview_deep.pro
[Previous] [Next]
 NAME:
	qView_Deep
 PURPOSE:
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
 OUTPUTS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS:
 CALLED BY:
	qView
 PROCEDURE:
 MODIFICATION HISTORY:
	JAN-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	FEB-200, Paul Hick (UCSD/CASS; pphick@ucsd.edu), complete overhaul


qView_Destroy $SSW/smei/ucsd/sat/idl/widget/qview/qview_destroy.pro
[Previous] [Next]
 NAME:
	qView_Destroy
 PURPOSE:
	Clean up
 CATEGORY:
	Widget
 CALLING SEQUENCE:
	qView_Destroy, event
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 INCLUDE:
	@compile_opt.pro				; On error, return to caller
 CALLS: ***
	smei_setup_roi
 CALLED BY:
	qView
 PROCEDURE:
 MODIFICATION HISTORY:
	JUN-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_Diff $SSW/smei/ucsd/sat/idl/widget/qview/qview_diff.pro
[Previous] [Next]
 NAME:
	qView_Diff
 PURPOSE:
 CATEGORY:
	sat/idl/widget/qview
 CALLING SEQUENCE:
	FUNCTION qView_Diff, state
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS:
 CALLED BY:
	qView
 PROCEDURE:
 MODIFICATION HISTORY:
	OCT-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_FileFilter $SSW/smei/ucsd/sat/idl/widget/qview/qview_filefilter.pro
[Previous] [Next]
 NAME:
	qView_FileFilter
 PURPOSE:
	Called by qView_Event to process message from the Filter widget.
 	The only message generated by the filter text box is an end-of-line message
 CATEGORY:
 CALLING SEQUENCE:
	Result = qView_FileFilter(state)
 INPUTS:
	state			array[1]; type: structure
						qView state structure
 OUTPUTS:
	Result			scalar, type byte
					1B: if files match the filter
					0B: if no files match the filter
 OPTIONAL OUTPUT PARAMETERS:
	(to widgets)
 INCLUDE:
	@compile_opt.pro				; On error, return to caller
 CALLS: ***
	CheckDir, FILEPATH, FindAllFiles, GetFileSpec, SetFileSpec, SuperArray, hide_env
	img_read, qView_InitBox, qView_UpdateFiles, unhide_env
 CALLED BY:
	qView
 PROCEDURE:
	>	Pick up the current filter value from the Filter widget
	>	Use FindAllFiles to find all files matching the filter
	>	If no files are found the value of state.wid_filter is updated
		using its user value (i.e. the last valid filter; presumably
		this was the value before user changed it).
	>	The file names returned by FindAllFiles are sorted and stored in
		in the user value of state.wid_pick
	>	The values of state.frstfile and state.lastfile are updated
		with the sequence number of the first and last file
		(!!! the first file in the list has sequence number one, ONE MORE
		than the IDL array index).
 STATE INFO USED:
	widget_control, state.wid_filter, get_value=filter
 STATE INFO MODIFIED:
	widget_control, state.wid_filter, set_uvalue=filter
	widget_control, state.wid_frst , set_value=frst
	widget_control, state.wid_last , set_value=last
	widget_control, state.wid_pick , set_uvalue=allfiles, /no_copy
 MODIFICATION HISTORY:
	JAN-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_Gain $SSW/smei/ucsd/sat/idl/widget/qview/qview_gain.pro
[Previous] [Next]
 NAME:
	qView_Gain
 PURPOSE:
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
 CALLS: ***
	destroyvar, qImage_SendDestination, qImage_TriggerSend, qView_ApplyGain
	qView_Image, qView_ImageInfo, qView_UpdateActive
 CALLED BY:
	qView
 SEE ALSO:
 COMMON BLOCKS:
	common qView_Gain_Save, boxes, ngains, x , y
 SIDE EFFECTS:
 RESTRICTIONS:
 EXAMPLE:
 PROCEDURE:
 MODIFICATION HISTORY:
	OCT-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_GetData $SSW/smei/ucsd/sat/idl/widget/qview/qview_getdata.pro
[Previous] [Next]
 NAME:
	qView_GetData
 PURPOSE:
	Read in an image cube.
	qView_GetData should be called only after qView_ReadFile has been
	called successfully so that the calls to img_read don't create errors
	(unless the files are corrupted)
 CATEGORY:
 CALLING SEQUENCE:
	qView_GetData, state
 INPUTS:
	state			scalar, structure
					contains IDs for all qView widgets
 OUTPUTS:
	(to widget)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	TimeLimits, TimeSplit, img_read, qImage_TriggerSend, qView_GetInfo
	qView_ImageInfo, qView_Sensitive, qView_SetInfo, qView_UpdateActive
 CALLED BY:
	qView
 PROCEDURE:
	>	The files to be read is determined from the widget values of
		state.wid_frst, state.wid_last, state.wid_incr and the user value
		of state.pickfiles
	>	The area to be extracted from the images is determined by the
		current readings of X and Y coordinate widgets
	>	img_read is used to read the files into the image cube
	>	The image cube is stored in the user value of state.wid_data
	>	Widgets which depend on presence of image cube are sensitized
 MODIFICATION HISTORY:
	JAN-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	FEB-200, Paul Hick (UCSD/CASS; pphick@ucsd.edu), complete overhaul


qView_GetImage $SSW/smei/ucsd/sat/idl/widget/qview/qview_getimage.pro
[Previous] [Next]
 NAME:
	qView_GetImage
 PURPOSE:
	Part of qView package; used in event processing
	Extracts a data array from the user value of state.getdata
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
	state			scalar, structure
					contains IDs for all qView widgets
 OPTIONAL INPUT PARAMETERS:
	id = id			scalar, type integer, valid values: 0,1,2,3, default: 0
		Defines the area (range of pixels in x and y direction) to be
		extracted from the data array.
		id=0:	extracts whole image area (data[*,*,i])
		id=1:	extracts range defined by box[*,1]		??Is this used at all???
		id=2:
		id=3:
	step=step		scalar, type integer, valid values: -1,0,1, default: 0
	/all			scalar, type integer, default: not set
	/fromactive		scalar, type integer, default: not set
 OUTPUTS:
	sz=sz			scalar, type: long integer
						# images currently in memory (in user value of state.getdata)
	minmax=minmax	2-element array, type: same as user value of state.getdata
						minimum and maximum of image set currently in memory
 OPTIONAL OUTPUT PARAMETERS:
 CALLS: ***
	InitVar
 CALLED BY:
	qView_XYZ_Update
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
	The user value of state.getdata contains a data array representing a
		2D (single) image or a 3D image cube.

	User value of state.activeimg:

	If the user value of state.activeimg is positive then the data array is a single full
		image as read by qView_ReadFile. The user value is the file number
		of image read into the data array.

	If the user value of state.activeimg is -1 then the data array is a 3D cube of images
		as read by qView_GetData (note that the 3rd dimension may be degenerate if
		only one image was read into the cube).

 MODIFICATION HISTORY:
	JAN-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_GetInfo $SSW/smei/ucsd/sat/idl/widget/qview/qview_getinfo.pro
[Previous] [Next]
 NAME:
	qView_GetInfo
 PURPOSE:
	Get information about current selected image area
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	Result = qView_GetInfo(state, 	$
		dim=dim, offset=offset, subdim=subdim, box=box, zval=zval, zhilo=zhilo,	$
		zback=zback, fixz=fixz, zlog=zlog, zoom=zoom,		$
	 	smei=smei, center=center, p_axis=p_axis, p_box=p_box, prorate=prorate)
 INPUTS:
	state			array[1]; type: structure
						qView state structure
 OPTIONAL OUTPUT PARAMETERS:
	dim		= dim		array[2]; type: integer
							dimensions of the full images (as stored in image file)
	offset	= offset	array[2]; type: integer
							pixel coordinates of the lower left corner of the image cube
							currently loaded in memory
	subdim	= subdim	array[2]; type: integer
							dimensions of the images in the current image cube
	box		= box		array[2,2]; type: integer
							square area of pixels in the image, expressed as pixel coordinates
							in the full images (i.e. including 'offset');
							box[0:1,*] is the lower left corner; box[0:1,*] the upper right
							corner. Box is fully contained in the images in the current
							image cube.
	zval	= zval		array[4]; type: float
							min, max, average and standard deviation for the 'box' area
	zhilo	= zhilo		array[2]; type: float
							min and max used to limit the range of pixel values if 'fixz' is set.
	zback	= zback

	fixz	= fixz		scalar; type: byte
							if set then 'zhilo' is used to limit the range of pixel values
							displayed in images and cross sections.
	zlog	= zlog		scalar; type: byte
							if set then pixel values are displayed on a logarithmic scale
	zoom	= zoom		scalar; type: integer
							zoom factor used in displaying a 'wall' view or and animation.

	smei	= smei
	center	= center
	p_axis	= p_axis
	p_box	= p_box
	prorate	= prorate
 CALLED BY:
	qView_ApplyGain, qView_GetData, qView_Glitch, qView_Image, qView_Movie
	qView_PlotSeries, qView_Save2File, qView_ShowInfo, qView_Wall
 PROCEDURE:
	The image area is selected using the qImage widget. This widget sends events
	to qView, where they are processed by qView_SetBox. They are stored in a structure
	which is maintained as user value of the state.wid_info widget.
	This procedure returns the information stored in that info structure.

	The info structure is defined in qImage_SendStructure
 STATE INFO USED:
	widget_control, state.wid_info, get_uvalue=info, /no_copy
 STATE INFO MODIFIED:
	widget_control, state.wid_info, set_uvalue=info, /no_copy
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	FEB-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added p_axis keyword to extract optical axis


qView_Glitch $SSW/smei/ucsd/sat/idl/widget/qview/qview_glitch.pro
[Previous] [Next]
 NAME:
	qView_Glitch
 PURPOSE:
	Initiate removal of glitches ('cosmic rays')
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	qView_Glitch, state
 INPUTS:
	state		array[1]; type: structure
					qView state structure
 OPTIONAL OUTPUT PARAMETERS:
	(modifications to the image cube stored as user value to the state.wid_data widget)
 CALLS: ***
	qGlitch, qView_GetInfo, qView_ImageInfo
 CALLED BY:
	qView
 RESTRICTIONS:
	For the time being this is only set up for the SMEI CCD images: the SMEI field of
	view is excluded.
 PROCEDURE:
	The pGlitch widget is called with the widget ID state.wid_data as keyword argument.
	When pGlitch removes glitches it modifies the user value of this widget. Also passed are
	the image offset and the file indices for the image cube. This accomplishes that the
	numbers (pixel coordinates, image numbers) in qView and pGlitch match.
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_Image $SSW/smei/ucsd/sat/idl/widget/qview/qview_image.pro
[Previous] [Next]
 NAME:
	qView_Image
 PURPOSE:
	Display an image using qImage widget
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	qView_Image, state [, /if_display]
 INPUTS:
	state				array[1]; structure
							qView state structure
 OPTIONAL INPUT PARAMETERS:
	/if_display			if set then the image is only displayed if a qImage widget already exists
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar, qImage, qView_GetInfo, qView_ImageInfo
 CALLED BY:
	qView, qView_Gain, qView_TrackPeak
 SIDE EFFECTS:
	The widget ID of the base widget of qImage is stored in the user value of state.wid_view.
	This ID is passed to qImage, which uses it to decide whether to create a new
	instance of qImage.
 PROCEDURE:
 STATE INFO USED:
	widget_control, state.wid_view, get_uvalue=wid_base, /no_copy
	widget_control, state.wid_pick, get_uvalue=allfiles, /no_copy
	widget_control, state.wid_data, get_uvalue=data, /no_copy
 STATE INFO MODIFIED:
	widget_control, state.wid_active, set_uvalue=new, /no_copy
	widget_control, state.wid_pick, set_uvalue=allfiles, /no_copy
	widget_control, state.wid_data, set_uvalue=data, /no_copy
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_ImageInfo $SSW/smei/ucsd/sat/idl/widget/qview/qview_imageinfo.pro
[Previous] [Next]
 NAME:
	qView_ImageInfo
 PURPOSE:
	Get information about current set of images loaded in memory
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
 INPUTS:
	state			array[1]; structure
						qView state structure
 OPTIONAL INPUT PARAMETERS:
	Each keyword retrieves different information. If more than one keyword is used
	the keywords are processed in the order listed and the information is concatenated into
	a single return long integer return array.

	file=file		scalar; type: integer
						the corresponding image index is added to the return array
	image=image		scalar; type: integer
						image index from the data cube in memory
						the corresponding file index is added to the return array
	/number_images	if set the number of images in the image cube is added
	/first_file		adds the file index for the first image in the image cube
	/last_file		adds the file index for the last image
	/incr_file		adds the file increment between images
	/active_file	adds the file index for the active image (rounded to the nearest valid index)
	/display_file	adds the file index for the image on display
	/list_file		adds the whole list of file indices for all images in the image cube
 OPTIONAL OUTPUT PARAMETERS:
	file=file		scalar; type: integer
						file index from the list of files
						if the input file was not on the list of files currently in memory
						then the output value is rounded to the nearest file index that is
						in memory.
	image=image		scalar; type: integer
						image index from the data cube in memory
						if the input image index was out of range the return value is set
						to the first or last image.
	INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar, IsType
 CALLED BY:
	qView_Gain, qView_GetData, qView_Glitch, qView_Image, qView_ModifyData
	qView_PlotSeries, qView_Save2File, qView_Sensitive, qView_SetBox, qView_ShowInfo
	qView_TMO_tracksky, qView_UpdateActive, qView_UpdateFiles, qView_UpdateTime
	qView_Wall
 RESTRICTIONS:
	At least one keyword must be set
 PROCEDURE:
	The images currently loaded in memory are stored in the user value of the state.wid_data
	widget. The images were read from a list of files stored in the user value of the
	state.wid_pick widget. The images were read from a part of the total list of files:
	from frst_file to last_file in steps of incr_file. The total number of files read (=
	the number of images in the image cube) is number_images.

	The file index is an index into the list of files. The image index is an index into the
	image cube array.
 STATE INFO USED:
	widget_control, state.wid_active, get_value=active, get_uvalue=display
	widget_control, state.wid_frst, get_value=frst
	widget_control, state.wid_last, get_value=last
	widget_control, state.wid_incr, get_value=incr
 STATE INFO MODIFIED:
	(none)
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_InitBox $SSW/smei/ucsd/sat/idl/widget/qview/qview_initbox.pro
[Previous] [Next]
 NAME:
	qView_InitBox
 PURPOSE:
	Set up 'Set Area' selection for a full image
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	qView_InitBox, state. dim
 INPUTS:
	state		array[1]; type: structure
					qView state structure
	dim			array[2]; type: integer
					image dimensions obtained from reading an image file
 OUTPUTS:
	(none)
 CALLS: ***
	qImage_SendStructure, qView_Sensitive, qView_SetInfo
 CALLED BY:
	qView_FileFilter, qView_PickFiles
 PROCEDURE:
	The area selected covers the full image
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_ModifyData $SSW/smei/ucsd/sat/idl/widget/qview/qview_modifydata.pro
[Previous] [Next]
 NAME:
	qView_ModifyData
 PURPOSE:
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
 EXTERNAL:
 CALLS: ***
	POLY_FIT, SFIT, SuperArray, qView_ImageInfo, qView_XYZ_Update
 SEE ALSO:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 EXAMPLE:
 PROCEDURE:
 MODIFICATION HISTORY:
	OCT-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_Movie $SSW/smei/ucsd/sat/idl/widget/qview/qview_movie.pro
[Previous] [Next]
 NAME:
	qView_Movie
 PURPOSE:
	Generate a animation from the current image cube
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	qView_Movie, state
 INPUTS:
	state		array[1]; type: structure
					qView state structure
 OUTPUTS:
	(none)
 CALLS: ***
	MagnifyArray, XINTERANIMATE, qImage_TriggerSend, qImage_cw_MinMax, qView_GetInfo
	qView_SetInfo
 CALLED BY:
	qView
 PROCEDURE:
	The last information send back from the qImage widget is used to decide what part of the
	image cube to animate (this takes into account the area selection and the zoom factor).
 STATE INFO USED:
	widget_control, state.wid_data, get_uvalue=data, /no_copy
 STATE INFO MODIFIED:
	widget_control, state.wid_data, set_uvalue=data, /no_copy
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_PickFiles $SSW/smei/ucsd/sat/idl/widget/qview/qview_pickfiles.pro
[Previous] [Next]
 NAME:
	qView_PickFiles
 PURPOSE:
	Called by qView_Event to process message from the Pick Files widget.
	Selects first and last image file using the IDL 'pickfile' dialog.
	Only the first and last selected files are used.
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	Result = qView_PickFiles(state)
 INPUTS:
	state			scalar, structure
					contains IDs for all qView widgets
 OUTPUTS:
	(to widget)
 CALLS: ***
	FILEPATH, FindAllFiles, GetFileSpec, SetFileSpec, SuperArray, UNIQ [1], UNIQ [2]
	UNIQ [3], hide_env, img_read, qView_InitBox, qView_UpdateFiles, unhide_env
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLED BY:
	qView
 PROCEDURE:
	>	The user value of state.wid_filter is used to initialize the 'pickfile' dialog
	>	Up to two files are selected by user.
	>	If no files are selected, return without modifying anything
	>	The selected files must have the same file type. If not an error message
		and nothing is modified.
	>	The directory and file type of the first selected file is used to
		update the value of state.wid_filter. The updated value is also stored
		in the user value of state.wid_filter, to indicate a valid filter (i.e. at
		least one file matches the filter). Effectively all files
		in a specific directory with a specific extension are picked up.
	>	FindAllFiles is called to find all files matching the updated filter
		(there will always be at least one).
	>	The file names returned by FindAllFiles are sorted and stored in
		in the user value of state.wid_pick
	>	The values of state.frstfile and state.lastfile are updated
		with the sequence number in the sorted list of files of the first
		and second selected file (!!! the first file in the list has sequence
		number one, ONE MORE than the IDL array index).
 STATE INFO USED:
	widget_control, state.wid_filter, get_value=filter
 STATE INFO MODIFIED:
	(only if a valid selection is made)
	widget_control, state.wid_filter, set_value=hide_env(filter), set_uvalue=filter
	widget_control, state.wid_frst, set_value=frst
	widget_control, state.wid_last, set_value=last
	widget_control, state.wid_pick, set_uvalue=allfiles, /no_copy
 MODIFICATION HISTORY:
	JAN-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_PlotSeries $SSW/smei/ucsd/sat/idl/widget/qview/qview_plotseries.pro
[Previous] [Next]
 NAME:
	qView_PlotSeries
 PURPOSE:
	Calculate a 'time series' through a sequence of images for a specified image area
	and display it using the qLine widget
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	qView_PlotSeries, state
 INPUTS:
	state		array[1]; type: structure
					qView state structure
 OUTPUTS:
	(to qLine widget)
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	CV_COORD, Inside_Wedge, IsTime, STDDEV, SuperArray, TimeSplit, gridgen
	qImage_TriggerSend, qImage_cw_BoxCosine, qImage_cw_Wedge, qLine, qView_GetInfo
	qView_ImageInfo, qView_SetInfo, qView_TMO_tracksky
 CALLED BY:
	qView
 PROCEDURE:
	The last information send back from the qImage widget is used to decide what image area
	to use. Two time series are displayed: the average and the standard deviation for
	the image area as a function of image number.
	If time information is available from the state.wid_time widget then
	a time axis is plotted instead of the image number.
 STATE INFO USED:
	widget_control, state.wid_data, get_uvalue=data, /no_copy
	widget_control, state.wid_time , get_uvalue=trange
 STATE INFO MODIFIED:
	widget_control, state.wid_data, set_uvalue=data, /no_copy
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_PlotTrack $SSW/smei/ucsd/sat/idl/widget/qview/qview_plottrack.pro
[Previous] [Next]
 NAME:
	qView_PlotTrack
 PURPOSE:
	Accumulate results from tracking of peak by qView_TrackPeak, and
	display final result using qLine.
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	qView_PlotTrack, state, event, old, display=display, add=add
 INPUTS:
	state		array[1]; type: structure
					qView state structure
	event		array[1]; type: structure
					event from state.wid_track button, or from qImage widget
	old			scalar; type: integer
					file index for the image to which the tracking information
					in 'event' applies (this is passes to qLine as x-axis)
 OPTIONAL INPUT PARAMETERS:
	/display	if set, then qLine is called to display the tracking results
				(this keyword is used by qView_TrackPeak after the last image has
				been processed).
	/add		if set, then the information from 'event' is added to tracking
				info alread stored
	/destroy	destroys variables stored in common block; then returns
				without any further action.
 OUTPUTS:
	(to qLine widget)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CV_COORD, InitVar, IsTime, LINFIT, MEAN, TimeSplit, destroyvar, qLine
 CALLED BY:
	qView_TrackPeak
 COMMON BLOCKS:
	common qView_PlotTrack_Save, npeaks, x, y
				stores the tracking information
 PROCEDURE:
	The 'event' structure is set up and dispatched by the procedure qImage_TrackPeak.
	It contains the x and y coordinates of the centroid among other quantities.
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_Save2File $SSW/smei/ucsd/sat/idl/widget/qview/qview_save2file.pro
[Previous] [Next]
 NAME:
	qView_Save2File
 PURPOSE:
	Save the currently loaded image cube to disk.
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	qView_Save2File, state
 INPUTS:
	state		array[1]; type: structure
					qView state structure
 OUTPUTS:
	(to disk)
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	FILEPATH, GetFileSpec, ISARRAY [1], ISARRAY [2], ISARRAY [3], MagnifyArray, REVERSE
	SetFileSpec, TimeSet, TimeUnit, WRITE_GIF, WRITE_IMAGE, bin_write, mk_flick
	qImage_TriggerSend, qImage_cw_MinMax, qSlider, qView_GetInfo, qView_ImageInfo
	qView_SetInfo, strsplit
 CALLED BY:
	qView
 PROCEDURE:
	The IDL 'pickfile' dialog is used to select a directory and a filename
	(default directory is $TEMP; default file name is qview.pph).
	Each image from the image cube is written into a separate binary file.
	A sequence number is added after the selected file name as an I3.3 integer,
	i.e. qview001.pph. The sequence number is based on the file index for
	each image.

	The binary files can be read using
		status = bin_read(file_name, img, /header)
	qView uses this read statement for files with extension '.pph'
 STATE INFO USED:
	widget_control, state.wid_data, get_uvalue=data, /no_copy
 STATE INFO MODIFIED:
	widget_control, state.wid_data, set_uvalue=data, /no_copy
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_Sensitive $SSW/smei/ucsd/sat/idl/widget/qview/qview_sensitive.pro
[Previous] [Next]
 NAME:
	qView_Sensitive
 PURPOSE:
	Controls the sensitivity for most widgets in the qView widget
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	qView_Sensitive, state, /set_box
	qView_Sensitive, state, /get_data
	qView_Sensitive
 INPUTS:
	state		array[1]; type: structure
					qView state structure
 OPTIONAL INPUT PARAMETERS:
	If no keyword is set then all the task widgets are sensitized.

	/set_box	sensitizes the 'Set Area' widget, while desensitizing
				the 'Read Area' and all task widgets
	/get_data	sensitizes the 'Read Area' widget while desensitizing
				all task widgets.
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	InitVar, qView_ImageInfo
 CALLED BY:
	qView_GetData, qView_InitBox, qView_SetBox, qView_UpdateFiles
 RESTRICTIONS:
	/set_box and /get_data should not be set at the same time
 PROCEDURE:
	The main function of this routine to keep the task widgets desensitized
	when a condition arises that would make information stored in the
	widget values (first, last file, file increment, etc.) inconsistent
	with the image cube currently loaded. By desensitizing the task widgets
	the user is force to set up a new image cube using the 'Set Area' and
	'Read Area' widgets.
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_SetBase $SSW/smei/ucsd/sat/idl/widget/qview/qview_setbase.pro
[Previous] [Next]
 NAME:
	qView_SetBase
 PURPOSE:
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
 EXTERNAL:
 CALLS: ***
	qView_XYZ_Update
 CALLED BY:
	qView
 SEE ALSO:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 EXAMPLE:
 PROCEDURE:
 MODIFICATION HISTORY:
	OCT-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_SetBox $SSW/smei/ucsd/sat/idl/widget/qview/qview_setbox.pro
[Previous] [Next]
 NAME:
	qView_SetBox
 PURPOSE:
	Select an area from an image for further processing
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	qView_SetBox, state, event
 INPUTS:
	state		array[1]; type: structure
					qView state structure
	event		array[1]; type: structure
					event from the state.wid_box widget
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	qImage, qImage_SendDestination, qView_ImageInfo, qView_Sensitive, qView_SetInfo
 CALLED BY:
	qView
 PROCEDURE:
	A button press on the 'Set Area' button generates a button event which results in a call
	to qImage to put the first image of a selected sequence on the display. The user selects
	an area in qImage then presses the 'Send' button. This results in a QIMAGE_SEND event
	which ends up here again to be processed by qView_SetInfo. qView_SetInfo store the area
	information in a structure for use by other qView procedures.
 STATE INFO USED:
	widget_control, state.wid_pick, get_uvalue=allfiles, /no_copy
	widget_control, state.wid_view, get_uvalue=wid_base, /no_copy
 STATE INFO MODIFIED:
	widget_control, state.wid_pick, set_uvalue=allfiles, /no_copy
	widget_control, state.wid_view, set_uvalue=wid_base, /no_copy
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_SetInfo $SSW/smei/ucsd/sat/idl/widget/qview/qview_setinfo.pro
[Previous] [Next]
 NAME:
	qView_SetInfo
 PURPOSE:
	Store information received from qImage widget by a QIMAGE_SEND event.
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	qView_SetInfo, state, event, boxset=boxset
 INPUTS:
	state			array[1]; type: structure
						qView state structure
	event			array[1]; type: structure
						QIMAGE_SEND event
 OPTIONAL INPUT PARAMETERS:
	/boxset			see PROCEDURE
 OUTPUTS:
	(stored in user value of state.wid_info
 CALLS: ***
	qImage_SendStructure
 CALLED BY:
	qView_GetData, qView_InitBox, qView_Movie, qView_PlotSeries, qView_Save2File
	qView_SetBox, qView_Wall
 PROCEDURE:
	The structure used to store the information consists of two groups.
	The first group describes the image cube as a whole:
		info.dim 	= the dimensions of the full image (as read from file)
		info.offset = the offset of the images in the cube
		info.subdim	= the dimensions of the images in the cube
	If /boxset is set these fields are set using the event.dim and event.box
	information from the QIMAGE_SEND event:
		info.dim 	= event.dim
		info.offset = event.box[0:1]
		info.subdim	= event.box[2:3]-event.box[0:1]+1
	qView_SetBox will set /boxset after displaying a full image (read from file)
	in the qImage widget. A 'Send Info' message returned from qImage will
	have event.dim set to the full image dimensions, event.offset=[0,0] and
	event.box defines some area inside the image. This area will be read by the
	next 'Get Data' from the sequence of images and stored in the image cube.

	The other fields describe the content of the event.box area. These are always
	updated using the QIMAGE_SEND information:
		info.box, info.zval, info.zhilo, info.fixz, info.zlog, info.zoom
	These are described in qView_GetInfo.
 STATE INFO USED:
	widget_control, state.wid_info, get_uvalue=info, /no_copy
 STATE INFO MODIFIED:
	widget_control, state.wid_info, set_uvalue=info, /no_copy
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_Shortname $SSW/smei/ucsd/sat/idl/widget/qview/qview_shortname.pro
[Previous] [Next]
 NAME:
	qView_Shortname
 PURPOSE:
	Search for short hand representation for string array 'files'
 CATEGORY:
	Widget qImage
 CALLING SEQUENCE:
	R = qView_Shortname(str, seq)
 INPUTS:
	str			array; type: string
					array of strings (usually a list of file names)
 OUTPUTS:
	R			scalar; type: byte
					0B: no short hand representation found
						(in this case 'seq' will not exist)
					1B: short hand representation found
	seq			array; type: string
					short hand representation. Will have the same
					length as the input array 'str'.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	GetFileSpec, UNIQ [1], UNIQ [2], UNIQ [3]
 PROCEDURE:
	Given a list of strings of equal length: ['xxayy','xxbyy','xxcyy','xxdyy'],
	the list ['a','b','c','d'] is returned, i.e. all common parts are removed and
	the residuals are returned.
 MODIFICATION HISTORY:
	JAN-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_ShowInfo $SSW/smei/ucsd/sat/idl/widget/qview/qview_showinfo.pro
[Previous] [Next]
 NAME:
	qView_ShowInfo
 PURPOSE:
	Display dialog box containing information about current image
 CATEGORY:
	Widgets: qView
 CALLING SEQUENCE:
	qView_ShowInfo
 INPUTS:
	state		array[1]; type: structure
					qView state structure
 OUTPUTS:
	(to dialog box)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	qView_GetInfo, qView_ImageInfo
 CALLED BY:
	qView
 PROCEDURE:
	Extracts information from state variable
 STATE INFO USED:
	widget_control, state.wid_box , get_value=cbox
	widget_control, state.wid_data, get_value=cdata
	widget_control, state.wid_pick  , get_uvalue=allfiles, /no_copy
 STATE INFO MODIFIED:
	widget_control, state.wid_pick, set_uvalue=allfiles, /no_copy
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_SubtractBase $SSW/smei/ucsd/sat/idl/widget/qview/qview_subtractbase.pro
[Previous] [Next]
 NAME:
	qView_SubtractBase
 PURPOSE:
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 CALLS: ***
	InitVar, MEAN, SuperArray
 SIDE EFFECTS:
 PROCEDURE:
 MODIFICATION HISTORY:
	OCT-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_TMO_tracksky $SSW/smei/ucsd/sat/idl/widget/qview/qview_tmo_tracksky.pro
[Previous] [Next]
 NAME:
	qView_TMO_tracksky
 PURPOSE:

 CATEGORY:
 CALLING SEQUENCE:
	box_data = qView_TMO_tracksky(state, nimg, data, box, center, p_axis)
 INPUTS:
	state		array[1]; type: structure
					qView state structure
	nimg		scalar; type: integer
					# images stored in data
	data		array[nx,ny,nimg]; type: float
					image cube
	box			array[2,2]; type: integer
					square box in image of size [nx,ny]
					box[0:1,0] is the lower left corner
					box[0:1,1] is the upper right corner
	center		array[2]; type: float
					x- and y-coordinate of center of SMEI fov arc
	p_axis		array[2]; type: float
					azimuth and radius of optical axis relative to 'center'
 OPTIONAL INPUT PARAMETERS:
	/nearest	calculates data values using nearest neighbours instead of
				bilinear interpolation.
 OUTPUTS:
	box_data		array[n,m,nimg]
					array of data values obtained by interpolating on 'data'
					n,m correspond to the size of 'box'
 OPTIONAL OUPUT PARAMETERS:
	rfov=rfov		array[2,n,m,nimg]
					x- and y-coordinates for all pixels as they move
					across the sky through the 'nimg' images in the image cube.
					Only coordinates inside the field of view are returned.
					When a pixel moves outside the fov BadValue(0.0) is returned.
	pfov=pfov		array[2,n,m,nimg]
					polar coordinates for all pixels.
					When a pixel moves outside the fov BadValue(0.0) is returned.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	BadValue, GetFileSpec, InitVar, SetFileSpec, TMO_tracksky, qView_ImageInfo
 CALLED BY:
	qView_PlotSeries
 SIDE EFFECTS:
 PROCEDURE:
	The x- and y-coordinates in 'center' and 'box' are measured relative
	to the same origin, e.g. the lower left corner of the image on display,
	or the lower left corner of the original image if only a portion of
	an image is loaded. The output values in 'rfov' also are relative to
	this origin.

	The input 'box' is applied to the image on display (not necessarily the
	first image in the sequence). All pixels of this box inside the field of
	view (stored in 'ifov') are tracked as they move across the field of view.
	The changing coordinates are returned in 'rfov'.
	Function values are calculated by linear interpolation.
 MODIFICATION HISTORY:
	FEB-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_TrackPeak $SSW/smei/ucsd/sat/idl/widget/qview/qview_trackpeak.pro
[Previous] [Next]
 NAME:
	qView_TrackPeak
 PURPOSE:
	Track a peak across a sequence of images. Results are displayed using
	the qLine widget.
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	qView_TrackPeak, state, event
 INPUTS:
	state		array[1]; type: structure
					qView state structure
	event		array[1]; type: structure
					event from state.wid_track button, or from qImage widget
 OUTPUTS:
	(to qLine widget)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CV_COORD, flat_centerofmass, qImage_SendDestination, qImage_TriggerSend
	qView_Image, qView_PlotTrack, qView_UpdateActive
 CALLED BY:
	qView
 SIDE EFFECTS:
	The user value of state.wid_track is set to 1B when tracking starts.
	As long as the value is set any 'Send' messages from qImage are ignored.
 PROCEDURE:
	The qImage widget is used to display images and show the tracking procedure.
	qImage is called with the 'tracking' keyword set to a non-zero value to
	indicate that events send back to qView are processed here.

	A button press on the state.track widget results in a WIDGET_BUTTON event to
	this procedure. The first image is displayed using the qImage widget.
	When the user presses the 'Send' button in qImage or exits qImage a QIMAGE_SEND
	event is send back to the qView widget, which ends up here again.

	After confirming the information from the qImage widget the first widget is
	displayed again, and tracking begins. qImage will now send QIMAGE_TRACK events
	back to this procedure which contain the tracking results.

	The tracking results are stored by qView_PlotTrack and the next image is
	displayed in qImage. When all images have been processed the first image is
	displayed again by qImage with the tracking keyword set to zero to indicate
	that events should not be send to this procedure anymore.
 STATE INFO USED:
	widget_control, state.wid_track, get_uvalue=set
 STATE INFO MODIFIED:
	widget_control, state.wid_track, set_uvalue=0B
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_UpdateActive $SSW/smei/ucsd/sat/idl/widget/qview/qview_updateactive.pro
[Previous] [Next]
 NAME:
	qView_UpdateActive
 PURPOSE:
	Update the widget value indicating the current active image file
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	Result = qView_UpdateActive(state[, step=step, /noloop, new=new, old=old])
 INPUTS:
	state		array[1]; type: structure
					qView state structure
 OPTIONAL INPUT PARAMETERS:
	step=step	scalar; type: integer; default: 0
					only values -1,0,1 should be used.
					-1 indicates going to the previous image in the loaded sequence
					+1 indicates going to the next image in the loaded sequence
					0  indicates staying at the current image
	/first		scalar; type: integer
					if set the first image is made the active image
	/noloop		by default, if step=+/-1 is used the next/previous image is passed the end of
				of the sequence then the first/last image of the sequence is used.
				This can be prevented from happening by setting /noloop (in this case new=-1
				is returned when stepping beyond the image sequence).
 OUTPUTS:
	Result		scalar; type: byte
				0B if the new active image is the same as the one on display
				1B if this is not the case.
				(this can be used by the caller to call qView_Image if this routine returns 1B.
 OPTIONAL OUTPUT PARAMETERS:
	old=old		scalar; type: integer
				the file index for the active image before the update
	new=new		scalar; type: integer
				the file index after the update
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, IsType, qView_ImageInfo
 CALLED BY:
	qView, qView_Gain, qView_GetData, qView_TrackPeak, qView_UpdateFiles
	qView_UpdateTime
 PROCEDURE:
 STATE INFO MODIFIED:
	widget_control, state.wid_active, set_value =new
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS)
	MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added value and time keywords


qView_UpdateFiles $SSW/smei/ucsd/sat/idl/widget/qview/qview_updatefiles.pro
[Previous] [Next]
 NAME:
	qView_UpdateFiles
 PURPOSE:
	Called by qView_Event to process messages from the
	state.frstfile, state.lastfile and state.incrfile widgets.
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	qView_UpdateFiles, state
 INPUTS:
	state			array[1]; type: structure
						qView state structure
 OUTPUTS:
	(to widgets)
 CALLS: ***
	qView_ImageInfo, qView_Sensitive, qView_UpdateActive
 CALLED BY:
	qView, qView_FileFilter, qView_PickFiles
 PROCEDURE:
	Processes messages from state.wid_frst, state.wid_last and state.wid_incr widgets.
 STATE INFO USED:
	widget_control, state.wid_pick  , get_uvalue=allfiles, /no_copy
 STATE INFO MODIFIED:
	widget_control, state.wid_pick  , set_uvalue=allfiles, /no_copy
 MODIFICATION HISTORY:
	JAN-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu), complete overhaul


qView_UpdateTime $SSW/smei/ucsd/sat/idl/widget/qview/qview_updatetime.pro
[Previous] [Next]
 NAME:
	qView_UpdateTime
 PURPOSE:
	Update the widget when time is changed
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	Result = qView_UpdateTime(state)
 INPUTS:
	state		array[1]; type: structure
					qView state structure
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
	Result		scalar; type: byte
				0B if the new active image is the same as the one on display
				1B if this is not the case.
				(this can be used by the caller to call qView_Image if this routine returns 1B.
 OPTIONAL OUTPUT PARAMETERS:
 CALLS: ***
	IsTime, TimeOp, TimeSplit, TimeUnit, qView_ImageInfo, qView_UpdateActive
 CALLED BY:
	qView
 PROCEDURE:
 STATE INFO MODIFIED:
 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_Wall $SSW/smei/ucsd/sat/idl/widget/qview/qview_wall.pro
[Previous] [Next]
 NAME:
	qView_Wall
 PURPOSE:
	Display as many images as possible using 'twin, /wall'
 CATEGORY:
	Widget qView
 CALLING SEQUENCE:
	qView_Wall, state
 INPUTS:
	state		array[1]; type: structure
					qView state structure
 OUTPUTS:
	(none)
 CALLS: ***
	MagnifyArray, View, qImage_TriggerSend, qImage_cw_MinMax, qView_GetInfo
	qView_ImageInfo, qView_SetInfo, twin
 CALLED BY:
	qView
 PROCEDURE:
	The user value of state.wid_wall is checked to see whether a wall view is active
	If not then as many image from the image cube are displayed as will fit the screen.
	If it is then all windows with images are destroyed.
	The last information send back from the qImage widget is used to decide what part of the
	image cube to display (this takes into account the area selection and the zoom factor).
 STATE INFO USED:
	widget_control, state.wid_wall, get_uvalue=wallview
	widget_control, state.wid_data, get_uvalue=data, /no_copy
 STATE INFO MODIFIED:
	widget_control, state.wid_data, set_uvalue=data, /no_copy
	widget_control, state.wid_wall, set_uvalue=1B-wallview
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qView_XYZ_Update $SSW/smei/ucsd/sat/idl/widget/qview/qview_xyz_update.pro
[Previous] [Next]
 NAME:
	qView_XYZ_Update
 PURPOSE:
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
	state		scalar, structure
				contains IDs for all qView widgets
 OPTIONAL INPUT PARAMETERS:
	id=id		scalar, type integer, values: 0,1,2,3; default: 2
	/get		scalar, type integer
				picks up values from x,y widgets, and puts them in the appropriate
				locations of the user value of the state.box[0,0] widget
	/put		scalar, type integer
				picks up the appropriate fields of the user value of the state.box[0,0]
				and puts them in the x,y widgets
	/noz		scalar, type integer
				if set then the values of the widgets for min, max, mean and std. dev
				are not updated
 OUTPUTS:
 INCLUDE:
	@compile_opt.pro							; On error, return to caller
 OPTIONAL OUTPUT PARAMETERS:
 CALLS: ***
	InitVar, MEAN, STDDEV, qView_GetImage
 CALLED BY:
	qView_ModifyData, qView_SetBase
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
	JAN-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qvox $SSW/smei/ucsd/sat/idl/widget/qvox/qvox.pro
[Previous] [Next]
 NAME:
	qvox
 PURPOSE:
	Widget wrapper for vu_vox_sequence
 CATEGORY:
	Widgets
 CALLING SEQUENCE:
	qvox, group=group
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
	group=group		scalar; type: long integer
						group leader passed to XMANAGER
 OUTPUTS:
	(to widget)
 CALLS: ***
	CW_FIELD, FILEPATH, QVOX_EVENT, XMANAGER, unexpected_event, vu_vox_sequence
 PROCEDURE:


qvu $SSW/smei/ucsd/sat/idl/widget/qvu/qvu.pro
[Previous] [Next]
 NAME:
	qvu
 PURPOSE:
	Widget for analyzing content of nv3d tomography file
 CATEGORY:
	Widget qvu
 CALLING SEQUENCE:
	qvu
 INPUTS:
	group=Group		passed to xmanager when registering the qView widget
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 CALLS: ***
	BadValue, CW_FIELD, FILEPATH, InitVar, QVU_EVENT, XMANAGER, qslider_cw, qvu_display
	qvu_draw, qvu_fixgrid, qvu_kill, qvu_loadct, qvu_pick, qvu_rebin, qvu_value
	qvu_whatis, unexpected_event
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
	State structure:

	state = {STATE_QT3D,			$
	wid_top		: 0L,			$
	wid_pick	: 0L,			$
	wid_path	: 0L,			$

	wid_type	: 0L,			$				; uvalue: current droplist index
	wid_index	: 0L,			$				; uvalue: current droplist index

	wid_info	: 0L,			$
	wid_done	: 0L,			$

	wid_loadct	: 0L,			$

	wid_pole_lng: 0L,			$
	wid_pole_lat: 0L,			$
	wid_pole_rad: 0L,			$
	wid_pole_tim: 0L,			$

	wid_minvalue: 0L,			$
	wid_maxvalue: 0L,			$
	wid_fixscale: 0L,			$

	wid_cuttingplane: 0L,		$
	wid_synopticmap	: 0L,		$
	wid_orthographic: 0L,		$

	wid_value	: 0L,			$

	wid_grid	: 0L,			$				; uvalue: size of draw widget
	wid_rebin	: [0L,0L,0L],	$

	wid_draw	: 0L,			$				; uvalue: function value
	wid_plane	: 0L,			$

	count		: 0L,			$

	type_list	: ['nv','bb'],	$
	nv_list		: ['velocity' ,'density' ],	$
	bb_list		: ['B(radial)','B(tang)' ]	$
	}

 MODIFICATION HISTORY:
	SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qvu_display $SSW/smei/ucsd/sat/idl/widget/qvu/qvu_display.pro
[Previous] [Next]
 NAME:
	qvu_display
 PURPOSE:
	Section headings used to document SMEI IDL code
 CATEGORY:
	sat/idl/widget/qvu
 CALLING SEQUENCE:
	FUNCTION qvu_display, state, event
 INPUTS:
	state		array[1]; type: structure
					qvu state structure
	event		array[1]; type: structure
					event structure
 OUTPUTS:
	redraw		0: do not redraw display
				1: redraw display
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS:
 CALLED BY:
	qvu
 SEE ALSO:
 PROCEDURE:
 MODIFICATION HISTORY:
	OCT-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qvu_draw $SSW/smei/ucsd/sat/idl/widget/qvu/qvu_draw.pro
[Previous] [Next]
 NAME:
	qvu_draw
 PURPOSE:
	Redraws qvu window
 CATEGORY:
	sat/idl/widget/qvu
 CALLING SEQUENCE:
	PRO qvu_draw, state, event
 INPUTS:
	state		array[1]; type: structure
					qvu state structure
	event		array[1]; type: structure
					event structure
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro					; On error, return to caller
 CALLS: ***
	AngleRange, BadValue, CONGRID [1], CONGRID [2], CONGRID [3], CV_COORD, CvT3d
	EulerRotate, InterpolateHeliosphere, MagnifyArray, arg_time, gridgen, plot3darc
	plot3dline, setup3d, unitvectors, vu_get, vu_gettime
 CALLED BY:
	qvu
 PROCEDURE:
	If a time sequences is loaded then the image is based on the 3D matrix
	at the time set by the time slider, either by interpolation (if the fixgrid
	button is NOT set) or by picking the nearest grid time (if the fixgrid button
	IS set).
 MODIFICATION HISTORY:
	SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qvu_fixgrid $SSW/smei/ucsd/sat/idl/widget/qvu/qvu_fixgrid.pro
[Previous] [Next]
 NAME:
	qvu_fixgrid
 PURPOSE:
	Destroys qvu widget
 CATEGORY:
	Widget qvu
 CALLING SEQUENCE:
	PRO qvu_Fixgrid, state, event
 INPUTS:
	state		array[1]; type: structure
					qSet_Page state structure
	event		array[1]; type: structure
					event structure send by 'Done' widget
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro					; On error, return to caller
 CALLED BY:
	qvu
 SIDE EFFECTS:
 PROCEDURE:
 MODIFICATION HISTORY:
	SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qvu_kill $SSW/smei/ucsd/sat/idl/widget/qvu/qvu_kill.pro
[Previous] [Next]
 NAME:
	qvu_kill
 PURPOSE:
	Destroys qvu widget
 CATEGORY:
	Widget qvu
 CALLING SEQUENCE:
	PRO qvu_kill, state, event
 INPUTS:
	state		array[1]; type: structure
					qSet_Page state structure
	event		array[1]; type: structure
					event structure send by 'Done' widget
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro					; On error, return to caller
 CALLED BY:
	qvu
 SIDE EFFECTS:
 PROCEDURE:
	Calls widget_control, event.handler, /destroy
 MODIFICATION HISTORY:
	SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qvu_loadct $SSW/smei/ucsd/sat/idl/widget/qvu/qvu_loadct.pro
[Previous] [Next]
 NAME:
	qvu_loadct
 PURPOSE:
	Destroys qvu widget
 CATEGORY:
	Widget qvu
 CALLING SEQUENCE:
	PRO qvu_loadct, state, event
 INPUTS:
	state		array[1]; type: structure
					qSet_Page state structure
	event		array[1]; type: structure
					event structure send by 'Done' widget
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro					; On error, return to caller
 CALLS: ***
	XLOADCT [1], XLOADCT [2], XLOADCT [3]
 CALLED BY:
	qvu
 SIDE EFFECTS:
 PROCEDURE:
 MODIFICATION HISTORY:
	SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qvu_pick $SSW/smei/ucsd/sat/idl/widget/qvu/qvu_pick.pro
[Previous] [Next]
 NAME:
	qvu_pick
 PURPOSE:
	Selects and reads tomography data files
 CATEGORY:
	Widget qvu
 CALLING SEQUENCE:
	PRO qvu_pick, state, event
 INPUTS:
	state		array[1]; type: structure
					qvu state structure
 OPTIONAL INPUT PARAMETERS:
	type=type	scalar; type: string
					3-char type to be used as file name extension (bmp, eps, gif)
	/pick		if set then the IDL pickfile dialog is used to let user set
					keyword 'type' takes precedence over /pick
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro							; On error, return to caller
 CALLS: ***
	CarringtonVar, GetFileSpec, boost, destroyvar, vu_get, vu_getdata
 CALLED BY:
	qvu
 PROCEDURE:
 MODIFICATION HISTORY:
	SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qvu_rebin $SSW/smei/ucsd/sat/idl/widget/qvu/qvu_rebin.pro
[Previous] [Next]
 NAME:
	qvu_rebin
 PURPOSE:
	Destroys qvu widget
 CATEGORY:
	Widget qvu
 CALLING SEQUENCE:
	PRO qvu_rebin, state, event
 INPUTS:
	state		array[1]; type: structure
					qSet_Page state structure
	event		array[1]; type: structure
					event structure send by 'Done' widget
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro					; On error, return to caller
 CALLED BY:
	qvu
 SIDE EFFECTS:
 PROCEDURE:
 MODIFICATION HISTORY:
	SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qvu_value $SSW/smei/ucsd/sat/idl/widget/qvu/qvu_value.pro
[Previous] [Next]
 NAME:
	qvu_value
 PURPOSE:
 CATEGORY:
	Widget qvu
 CALLING SEQUENCE:
	PRO qvu_value, state, event
 INPUTS:
	state		array[1]; type: structure
					qSet_Page state structure
	event		array[1]; type: structure
					event structure send by 'Done' widget
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro					; On error, return to caller
 CALLED BY:
	qvu
 SIDE EFFECTS:
 PROCEDURE:
 MODIFICATION HISTORY:
	SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


qvu_whatis $SSW/smei/ucsd/sat/idl/widget/qvu/qvu_whatis.pro
[Previous] [Next]
 NAME:
	qvu_whatis
 PURPOSE:
	Displays information about loaded volume data	
 CATEGORY:
	sat/idl/widget/qvu
 CALLING SEQUENCE:
	PRO qvu_whatis, state, event
 INPUTS:
	state		array[1]; type: structure
					qSet_Page state structure
	event		array[1]; type: structure
					event structure send by 'Done' widget
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro					; On error, return to caller
 CALLS: ***
	WhatIs
 CALLED BY:
	qvu
 SIDE EFFECTS:
 PROCEDURE:
 MODIFICATION HISTORY:
	SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)