SAVE_PROFILE $SSW/smei/bham/idl/smei_sequence/save_profile.pro
[Previous] [Next]
 NAME:
	SAVE_PROFILE


 PURPOSE:
	Save a profile to a file or to top level variables.


 CATEGORY:
	(SMEI_SEQUENCE)


 CALLING SEQUENCE:
	save_profile,profile, pa, elong, date


 INPUTS:
	profile	float	The 3-d array with the profile.
	pa	float	The position angles of the bin centres
	elong	float	The elongations of the bin centres.
	date	double	The start and end times of the images from
			which the sequence was made.


 KEYWORD PARAMETERS:
	group	long	The widget ID of a group leader for the menu.


 CALLS: ***
	CW_BGROUP, CW_FILESEL, SAVE_PROF_EVENT, XMANAGER, cw_ffield
 MODIFICATION HISTORY:
	Original: 15/12/03; SJT


scalarproduct $SSW/smei/ucsd/gen/idl/toolbox/math/scalarproduct.pro
[Previous] [Next]
 NAME:
	scalarproduct
 PURPOSE:
	Calculate scalar product for two vectors
 CATEGORY:
	gen/idl/toolbox/math
 CALLING SEQUENCE:
	result = scalarproduct(r1, r2 [, /cylin, /sphere, /rect, /degrees, /angle])
 INPUTS:
		r1 		arrays[3,*]; type: int or float
		r1	 	arrays[3,*]; type: int or float
					vectors for which the product is to be taken.
					the first dimension identifies the three coordinates: Cartesian (default),
					cylindrical or spherical.
 OPTIONAL INPUT PARAMETERS:
		/angle		if set then information about the angle between the two vectors is returned:
						i.e. cos(angle) = |r1.r2|/|r1||r2|
		/cylin, /sphere, /rect
					indicates whether input vectors are in cylindrical, spherical or rectangular
						coordinates. If none is set then rectangular is assumed.
		/degrees	if set, and spherical or cylindrical coordinates are used, then the angles
						are assumed to be in degrees (default: radians)
 OUTPUTS:
		result	array[*]	same type as input
					scalar products or angle information are returned as array[n]
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 CALLS: ***
	CV_COORD, InitVar, SyncArgs, SyncDims
 CALLED BY:
	RotationMeasure, jpl_phase
 PROCEDURE:
 >	The arrays r1 and r2 do not necessarily have the same dimensions, i.e.
	if r1 is an array[3,n] and r2 is an array[3] then r2 is interpreted as an array[3,n]
	with all n vectors the same (SyncArgs is used to synchronize the array dimensions).
 >	Arrays r1 and r2 can have more than two dimensions, i.e. if r1 and r2 are both
	arrays[3,n,m] then the scalar products will be returned as array[n,m]
 MODIFICATION HISTORY:
	AUG-1999, Paul Hick (UCSD/CASS)
	NOV-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Extracted from vectorproduct procedure.


ScEarth $SSW/smei/ucsd/sat/idl/toolbox/sun/scearth.pro
[Previous] [Next]
 NAME:
	ScEarth
 PURPOSE:
	Returns the heliographic or ecliptic longitude of the Earth for a given time
 CALLING SEQUENCE:
	FUNCTION ScEarth, T, ecliptic=ecliptic, eastlimb=eastlimb, westlimb=westlimb, degrees=degrees
 INPUTS:
	T		scalar, array; type: standard time structure
				times
 OPTIONAL INPUTS:
	/degrees	if set, angles are in degrees (default: radians)
	/ecliptic	if set, the ecliptic longitude is returned
	/eastlimb	if set, the longitude of the east limb is returned
	/westlimb	if set, the longitude of the west limb is returned
 OUTPUTS:
	ScEarth		heliographic longitude (degrees, 0<=EARTH<360)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CvSky, InitVar, NewcombSun, SubArray, ToRadians
 CALLED BY:
	CarringtonT, CarringtonT0, CarringtonVar
 PROCEDURE:
 MODIFICATION HISTORY:
	JAN-1991, Paul Hick (UCSD)
	JUL-1993, Paul Hick (UCSD), added option to return ecliptic longitude
	OCT-1994, Paul Hick (UCSD), converted from F77 (functions SC_EARTH,
		SC_EARTH_ELIMB, SC_EARTH_WLIMB)


self_help $SSW/smei/bham/idl/utils/self_help.pro
[Previous] [Next]
 self_help
	A quick and dirty proc to run DOC_LIBRARY for its caller.

 Usage:
	self_help

 CALLS: ***
	DOC_LIBRARY, STR_SEP
 CALLED BY:
	MAKE_SMEI_OP, MK_IMGHDRTXT, SMEI_ADD_IMAGE, SMEI_CALCULATE, SMEI_CALC_MENU
	SMEI_COLOUR, SMEI_COMPACT, SMEI_DELAY, SMEI_DELETE_IMAGE, SMEI_DOCS, SMEI_IMAGE
	SMEI_IMAGE_HEADER, SMEI_IMAGE_IMAGE, SMEI_IMAGE_INFO, SMEI_IMAGE_MOVE
	SMEI_IMAGE_PRINT, SMEI_JOIN, SMEI_MENU, SMEI_MOVIE, SMEI_NULL_INDEX, SMEI_OPTS
	SMEI_PRINT, SMEI_PROFILE, SMEI_RANGE, SMEI_RESTORE, SMEI_SAVE, SMEI_SEQUENCE
	SMEI_SEQ_INFO, SMEI_SHOW, SMEI_SUBTRACT_MODEL, SMEI_ZOOM
 History:
	Original: 20/7/00; SJT
	Drop xdl -- it's too slow: 20/4/01; SJT


Set_Page $SSW/smei/ucsd/sat/idl/util/set_page.pro
[Previous] [Next]
 NAME:
	Set_Page
 PURPOSE:
	Setup procedure for controlling output to plot device or graphics file
	The output procedure is completed by a call to Get_Page
 CALLING SEQUENCE:
	set_page, /setup_only
	set_page [, xysize=xysize, aspect=aspect, /portrait, /eps]
	set_page [, xysize=xysize, /portrait, /eps]
	set_page [, /winaspect, /portrait]
	set_page, /gif
	set_page, /bmp
 OPTIONAL INPUT PARAMETERS:
	The following keywords control the size and orientation of the output page.
	They only affect EPS, PS, HP or PRINTER devices (as keywords in the 'device'
	call). EPS is selected with the /eps keyword. PS, HP and PRINTER is used
	depending on !ThePrinter (initialized during startup).

	/landscape		plot in landscape mode
	/portrait		plot in portrait mode
						If neither of these is set then /landscape is used
						Only used to set up PS, EPS or default PRINTER.
	xysize=xysize	scalar, or array[2]; type: float
						horizontal and vertical size of page (in cm for printer,
						in pixel for display and z-buffer). If a scalar is
						specified it is assumed to be the horizontal size
	/fullsize		overrides 'xysize' keyword. For the printer xysize is set
						to the full page size, for other devices [!d.x_size,
						!d.ysize] is used

					If xysize is not specified then default values are selected
					depending on whether /landscape of /portrait is used.
					If specified then aspect (or /winaspect) overrides either
					xsize of ysize to establish the proper aspect.

	aspect=aspect	scalar; type: float
						aspect ratio (=ratio vertical/horizontal size
	/winaspect		same as: aspect = !d.y_size/!d.x_size
						i.e. the aspect ratio of the active window is used
	/silent			suppresses informational messages
	/setup_only		the command 'set_page, /setup, /silent' is used during
						IDL_startup to set up the default printer. The plot
						device is NOT changed, and !ThePlotFile is NOT set (i.e.
						is set to the null string)

	/eps			sets the plot device to PS and opens an EPS file
						!ThePlotFile is set to IDL.EPS or 'File'
	/gif			sets the plot device to !TheTerminal
						!ThePlotFile is set to IDL.GIF or 'File'
	/png			sets the plot device to !TheTerminal
						!ThePlotFile is set to IDL.PNG or 'File'
	/bmp			sets the plot device to !TheTerminal
						!ThePlotFile is set to IDL.BMP or 'File'
	/zbuffer		NOT WORKING YET
 OUTPUTS:
	xysize=xysize	array[2]; type: integer
						[!d.x_size, !d.y_size] on return
	old_device=old_device
					scalar; type: string
						original graphics device (i.e. value of !d.name when
						this procedure is called)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, GetFileSpec, InitVar, IsType, LOADCT, Reset_Colors, SetFileSpec, destroyvar
	do_file, twin
 CALLED BY:
	even_light_corrections, even_light_photometry, even_light_registration
	qSet_Page_Submit, smei_frm_summary, smei_hdr_plot, smei_sky, vu_earthskymap
	vu_insitu, vu_planarcut, vu_solardisk, vu_synopticmap
 SEE ALSO:
	qSet_Page
 PROCEDURE:
	Pretty darn ugly.
	The plot device is set to !ThePrinter, or PS (if /eps is set) or
	!TheTerminal (if /gif or /bmp are set).
	!ThePlotFile is always set. Unless argument 'File' is used
	the file name will be IDL.EPS, IDL.GIF or IDL.BMP (if /eps, /gif or /bmp are
	set) or IDL.HP, IDL.PS or IDL.PRINTER (depending on the value of
	!ThePrinter). Note that in the last case (IDL.PRINTER) no plot file is used
	since the output goes directly to the printer.
	For HP and PS the graphics output is collected in the output file, which is
	then send to the printer using Get_Page
 MODIFICATION HISTORY:
	MAR-1995, Paul Hick (UCSD/CASS)
	MAR-1998, Paul Hick (UCSD/CASS); added PRINTER device
	MAR-2000, Paul Hick (UCSD/CASS)
		added /gif and /bmp keywords, updated documentation
	???-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		added /png keyword


SetFileSpec $SSW/smei/ucsd/gen/idl/toolbox/files/setfilespec.pro
[Previous] [Next]
 NAME:
	SetFileSpec
 PURPOSE:
	Split file names into file components. Optionally parse the
	file names.
 CATEGORY:
	I/O, string manipulation
 CALLING SEQUENCE:
	SetFileSpec, FileSpec [, FileParts, /parse, /nosave, status=Status]
 INPUTS:
	FileSpec	string array or scalar, containing file names
			(read-only)
 OPTIONAL INPUT PARAMETERS:
	/parse		if set, the file names are parsed.
			parsing is successful if
			- The directory exists
			- There is write access to the directory
			- The file name is valid (the file may or may not exist)
			  (if no file name is specified this step is skipped)
 			If the parsing is succesful, missing file parts will
			be added to the FileParts array; if not all parts are
			set to the null string.
	/nosave		by default, the FileParts array returned as ouput
			is saved internally in a common block (which can
			be accessed with GetFileSpec and PutFileSpec).
			if nosave is set, the internal data are not overwritten.
 OUTPUTS:
	FileParts	string array with one dimension more than
			FileSpec; the extra first dimension has 6 elements,
			containing node, device, directory, name, type, version
			!!! the FileParts argument is sometimes useful in
			combination with the /nosave keyword. Preferably this
			argument should not be used; instead use GetFileSpec
			and PutFileSpec to manipulate the same information.
 OPTIONAL OUTPUT PARAMETERS:
	status=Status	long integer array with same dimensions as FileSpec.
			If keyword Parse set:
			  0 : indicates that parsing failed
			  1 : indicates that parsing was succesfull
			If keyword Parse not set, all values are set to 1
 CALLS: ***
	CheckDir, FILEPATH, FindAllFiles, InitVar, IsType, SyncDims, os_separator, strposn
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
	@filespec_common.pro	; Common block with arrays File and Parts
 CALLED BY:
	FindAllFiles, FindAllSubDirs, GetFileSpec, Get_Page, PutFileSpec, Set_Page, bin_read
	bin_write, do_file, findfile_fix, gunzip_file, makemovie, mk_flick, nso_fe_read
	qImage, qImage_Pick, qImage_cw_SmeiMask, qSave2File_Save, qSet_Page_Pick, qView
	qView_FileFilter, qView_PickFiles, qView_Save2File, qView_TMO_tracksky, smei_buf
	smei_frm_get, smei_frm_name, smei_frm_update, smei_getfile, smei_time, usno_body
	vu_RemoteView, vu_check, vu_earthskymap, vu_get_page, vu_getdata, vu_header
	vu_image, vu_insitu, vu_movie, vu_quick_movie, vu_vox_write, www_help_crosslinks
	www_help_files, www_help_get_header, www_help_get_info
 SIDE EFFECTS:
	Internal data are maintained internally (a copy of FileParts)
 RESTRICTIONS:
	FileSpec containing relative directory specifications
	(e.g. [], [-] on VMS, or . and .. on Win32 and Unix), cause
	problems for GetFileSpec. If these are present, then /parse
	should be used to remove them.
 PROCEDURE:
 >	Parsing: the existence check for the directory is done using CheckDir.
	The fully-parsed directory returned by CheckDir is used, so the parse
	keyword can be used to expand environment variables, e.g.
		SetFileSpec, '$dat/tmo/*.nic', /parse
		print, GetFileSpec()
	would print (provided the directory exists):
		/big/oftp/dat/tmo/*.nic
 > If a wildcard is specified in the file name then only the directory
	is parsed.
 >  For an existing file the full file name is obtained using FindAllFiles.
   If the file does not exist, an attempt is made to open
	the file with OPENW to establish that the syntax is valid;
	FindAllFiles is used to obtain the full file name before closing and
	deleting the file again.
 >	The filenames are split up into parts by a series of strposn calls
 >	FileSpec='' (null string) is interpreted as the current working directory,
	and will always return status=1.
 MODIFICATION HISTORY:
	DEC-1997, Paul Hick (UCSD/CASS)
	FEB-2002, Paul Hick (UCSD/CASS)
		Remove bug which caused problems when multidimensional arrays
		of filenames were processed.
	JAN-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		If a wildcard (*) is specified in the filename part then only the
		directory is checked when the /parse keyword is set.


SetRange $SSW/smei/ucsd/gen/idl/toolbox/setrange.pro
[Previous] [Next]
 NAME:
	SetRange
 PURPOSE:
	Set range of values, checking against a default range
 CATEGORY:
	Tricks
 CALLING SEQUENCE:
	new = SetRange(default, range [, /lower_limit])
 INPUTS:
	default			array[2]; type: any
						upper and lower limits on allowed values
 OPTIONAL INPUT PARAMETERS:
	range			scalar or array[2]
						range to be checked against 'default'
	/lower_limit	if set then a scalar 'range' is interpreted as
					a lower limit (default is upper limit)
 OUTPUTS:
	new				array[2]
						updated range of values
						if 'range' undefined then 'new' is set to 'default'
						if 'range' is scalar then new = [range,default[1]] is
						returned (/lower_limit is set), or new = [default[0],range[1]]
						is returned (/lower_limit not set
						Always 'range' is constrained to stay inside the limits set by 'default'
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar
 CALLED BY:
	RemoteView_rgbo
 PROCEDURE:
	Trivial
 MODIFICATION HISTORY:
	JUN-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


setup3d $SSW/smei/ucsd/sat/idl/toolbox/tricks/setup3d.pro
[Previous] [Next]
 NAME:
	setup3d
 PURPOSE:
	Sets up scaling (!x.s, !y.s, !z.s) and transformation matrix (!p.t)
 CATEGORY:
 CALLING SEQUENCE:
	setup3d, d0, d1, n0, n1 [, /rotate, /oblique]
	setup3d, d0, d1, n0, n1 [, rotate=[[a,b,c],[d,e,f]], oblique=[p,q] ]
 INPUTS:
	d0		scalar or array[3]; default: -1.5*[1,1,1]
	d1		scalar or array[3]; default:  1.5*[1,1,1]
				begin and end of data coordinate range
				scalars are interpreted as scalar*[1,1,1]
	n0		scalar or array[3]; default:  0.0*[1,1,1]
	n1		scalar or array[3]; default:  1.0*[1,1,1]
				begin and end of normal coordinate range
				scalars are interpreted as scalar*[1,1,1]

			!x.s, !y.s and !z.s are set up to map data ranges [d0,d1] to normal ranges [n0,n1]
 OPTIONAL INPUT PARAMETERS:
	rotate=rotate
			array[3,n] or array[3*n]; type: float
				The special form /rotate is identical to rotate=[ [ 0.,-20.,0.], [20., 0. ,0.] ]
				Set of rotations to be set up in !p.t matrix
				rotations are processed left to right; rotate[0,*], rotate[1,*] and rotate[2,*]
				are rotations around x,y and z-axis respectively
	oblique=oblique
			array[2]; type: float
				The special form /oblique is identical to oblique=[.4,-125]
				Parameters for an oblique projection
	/xyplane	Puts x-y plane in plane of screen
	/yzplane	Pust y-z plane in plane of screen
	/xzplane	Puts x-z plane in plane of screen
 OUTPUTS:
	Sets !x.s, !y.s, !z.s and !p.t
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	T3D, t3d_oblique
 CALLED BY:
	PlotPlanarCut, PlotSolarDisk, RemoteView_PlotVertices, even_light_figures
	qvu_draw
 RESTRICTIONS:
 PROCEDURE:
	!p.t is first reset. Then clockwise rotations around y and z-axis over 90 degrees are
	executed to point the x-axis perpendicular to the screen, the y-axis pointing right and the
	z-axis pointing up in the plane of the screen.
	After that the rotations supplied as keywords are applied, followed by the oblique projection.
 MODIFICATION HISTORY:
	AUG-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


sgp4_eph $SSW/smei/ucsd/gen/idl/ephem/sgp4_eph.pro
[Previous] [Next]
 NAME:
	sgp4_eph
 PURPOSE:
	Get location of Coriolis spacecraft in ECI coordinates.
 CATEGORY:
	gen/idl/ephem
 CALLING SEQUENCE:
	rr = sgp4_eph(tt_obs,km=km)
 INPUTS:
	tt_obs			array[n]; type: time structure
						UT time
 OPTIONAL INPUTS:
	body			scalar; type: string; default: 'sat27640'
						spacecraft designation
						The default sat27640 is Coriolis.
	km=km			if set, return distance in km instead of AU
	source=source	scalar; type: string; default: who_am_i(/dir)/sgp
						directory where TLE file is located (by default the
						subdir sgp of the dir where this file is located.
 OUTPUTS:
	rr[6,n]			location and velocity
						if /location is set only r[0:2,n] is returned
						if the required file with TLEs is not found
						then the output vector contains NaNs.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	ArrayLocation, BadValue, FILEPATH, InitVar, SuperArray, TimeFixYear, TimeLimits
	TimeOp, TimeSet, TimeUnit, hide_env, sgp_alias, txt_read, who_am_i
 CALLED BY:
	big_eph, smei_frm_cvhdr, smei_frm_where, smei_sgp4_quat
 PROCEDURE:
	The file with orbital elements is 'body.txt' i.e. sat27640.txt for 
	Coriolis. The file is looked for in the subdirectory sgp of the
	directory where this source code is located. Used keyword 'source'
	to point to another subdirectory.
	Orbital elements can be retrieved from www.space-track.org
 MODIFICATION HISTORY:
	MAR-2005, Paul Hick (UCSD/CASS)
	SEP-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Reduced memory requirements by extracting TLM bracketing the
		input time range tt_obs


sgp4_orbit_period $SSW/smei/ucsd/gen/idl/ephem/sgp4_orbit_period.pro
[Previous] [Next]
 NAME:
	sgp4_orbit_period
 PURPOSE:
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
 CALLS: ***
	BadValue, SyncArgs, sgp4_tlm
 CALLED BY:
	smei_sgp4_orbits
 PROCEDURE:
 MODIFICATION HISTORY:
	JUNE-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


sgp4_tlm $SSW/smei/ucsd/gen/idl/ephem/sgp4_tlm.pro
[Previous] [Next]
 NAME:
	sgp4_tlm
 PURPOSE:
	Extract orbital elements covering bracketing tt_obs from
	tlm data base file
 CATEGORY:
	gen/idl/ephem
 CALLING SEQUENCE:
	status = sgp4_tlm(tt_obs,body_,source=source,tlm=tlm,tt_tlm=tt_tlm)
 INPUTS:
	tt_obs			array[n]; type: time structure
						UT time
 OPTIONAL INPUTS:
	body_			scalar; type: string; default: 'sat27640'
						spacecraft designation
						The default sat27640 is Coriolis.
	source=source	scalar; type: string; default: who_am_i(/dir)/sgp
						directory where TLM file is located (by default the
						subdir sgp of the dir where this file is located.
 OUTPUTS:
	status			scalar; type: integer
						0: the ephemeris find is not found or there
							is a read error. In this case tlm and tt_tlm
							won't exist
						1: tlms found
	tlm=tlm			array[2,ntlm]; type: string
						tlm (each tlm consists of two records)
						the tlms will bracket the input time period tt_obs
	tt_tlm			array[ntlm]; type: time structure
						times extracted from tlm records
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	ArrayLocation, FILEPATH, InitVar, SuperArray, TimeFixYear, TimeLimits, TimeOp, TimeSet
	TimeUnit, hide_env, sgp_alias, txt_read, who_am_i
 CALLED BY:
	sgp4_orbit_period
 PROCEDURE:
	The file with orbital elements is 'body.txt' i.e. sat27640.txt for 
	Coriolis. The file is looked for in the subdirectory sgp of the
	directory where this source code is located. Used keyword 'source'
	to point to another subdirectory.
	Orbital elements can be retrieved from www.space-track.org
 MODIFICATION HISTORY:
	DEC-2005, Paul Hick (UCSD/CASS)
		Extracted from sgp4_eph


sgp_alias $SSW/smei/ucsd/gen/idl/ephem/sgp_alias.pro
[Previous] [Next]
 NAME:
	sgp_alias
 PURPOSE:
	Translates aliases for satellite names to their sgp names
 CATEGORY:
	gen/idl/ephem
 CALLING SEQUENCE:
	name = alias_sgp(body)
 INPUTS:
	body		array: type: string
					alias for satellite name
 OUTPUTS:
	name		array: type: string
					sgp name for satellite
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLED BY:
	big_body, big_eph, sgp4_eph, sgp4_tlm
 PROCEDURE:
	Currently only aliases 'coriolis','windsat' and 'smei' are
	converted to sgp name 'sat2740'
 MODIFICATION HISTORY:
	JUN-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


sgp_body $SSW/smei/ucsd/gen/idl/ephem/sgp_body.pro
[Previous] [Next]
 NAME:
	sgp_body
 PURPOSE:
	Get list of bodies for which SGP ephemerides are available
 CATEGORY:
	smei/gen/idl/ephem
 CALLING SEQUENCE:
	sgp_nams = sgp_body([body, files=files, numbers=numbers, count=count])
 OPTIONAL INPUT PARAMETERS:
	body		scalar or array; type: integer or string
						integer: list of body numbers
						string : list of body names
							only valid entries on this list are processed
							If not specified then all bodies are processed
 OUTPUTS:
	names			array[count]; type: string
						list of body names for which ephemeris files
						are available; if none exist (count=0) then names=''
 OPTIONAL OUTPUT PARAMETERS:
	count=count 	scalar; type: integer
						# requested bodies for which ephemeris files are present
						i.e. # elements in input 'body' with invalid entries removed
	file=file		array[count]; type: string
						file names of the ephemeris files; null-string if count=0
	number=number	array[count]; type: integer
						body numbers; -1 if count=0
	index=index 	array[count]; type: integer
						index numbers between 0, and total_count-1; -1 if count=0
	total_count=total_count
					scalar; type: integer
						total # bodies for which ephemeris files are present
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, GetFileSpec, IsType, hide_env, where_common, who_am_i
 CALLED BY:
	RemoteView_BodyLoc, big_body, big_eph
 PROCEDURE:
 >	Currently only 9P/Tempel (comet Tempel 1 around 'deep impact' time) is available
 >	The SGP files are searched for in the subdirectory 'sgp' of the directory
	where this procedure is located.
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Based on usno_body()


SHOW_ZOOMED $SSW/smei/bham/idl/utils/show_zoomed.pro
[Previous] [Next]
 NAME:
	SHOW_ZOOMED


 PURPOSE:
	Show a zoomed section of an image.


 CATEGORY:
	Utils


 CALLING SEQUENCE:
	wid = show_zoomed(window, x, y)


 INPUTS:
	window	long	The window from which to read the image to zoom.
	x, y	int	The centre of the region to be zoomed.

 OUTPUTS:
	wid	long	The widget ID of the top-level base.

 KEYWORD PARAMETERS:
	zoom	int	The initial zoom factor (default = 4)
	/smooth		If set, then use the smoothing in REBIN
	size	int	The size of the window to create (if it's a
			scalar then make a square window; default = 256)
	group	long	A group leader of the widget heirarchy.
	base	long	If this is a valid widget, then it is an
			already existing zoom tool, then a new tool is
			not created.


 CALLS: ***
	SH_ZOOM_EVENT, XMANAGER, ZMCOPY
 MODIFICATION HISTORY:
	Original: 28/7/03; SJT
	Add modifier support and change to function: 29/7/03; SJT


SMEI_ADD_IMAGE $SSW/smei/bham/idl/cli/smei_add_image.pro
[Previous] [Next]
 NAME:
	SMEI_ADD_IMAGE


 PURPOSE:
	Add one or more images to a SMEI sequence


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_add_image, seqref, files


 INPUTS:
	seqref	objref	Object reference of the SMEI sequence
	files	string	scalar string or string array containing the
			FITS file(s) to be added, such wildcards as
			findfile recognizes for your OS are
			allowed. Currently it must be an explicit path
			(or the files in the current dir).


 OPTIONAL INPUTS:
	


 KEYWORD PARAMETERS:
	/first	If set, then add the image at the beginning of the
		sequence.
	/last	If set, add the image at the end of the sequence (this
		is the default behaviour).
	after	Either a location number or an image reference after
		which the new images is to be inserted.
	before	Either a location number of an image reference before
		which the new image is to be inserted.
	/compact If set, then compact the image on adding it.	


 CALLS: ***
	self_help, smei_msg
 MODIFICATION HISTORY:
	Original: 19/12/02; SJT
	Fix some very visible bugs: 30/7/03; SJT


smei_base_testcase $SSW/smei/ucsd/camera/idl/toolbox/smei_base_testcase.pro
[Previous] [Next]
 NAME:
	smei_base_testcase	
 PURPOSE:
	Runs test case for smei_base program and validates results
 CATEGORY:
	camera/idl/toolbox
 CALLING SEQUENCE:
	PRO smei_base_testcase, make=make, db=db, keep=keep,	$
		source=source, digsource=digsource
 OPTIONAL INPUT PARAMETERS:
	/make		if set, the testcase results are regenerated
	source=source	passed to smei_base
	/digsource	passed to smei_base
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CheckDir, FILEPATH, FindAllFiles, GetFileSpec, InitVar, IsType, TimeOp, TimeSet
	TimeString, TimeUnit, flt_string, smei_frm_property, smei_getfile, txt_read
	who_am_i
 PROCEDURE:
	The testcase results are stored in an ASCII file in the
	same directory as this procedure (smei_base_testcase.txt).
	The file contains frame names and values for pedestal and
	dark current.

	The executable smei_base is run for all frames in the testcase.
	Resulting Fits frames are written to $TEMP/smei_base_testcase.
	These files are cleaned up afterward.

	Differences between pedestal and dark current should be at
	the single precision level.
 MODIFICATION HISTORY:
	DEC-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_buf $SSW/smei/ucsd/camera/idl/buf/smei_buf.pro
[Previous] [Next]
 NAME:
	smei_buf
 PURPOSE:
	Main procedure for processing l1a files
 CATEGORY:
	camera/idl/buf
 CALLING SEQUENCE:
	smei_buf
 INPUTS:
	tmp_list		scalar; type: string; default: $TEMP/l1a_list.txt
						name of ascii file created by Python script l1a.py
						(the file will be deleted after it has been read)
 OUTPUTS:
	.nic files to $dat/smei/nic
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CheckDir, FILEPATH, GetFileSpec, InitVar, SetFileSpec, TimeOp, TimeString, TimeSystem
	TimeUnit, do_file, hide_env, smei_buf_get, smei_buf_getframe, smei_buf_mget
	txt_read
 PROCEDURE:
 >	This procedure is accessed primarily through the Python script
	l1a.py, which creates the main IDL main program and the input
	file 'tmp_list'.
 >	All frames are extracted from the specified list of *.buf files
	and written to disk as *.nic files.
 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS)
	FEB-2004, Paul Hick (UCSD/CASS)
		Added option for 'noclones' check.
		Added option to move processed L1A files to other directory
	MAR-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added option to allow writing of Fits files and Nic files.


smei_buf_get $SSW/smei/ucsd/camera/idl/buf/smei_buf_get.pro
[Previous] [Next]
 NAME:
	smei_buf_get
 PURPOSE:
	Extracts data area for specified frames
 CATEGORY:
	camera/idl/buf
 CALLING SEQUENCE:
	smei_buf_get, frame_headers, destination=destination, /nic, /fits,
		ptr_data=ptr_data
 INPUTS:
	frame_headers	array; type: smei_frm_hdr structure
						frame header array (as returned by smei_buf_getframe)
 OPTIONAL INPUT PARAMETERS:
	trange=trange	array[n]; type: time structure
						time info for tracking down SMEI frames.
						See smei_buf_getframe for more information.
	source=source	scalar; type: string; default: /media/cdrecorder
						directory where the L1A files are located.
						If trange is used this is passed to smei_buf_getframe.
						If frame_headers is specified than this is added to
						frame_headers.l1a_file (which does not include a
						directory).
	destination=destination
					scalar; type: string
						directory into which to write the individual frame files
						Output files have form c#frm_YYYY_DDD_HHMMSS (for padded
						frames) or c#roi_YYYY_DDD_HHMMSS (for unpadded ROI
						frames). # is the camera number (1,2 or 3).
	/nic 			if set (and a valid destination is specified) then frame are
						written in NIC file format (i.e. the data are stored in
						the same way as for the TMO data, but the trailer has
						a totally different structure)
	/fits			if set (and a valid destination is specified) then a fits
						file is written
						(at this point the frame headers are not written into
						the fits file.
	/split_dir		if writing out lots and lots of frames it is probably better
						to distribute the frames over multiple directories.
						If /split_dir is set then each day of data is split in
						4-hour intervals over 6 directories with names
						destination/YYYY_DDD/HH with HH=00,04,08,12,16,20
	If the output keyword ptr_data is set, and /nic, /fits are not set
	then the frame data ar returned as a heap variable.

	/overwrite			will unconditionally overwrite existing files when
						writing individual frames to disk
	/gzip				gzip directories
 OPTIONAL OUTPUT PARAMETERS:
	count=count 		# frames found

	ptr_data=ptr_data
					array; type: pointer
						the frame data corresponding to 'hdr'
						i.e. *ptr_data[i] is the 2D frame data array.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CheckDir, FILEPATH, InitVar, IsTime, IsType, TimeSet, TimeSplit, TimeString, TimeUnit
	hide_env, smei_buf_getframe, smei_buf_gzip, smei_buf_prep, smei_buf_read
	smei_frm_property, smei_frm_write, smei_setup_roi, txt_read
 CALLED BY:
	smei_buf
 EXAMPLE:
	The most efficient way to replace a damaged frame in the SMEI database from a DVD
	is the following command:
		smei_buf_get, timeset('2005_006_160819'), cam=2, /fits, dest=getenv('TEMP'), /usedb
	This requires that the proper DVD is mounted on /media/cdrecorder (specify
	source=<source> to override the default) and that the SMEI database is accessible. 
	Note: dest='SMEIDB?' will NOT work.
 PROCEDURE:
	If either /fits or /nic is set then data are saved to binary files in
	the destination directory (no pointer data will be returned).

	File names will have the form c#frm_YYYY_DDD_HHMMSS.ext:
	#   = camera id (1,2 or 3)
	ext = 'fts' or 'nic'

	If neither /nic nor /fits is specified then data can be extracted in
	ptr_data.

	/fits SET:

	Writes bare fits file (no extra frame header info is put in the file yet,
	just the data are stored).

	/nic SET (obsolete; we don't use .nic files anymore):

	A 512 byte trailer is added after the data array.
	The first 3 bytes are the characters 'buf' (to distinguish these
	files from e.g. the TMO data files). The next 256 is the unmodified
	header from the original frame (except for byte swapping to put the
	data in native machine format.

 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS)
	MAY-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Changed default source from /media/cdrecorder to /media/CDROM


smei_buf_getframe $SSW/smei/ucsd/camera/idl/buf/smei_buf_getframe.pro
[Previous] [Next]
 NAME:
	smei_buf_getframe
 PURPOSE:
	Extracts individual frames from all *.buf files in the specified
	source directory.
 CATEGORY:
	camera/idl/buf
 CALLING SEQUENCE:
	hdr = smei_buf_getframe(trange, source=source, camera=camera, count=count)
 INPUTS:
	trange			array[n]; type: time structure
						n=0: if not specified than all frames in all L1A files in
								'source' are extracted.
						n=1: extract frame for specified time
						n=2: extract all frames between trange[0] and trange[1]
						n>2: extract frames for specified times
 OPTIONAL INPUT PARAMETERS:
	source=source	scalar, array; type: string
						scalar: source directory containing L1A *.buf files
						array : list of fully-qualified names of L1A files
	camera=camera	scalar, array[2], array[3]
						numbers 1, 2, or 3, identifying the cameras to be extracted
						if 'camera' not set then all cameras are extracted.
	/usedb			if set then an attempt is made to find a file pointer in the
						first L1A file to be accessed close to trange[0] (by
						looking for nearby frames in the SMEI data base).
						(this is primarily used to replace corrupted frames in the
						SMEI data base).
 OUTPUTS:
	hdr 		array; type: smei_frm_hdr structure
 OPTIONAL OUTPUT PARAMETERS:
	count=count 	scalar; type: integer
						# frames returned in 'hdr'
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CheckDir, FindAllFiles, GetFileSpec, InitVar, IsTime, IsType, TimeLimits, TimeOp
	TimeSet, TimeString, TimeUnit, UNIQ [1], UNIQ [2], UNIQ [3], boost, destroyvar
	smei_buf_read, smei_frm_property, smei_getfile, where_common
 EXTERNAL:
	smei_buf_hdr__define, smei_frm_hdr__define
 CALLED BY:
	smei_buf, smei_buf_get
 PROCEDURE:
	Frame headers are stored in the same order as they are read from the
	L1A files, i.e. there will be contiguous groups of frames from each
	L1A files. Each L1A file appears to be chronological, but subsequent
	files overlap (because of the double dump?). As a result the frame
	header array as a whole (from more than one L1A file) is probably not
	chronological.
 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_buf_gzip $SSW/smei/ucsd/camera/idl/buf/smei_buf_gzip.pro
[Previous] [Next]
 NAME:
	smei_buf_gzip
 PURPOSE:
	Controls gzipping of new frames in SMEI data base.
 CATEGORY:
	camera/idl/buf
 CALLING SEQUENCE:
	smei_buf_gzip need_gzip, last_dir
 INPUTS:
	need_gzip		scalar; type: integer
						# frames to be gzipped
	last_dir		scalar; type: string
						name of directory to be gzipped
 OUTPUTS:
	need_gzip		scalar; type: integer
						reset to zero
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	IsType, hide_env
 CALLED BY:
	smei_buf_get, smei_buf_mget, smei_buf_prep
 PROCEDURE:
 MODIFICATION HISTORY:
	OCT-2004, Paul Hick (UCSD/CASS)


smei_buf_hdr__define $SSW/smei/ucsd/camera/idl/buf/smei_buf_hdr__define.pro
[Previous] [Next]
 NAME:
	smei_buf_hdr__define
 PURPOSE:
	Structure definition for file header of SMEI .buf files
 CATEGORY:
	camera/idl/buf
 CALLING SEQUENCE:
	hdr = {smei_buf_hdr}
 INPUTS:
	(none)
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL BY:
	smei_buf_getframe, smei_buf_splitfile
 PROCEDURE:
	See Don Mizuno's, SMEI_CONVERT memo
 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_buf_mget $SSW/smei/ucsd/camera/idl/buf/smei_buf_mget.pro
[Previous] [Next]
 NAME:
	smei_buf_mget
 PURPOSE:
	Extracts all frames from specified l1a_files
 CATEGORY:
	camera/idl/buf
 CALLING SEQUENCE:
	smei_buf_mget, l1a_files, destination=destination, /nic, /fits
 INPUTS:
	l1a_files		array; type: string
						fully-qualified names of l1a_files
 OPTIONAL INPUT PARAMETERS:
	destination=destination
					scalar; type: string
						directory into which to write the individual frame files
						Output files have form c#frm_YYYY_DDD_HHMMSS (for padded
						frames) or c#roi_YYYY_DDD_HHMMSS (for unpadded ROI
						frames). # is the camera number (1,2 or 3).
	/nic 			if set (and a valid destination is specified) then frame are
						written in NIC file format (i.e. the data are stored in
						the same way as for the TMO data, but the trailer has
						a totally different structure)
	/fits			if set (and a valid destination is specified) then a fits
						file is written
						(at this point the frame headers are not written into
						the fits file.
	/split_dir		if writing out lots and lots of frames it is probably better
						to distribute the frames over multiple directories.
						If /split_dir is set then each day of data is split in
						4-hour intervals over 6 directories with names
						destination/YYYY_DDD/HH with HH=00,04,08,12,16,20

	/overwrite			if set existing frames are overwritten
						(passed to smei_buf_prep)
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLED BY:
	smei_buf
 SEE ALSO:
	smei_buf_get, smei_buf_getframe
 CALLS: ***
	CheckDir, InitVar, IsType, hide_env, smei_buf_gzip, smei_buf_prep, smei_buf_read
	smei_frm_property, smei_frm_write, smei_setup_roi
 PROCEDURE:
	This is a faster alternative to smei_buf_get. It processes all
	l1a_files in sequence and extracts/writes to disk all frame data.

	If either /nic of /fits is set then data are saved to binary files in
	the destination directory (no pointer data will be returned).

	File names will have the form c#frm_YYYY_DDD_HHMMSS.ext:
	#   = camera id (1,2 or 3)
	ext = 'nic' or 'fts'

	/nic SET:

	A 512 byte trailer is added after the data array.
	The first 3 bytes are the characters 'buf' (to distinguish these
	files from e.g. the TMO data files). The next 256 is the unmodified
	header from the original frame (except for byte swapping to put the
	data in native machine format.

	/fits SET:

	STILL NEEDS WORK
	Writes bare fits file (no extra frame header info is put in the file yet,
	just the data are stored).
 MODIFICATION HISTORY:
	APR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_buf_prep $SSW/smei/ucsd/camera/idl/buf/smei_buf_prep.pro
[Previous] [Next]
 NAME:
	smei_buf_prep
 PURPOSE:
	Decide whether a frame extracted from an L1A file needs to be
	written to disk.
 CATEGORY:
	camera/idl/buf
 CALLING SEQUENCE:
	filename = smei_buf_prep(hdri, data, destination, /split_dir)
 INPUTS:
	hdri			array[1]; type: frame header structure
						frame header
	destination		scalar; type: string
						name of existing directory where to write the file

 						If split_dir is NOT set then frames will be written
						directly to 'destination'
						If split_dir is SET then files are written into subdirectories
 						destination/year_doy/c1, destination/year_doy/c2 or
						destination/year_doy/c3
	count			array[4]; type: integer
						Counters to be updated.
 OPTIONAL INPUT PARAMETERS:
	/nic			write nic file
	/fits			write fits file

	/split_dir		if writing out lots and lots of frames it is probably better
						to distribute the frames over multiple directories.
						If /split_dir is set then each day of data is split in
						4-hour intervals over 6 directories with names
						destination/YYYY_DDD/HH with HH=00,04,08,12,16,20
	/overwrite		by default frames are not written to drive if a file for
						the frame already exists, UNLESS the new frame was from
						the 1st telemetry dump. Set this keyword to
						unconditionally overwrite existing files.
						(setting -overwrite speeds up processing by about a
						factor 2; the culprit seems to be the IDL findfile fnc).

	count			array[4]; type: integer
						The count array MUST EXIST on input for updates to
						occur. One or more of the counters are incremented by 1.
						count[0]: # frames written to disk as .nic or .fts
							file (updated in smei_frm_write)
						count[1]: # frames skipped because file already exists
							(updated here)
						count[2]: # frames with times earlier than the most
							recent frame (updated here) that are written to
							disk (these should be frames from the second dump;
							if the second dump contains the same frames as the
							first the number of these frames should be small)
						count[3]: # clone frames (updated here)
	last_time		array[1]; type: time structure
						time of most recent frame processed
 OUTPUTS:
	filename		scalar; type: string
						fully-qualified file name to be used for output file.
						If /overwrite is NOT set and the file exists already
						then the null-string is returned.
	count			array[3]; type: integer
						updated file counters
	last_time		array[1]; type: time structure
						updated frame time
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLED BY:
	smei_buf_get, smei_buf_mget
 COMMON:
	common save_three_clones, last_hdrs, last
	common save_double_dump , overlap_on, overlap_l1a, first_dump
 CALLS: ***
	CheckDir, FILEPATH, InitVar, IsType, TimeLimits, TimeOp, TimeString, TimeUnit, UNIQ [1]
	UNIQ [2], UNIQ [3], boost, destroyvar, hide_env, smei_buf_gzip, smei_frm_name
	smei_frm_path, smei_frm_property, smei_frm_read
 RESTRICTIONS:
	If /split_dir is set then a 'mkdir --parents' is spawned to to create
	subdirectories, and gzip is spawned to compress files. This works in
	Linux, but not in Windows without some modifications.
 PROCEDURE:
 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS)
	MAY-2003, Paul Hick (UCSD/CASS)
		If /overwrite is NOT and a frame exists already the telemetry times are
		compared. If the new frame is earlier than the one already on disk,
		then it is still overwritten.
		This determination is made from the name of the original telemetry file
		which is stored in the frame header.
	JUL-2003, Paul Hick (UCSD/CASS)
		Force overwrite if there is read error on an existing .nic file.
	FEB-2004, Paul Hick (UCSD/CASS)
		Added /noclones keyword
		Added new code to deal with double dump frames. Should reduce disk I/O
		considerably.
	AUG-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Introduced error handler bracketing calls to smei_frm_property(hdr,/tlm_time).
		Occasionally the tlm_file name is screwy enough to crash smei_time (called
		by smei_frm_property). If this happens continue assuming that the new frame
		is from a second dump.


smei_buf_read $SSW/smei/ucsd/camera/idl/buf/smei_buf_read.pro
[Previous] [Next]
 NAME:
	smei_buf_read
 PURPOSE:
	Read Level 1A file in 'buf' format
 CATEGORY:
	camera/idl/buf
 CALLING SEQUENCE:
	status = smei_buf_read(l1a_file [, pointer, frame_headers=frame_headers, /get_next_frame ])
 INPUTS:
	l1a_file			scalar; type: string
							fully-qualified file name of SMEI l1a*.buf file.
							To close an open file, set l1a_file = ''
	pointer				scalar; type: integer
							file pointer in l1a_file where the requested frame starts.
							This argument is optional, but if known, speeds up
							the process of finding a frame in the L1A file.
 OPTIONAL INPUT PARAMETERS:
	/get_file_header	only fill file_header structure
	/get_next_frame 	get next frame from file
						If this keyword is set then the data file is kept open
						with the file pointer after the current frame.
	frame_nr=frame_nr
						get frame with number 'frame_nr'
						The frame number specified here should be taken
						from the header array returned in a previous call
						(this is a 1-based frame number).
	trunc_time			array[1]; type: time structure
						used only when collecting all frame headers (i.e.
						keywords frame_nr_defined and get_next_frame NOT set,
						and argument have_pointer NOT set). The collection of
						frames stops at the indicated time instead of
						continuing until the end-of-file is reached.
	start_pointer		scalar; type: integer
							when new l1a_file is opened move to file pointer
							to start_pointer and start processing from there
							instead of from the beginning of the file.
							'start_pointer' is destroyed to avoid using
							in another l1a_file.
 OUTPUTS:
	status				scalar; type: integer
							0: failure; 1: success
 OPTIONAL OUTPUT PARAMETERS:
	file_header=file_header
				 		array[1]; type: file header structure
	frame_headers=frame_headers
						array[n]; type: frame header structure array
							an array with with headers for all frames is returned
						array[1]; type: frame header structure
							if 'frame_nr' is specified than the
							header for the matching frame is returned
	frame_data=frame_data
						array[n], array[n,m]; type: unsigned int, long or float
							if 'frame_nr' is set then the matching frame
							data are returned here.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
	@smei_roi_mask.pro		; ROI mask common block
 CALLED BY:
	smei_buf_get, smei_buf_getframe, smei_buf_mget
 COMMON BLOCKS:
	common smei_read_buf_file, iu, open_file, open_hdr, pntr, last_frm, frm_count
 CALLS: ***
	InitVar, IsTime, IsType, TimeLimits, TimeOp, TimeString, TimeUnit, boost, destroyvar
	hide_env, smei_buf_splitfile, smei_frm_cvhdr, smei_frm_name, smei_frm_property
	smei_setup_roi, who_am_i
 PROCEDURE:
	The content of SMEI .buf files is described in Don Mizuno's memo:

	The data area is padded to a 2D frame using the mask stored in
	the ASCII file smei_buf_roi.txt. This file contains a 318 x 64 array with values 0,1,2 and 3.
	0: pixels outside the region of interest
	1: pixels in the smei fov
	2: pixels in the covered columns left and right
	3; pixels in the square open areas outside the smei fov
 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS)
	APR-2003, Paul Hick (UCSD/CASS)
	    Fixed bug in frame header structure. The naxes values in the raw
	    header were not updated when the ROI was applied (so the nic files
	    prior to today (Apr 20) have naxes=[0,0] in the trailer).
	MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Entry frame_header.n_satured is filled here using the
		data extracted from the L1A file.


smei_buf_splitfile $SSW/smei/ucsd/camera/idl/buf/smei_buf_splitfile.pro
[Previous] [Next]
 NAME:
	smei_buf_splitfile
 PURPOSE:
	Analyze content of 256-ascii file header in SMEI L1A *.buf file
 CATEGORY:
	camera/idl/buf
 CALLING SEQUENCE:
	hdr = smei_buf_splitfile( byte_hdr )
 INPUTS:
	ascii_hdr		array[256]; type: byte
						256-byte header
 OUTPUTS:
	hdr 			array[1]; type: smei_buf_hdr structure
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
	smei_buf_hdr__define
 CALLS: ***
	smei_time
 CALLED BY:
	smei_buf_read
 PROCEDURE:
	The file header is actually stored in ascii form, so the input byte
	array is converted to string before processing
 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Based on SMEI Convert 1.0


SMEI_CALC_MENU $SSW/smei/bham/idl/ops/smei_calc_menu.pro
[Previous] [Next]
 NAME:
	SMEI_CALC_MENU


 PURPOSE:
	GUI to control the SMEI calculator.


 CATEGORY:
	OPS


 CALLING SEQUENCE:
	smei_calc_menu, seqref


 KEYWORD PARAMETERS:
	group	long	Group leader for the menu system, required if
			any other widgets are present
	<names>		Name mappings for programs. (e.g. if you have
			a sequence called MYSEQ but the program has
			SS, then passing ss=myseq will map your myseq
			to the program's ss.


 OUTPUTS:
	seqref	objref	Object reference of the new sequence to be
			generated.


 CALLS: ***
	CW_BGROUP, SC_EVENT, SMEI_CALCULATE, SMEI_CHOOSE_SOP, SMEI_MENU, XMANAGER, cw_ffield
	self_help, smei_msg
 MODIFICATION HISTORY:
	Original: 17/1/03; SJT
	Support passing of no_delete flag: 22/1/03; SJT
	Add support for name mapping: 3/7/03; SJT
	Adapt to new formats: 4/11/03; SJT


SMEI_CALCULATE $SSW/smei/bham/idl/ops/smei_calculate.pro
[Previous] [Next]
 NAME:
	SMEI_CALCULATE


 PURPOSE:
	To generate a new SMEI_SEQUENCE by applying a calculation
	ruleset.


 CATEGORY:
	OPS


 CALLING SEQUENCE:
	smei_calculate, seq, opstring


 OPTIONAL INPUTS:
	opstring	string	A string or string array with the ruleset.



 KEYWORD PARAMETERS:
	file	string	A file containing the ruleset.
	Any variable in the ruleset can be matched to a real variable
	by keyword.


 OUTPUTS:
	seq	objref	Reference to the sequence with the derived
			image(s)


 CALLS: ***
	PARSE_OP, self_help, smei_msg
 CALLED BY:
	SMEI_CALC_MENU
 RESTRICTIONS:
	If an opstring is given, then the FILE keyword is ignored.
	This is really just a convenient wrapper for the PARSE_OP
	function.


 MODIFICATION HISTORY:
	Original (After old format): 4/11/03; SJT
	Ensure scalar string is passed on: 5/11/03; SJT


smei_cam2angle $SSW/smei/ucsd/camera/idl/toolbox/smei_cam2angle.pro
[Previous] [Next]
 NAME:
	smei_cam2angle
 PURPOSE:
	Get angles from unit vector in SMEI camera frame
 CATEGORY:
	camera/idl
 CALLING SEQUENCE:
	angle = smei_cam2angle(runit [,stheta=stheta, rtheta=rtheta])
 INPUTS:
	runit		array[3,n]; type: float or double
					x,y,z components of unit vector in UCSD camera frame
 OPTIONAL INPUT PARAMETERS:
	/stheta 	if set, then the direction cosine angles are returned
					this is the default if no keywords are specified.
	/rtheta 	if set, then the rotation angles from
					Buffington et al., SPIE 4853, 490, 2002.
				are returned
 OUTPUTS:
	angle		array[2,n]; type: double
					requested theta-x and theta-y angles
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, ToRadians
 CALLED BY:
	smei_findcrazy, smei_frm_hbar, smei_frm_hbar_inside, smei_frm_where
 SEE ALSO:
 PROCEDURE:
	/stheta set
		locations in the sky as direction cosine angles theta-x and
		These are the direction cosine angles required by Andy's formulae for
		mapping sky locations to CCD positions ('Defining the field of
		view for the SMEI cameras', A. Buffington, 11 July 2001.)
		!!! These are not the same as the theta-x, theta-y angles
		in Buffington et al., SPIE 4853, 490, 2002.
	/rtheta
		!!! These are the theta-x, theta-y angles
		in Buffington et al., SPIE 4853, 490, 2002.
		i.e. angles used in determining the performance of the baffle,
		incl. the glare.
 MODIFICATION HISTORY:
	MAR-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_cam_quaternion $SSW/smei/ucsd/camera/idl/toolbox/smei_cam_quaternion.pro
[Previous] [Next]
 NAME:
	smei_cam_quaternion	
 PURPOSE:
	Get the camera quaternion for a specified camera
	for a given Coriolis sc quaternion
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	qcam = smei_cam_quaternion(hdr)
	qcam = smei_cam_quaternion(quaternion, camera)	
 INPUTS:
	hdr		array[n]; type: structure
				hdr.quaternion and hdr.camera are used
				to calculate the camera quaternion.
			array[4] or array[4,n]; type: double
				Coriolis quaternion (as extracted from
				frame header). If 'hdr' is a quaternion
				then 'camera' needs to specified too.
 OPTIONAL INPUTS:
	camera		scalar or array[n]; type: integer
				camera number (as extracted from frame header)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 OUTPUTS:
	qcam		array[4] or array[4,n]; type: double
				camera quaternion (relative to same coord
				system as Coriolis quaternion)
 CALLS: ***
	CombineRotations, IsType, smei_camera, smei_frm_property
 CALLED BY:
	smei_ccd2sky, smei_cv, smei_frm_where, smei_sky2cam
 SEE ALSO:
	smei_orient_test
 PROCEDURE:
	Camera quaternion rotates from J2000 equatorial coordinates to
	UCSD camera coordinates.
 MODIFICATION HISTORY:
	JUN-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_camera $SSW/smei/ucsd/camera/idl/toolbox/smei_camera.pro
[Previous] [Next]
 NAME:
	smei_camera
 PURPOSE:
	Defines parameters for the SMEI fov
 CATEGORY:
	SMEI
 CALLING SEQUENCE:
	R = smei_camera(/get_center)
 INPUTS:
	nsize = nsize		array[2]; type: long integer; default:[1280,360]
							CCD frame size (pixels)
	center= center		array[2]; type: float; default: [631.65, 1233.03]
							x- and y-coordinate of center of field of view arc
	optical_axis		array[2]; type: float; default: [-89.5 (deg), 1179.50 (pix)]
							azimuth and radius of optical axis
							identifies the location of the optical axis relative
							to the fov center in terms of polar coordinates. By
							default. The optical axis is near azimuth 270
							(vertically below the center) at ~ 1200 pixels
							distance.
	fov_size			array[2,2]; type: float: default:[30 (deg), 42.5 (pix)]#[-1,1]
							the size of the SMEI fov in polar coordinates
							The fov is ~ 60 degrees in azimuth by 85 pixels
							in the radial direction, and is centered on the
							optical axis.
	quaternion			array[4]; type: double: default
							quaternion describing orientation of cameras
							relative to the spacecraft structure.
	fov_tosky			array[2,2] type: float
							scaling from CCD coordinates to sky coordinates
	fov_toccd

 OPTIONAL INPUT PARAMETERS:
	/get_nsize			retrieve frame size
	/get_center			retrieve center of field of view arc
	/get_optical_axis	retrieve optical axis coordinates
	/get_fov_size		retrieve field of view size
	/get_fov_limits		retrieve limits of field of view
	/get_quaternion		retrieve camera quaternions
	/get_fov_tosky		retrieve CCD-to-sky transformation constants
	/get_fov_toccd

	/get_structure		retrieve structure containing all field of view information

	/degrees			if set then all angles (input and output) is in degrees
						 (default: radians)
 OUTPUTS:
	Output depends on the keyword selection.
	If /get_fov_limits is set the limits of the field of view are returned:

	R		array[2,2]; type: 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'.

	If /get_structure is set then a structure is returned containing all
	field of view information:

	R		array[1]; type: structure
			{SMEI_fov,	$
				camera	: camera,
				nsize		: nsize,
				center		: center,
				axis		: optical_axis,
				size		: fov_size,
				limits		: fov_limits,
				quaternion	: quaternion,
				tosky		: fov_tosky,
				radial_profile: ptr to radial_profile}
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CombineRotations, InitVar, IsType, ToDegrees, ToRadians
 CALLED BY:
	TMO_tracksky, qGlitch_Run, qImage_cw_SMEI, smei_cam_quaternion, smei_ccd2sky
	smei_cv, smei_sky2cam, smei_sky2ccd
 SEE ALSO:
	smei_orient_test
 PROCEDURE:
	Default values are used unless other values are specified as input arguments
	The fov limits are calculated from the location of the optical axis and
	the size of the field of view.
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS)
	MAR-2003, Paul Hick (UCSD/CASS)
		Added numbers for flight cameras.
	JAN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added camera values from Aarons indexing program. These used the center
		values from Andys memo, and camera quaternions obtained by trial-and-error.
		These numbers are now the default.


smei_camera_gain $SSW/smei/ucsd/camera/idl/star/smei_camera_gain.pro
[Previous] [Next]
 NAME:
	smei_camera_gain
 PURPOSE:
	Returns the camera gain at specified time
 CATEGORY:
	camera/idl/sky
 CALLING SEQUENCE:
	FUNCTION smei_camera_gain, tt, camera=camera,	$
		zero_time=zero_time, zero_gain=zero_gain, delta_gain=delta_gain
 INPUTS:
	tt				array[n]; type: time structure
						UT time
 OPTIONAL INPUTS:
	camera=camera	scalar; type: integer; default: 2
						camera number
	zero_time=zero_time
			 		array[1]; type: time structure;
						default: TimeSet(yr=2003,doy=0)
						Time origin for gain correction
	zero_gain=zero_gain
					array[3]; type: float; default: [0.97,1.00,0.92]
						gains for three cameras at time zero_time
	delta_gain=delta_gain
					scalar; type: float; default: -0.01
						gain change per year
 OUTPUTS:
	gain			array[n]; type: float
						gain correction at specified times
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, TimeOp, TimeSet, TimeUnit
 CALLED BY:
	smei_star_remove
 PROCEDURE:
	The sensitivty for the cameras appears to be decreasing at a
	rate of 1% per year.
 MODIFICATION HISTORY:
	JUL-2006, Jordan Vaughan, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_ccd2sky $SSW/smei/ucsd/camera/idl/toolbox/obsolete/smei_ccd2sky.pro
[Previous] [Next]
 NAME:
	smei_ccd2sky
 PURPOSE:
	Convert from CCD coordinates to positions in the sky
 CATEGORY:
	SMEI
 CALLING SEQUENCE:
	R = smei_ccd2sky( rvec, [ camera=camera, quaternion=quaternion, /degrees])
 INPUTS:
	rvec			array[2,*]; type: float
						x- and y- coordinates of locations on the CCD
						These are converted to sky coordinates if inside the
						field of view. If no points lie inside the field of
						view then the scalar BadValue(rvec) is returned.
						If rvec is not specified then all pixels in a 
						frame are processed.
 OPTIONAL INPUT PARAMETERS:
	/rectangular	if set then the return value is in rectangular coordinates
					(with 1st dimension of 3).

	camera=camera 	This keyword can be any one of the following three.
					array[1]; type: smei_buf_frm structure
						this determines the camera and the quaternion.
						The keywords 'quaternion' and 'qcamera' are ignored.
					array[1]; type: smei_camera_fov structure
						structure containing information about SMEI field of
						view; usually the return value of smei_camera
						with the /get_structure keyword set.
					scalar; type: integer
						camera number (1,2 or 3).
					If not specified then camera=1 is assumed.

					The camera number is used as argument to smei_camera to
					obtain the fov structure.

	quaternion=quaternion
					array[4]; type: float
						Coriolis quaternion, or (if /qcamera is set) the
						camera quaternion (i.e. the quaternion
						constructed by smei_cam_quaternion).
	/qcamera		indicates that 'quaternion' already is the camera
					quaternion for the camera specified in 'camera'.
	/degrees		if set, all in- and output angles are in degrees
						(default: radians). Note that the 'fov' structure
						must be consistent with the setting of /degrees.
	/boolean		if set then the output array 'inside' is returned as an
					2D array of indices. (set this keyword only if rvec
					is NOT specified, i.e. when processing a whole frame.
	distort=distort
					NOT IMPLEMENTED YET
 OUTPUTS:
	R			array[2,n]; type: float
					spherical coordinates (longitude, latitude)
					for all pixels inside the SMEI fov
 OPTIONAL OUTPUT PARAMETERS:
	inside=inside
				array[  n]; type: long integer (if /twod NOT set)
				array[2,n]; type: long integer (if /twod set0
					one- or two-D CCD pixel indices for all the pixels
					listed in R
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	AngleRange, BadValue, CV_COORD, CvRotation, InitVar, Inside_Wedge, IsType, SubArray
	SyncDims, ToDegrees, ToRadians, boost, gridgen, smei_cam_quaternion, smei_camera
	smei_radial2theta
 PROCEDURE:
 MODIFICATION HISTORY:
	OCT-1998, Paul Hick (UCSD/CASS)
	FEB-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu); added quaternion keyword


SMEI_CHOOSE_SOP $SSW/smei/bham/idl/ops/smei_choose_sop.pro
[Previous] [Next]
 NAME:
	SMEI_CHOOSE_SOP


 PURPOSE:
	To pick a predefined OPS program


 CATEGORY:
	operations


 CALLING SEQUENCE:
	file = smei_choose_sop()


 KEYWORD PARAMETERS:
	group	Widget ID of a group leader


 OUTPUTS:
	file	The file name in a form suitable for PARSE_OP


 CALLS: ***
	SCHOP_EVENT, XMANAGER, smei_msg
 CALLED BY:
	SMEI_CALC_MENU
 MODIFICATION HISTORY:
	Original: 15/7/03; SJT


SMEI_COLOUR $SSW/smei/bham/idl/cli/smei_colour.pro
[Previous] [Next]
 NAME:
	SMEI_COLOUR


 PURPOSE:
	Set the colour table for a SMEI sequence


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_colour, table


 INPUTS:
	seqref	objref		Object reference to the sequence.
	table	int/byte	Either a scalar giving the colour
				table index, or a 256x3 array with a
				colour map.


 OPTIONAL INPUTS:



 KEYWORD PARAMETERS:
	/menu	If set, then use XLOADCT to select/adjust the colour
		table.


 CALLS: ***
	self_help, smei_msg
 MODIFICATION HISTORY:
	Original: 19/12/02; SJT


SMEI_COMPACT $SSW/smei/bham/idl/cli/smei_compact.pro
[Previous] [Next]
 NAME:
	SMEI_COMPACT


 PURPOSE:
	Compact all the images in a SMEI sequence


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_compact, seqref


 INPUTS:
	seqref	objref	The object reference of the SMEI seqence to be
			compacted 


 KEYWORD_PARAMETERS
	/mk_nan		If set, then convert points in the weighted
			images with zero weight into NaN values.

 CALLS: ***
	self_help, smei_msg
 MODIFICATION HISTORY:
	Original: 19/12/02; SJT


smei_coriolis $SSW/smei/ucsd/gen/idl/ephem/smei_coriolis.pro
[Previous] [Next]
 NAME:
	smei_coriolis
 PURPOSE:
	Returns time at which Coriolis was in specified orbit
 CALLING SEQUENCE:
	FUNCTION smei_coriolis, tt_or_orbit, orbital_period=orbital_period
 INPUTS:
	tt_or_bit			array; type: time structure or any numerical type
							if input are times then output is the 
							orbit number; if input is numerical then
							output is the orbit time.
 OPTIONAL INPUTS:
	/orbital_period 	return orbital period
							if set then the orbital period at the specified
							time or orbit number is returned
							(if tt_or_orbit is not specified then
							tt_or_orbit=0 is assumed)
 OUTPUTS:
	smei_coriolis		array; type: numerical or time structure
							orbit number or orbit time (depending on input
							tt_or_orbit
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, InitVar, IsTime, IsType, TimeGet, TimeLInterpol, TimeOp, TimeSet, TimeSplit
	smei_orbit_get, smei_orbit_set, smei_time, txt_read, who_am_i
 CALLED BY:
	smei_frm_findpoint, smei_frm_get, smei_getfile, smei_orbits_stat, smei_sky_file
	smei_sky_get, smei_sky_read, smei_star_fit, smei_time, smei_zodiac_fit
 PROCEDURE:
	Orbit n0(=0) starts at t0 = 2002/12/31 23:56:41.900.
	The orbital period at this time was p0=0.0705612268519d0 days (6096.490 s),
	and has been decreasing since with dp=0.084 msec per orbit.
	(0.42s reduction in SMEI period per 365 days).

	The effective orbital period for orbit n is p0-(n-n0)*dp.
	The start times for each orbit becomes:

	t(n0+0) = t0
	t(n0+1) = t(n0+0)+p0-1*dp
	t(n0+2) = t(n0+1)+p0-2*dp
	...
	t(n0+n) = t(n0+n-1)+p0-n*dp = t0+n*p0-0.5*n*(n+1)*dp
 MODIFICATION HISTORY:
	JUN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_cv $SSW/smei/ucsd/camera/idl/toolbox/smei_cv.pro
[Previous] [Next]
 NAME:
	smei_cv
 PURPOSE:
	Convert positions between various SMEI-related coordinate frames
 CATEGORY:
	camera/idl
 CALLING SEQUENCE:
	R = smei_cv(hdr, [camera=camera, quaternion=quaternion,/degrees]	$
			from_sky=from_sky, from_camera=from_camera, from_ccd=from_ccd,$
			/to_sky, /to_camera, /to_ccd)
 INPUTS:
	hdr 			array[1]; type: SMEI_FRM_HDR structure
 OPTIONAL INPUT PARAMETERS:
	from_sky		array[2,n] or array[3,n]
						positions in the sky as spherical or rectangular
						equatorial coordinates.

					/rect NOT SET: spherical coordinates
						rvec[0,*] is RA;
						rvec[1,*] is declination
						rvec[3,*] (usually the distance)

					/rect SET: rectangular coordinates
						rvec[0,*] is x-coordinate (toward vernal equinox
						rvec[1,*] is y-coordinate
						rvec[3,*] is z-coordinate (toward equatorial north)

	from_camera 	array[3,n]
						positions in the sky as unit vectors in the
						UCSD camera frame.

	from_ccd		array[2,n]; type: double
					scalar; type: string

						If set to string 'CCD' then the position of all
						pixels in the image for the specified mode are used.

						pixel locations on the CCD, specified as a zero-based
						array index (i.e. lower-left pixel is [0,0])
						If 'hdr' is set then the unit is the pixel size
						of the associated mode. Override thsi by explicitly
						setting the 'mode' keyword (so set mode=0 to always
						use engineering mode pixels).

	/to_sky 		array[3,n] or array[2,n]; type: double
						output is in equatorial sky coordinates (rectangular
						array[3,n ]if /rectangular is SET.
						array[2,n] (RA and dec) if /rectangular NOT set.
	/to_camera		array[3,n]; type: double
						output is a unitvector in the UCSD camera frame
						(with z-axis along camera optical axis)
	/to_ccd 		array[2,n]; type: double
						output is in pixel coordinates on the CCD
						The units are mode-dependent.

	/rectangular	only used if 'from_sky or /to_sky is set
						if set then 'from_sky' is in rectangular coordinates.
						The 1st dimension MUST be 3; if it is not program execution halts.
						If /to_sky is set then the output is in rectangular coordinates..

	/degrees		only used if 'from_sky' or /to_sky is set
						if set, all angles are in degrees (default: radians).

	/force_unit 	only used if 'from_sky' or 'from_camera' are set
						forces conversion of vectors to unit vectors
						For 'from_sky' vectors converted to camera coordinates must
						be unit vectors. By default only vectors deviating from unit
						vectors by more than the machine precision are explicitly
						scaled to unit vectors.

	camera=camera	scalar; type: integer
						camera number (1,2 or 3)
						if set, overrides the value implied by 'hdr'
						if neither 'hdr' nor 'camera' are set then camera=1 is assumed
							This determines the fixed S/C-to-camera quaternion for
							conversions between camera and equatorial frames;
							and CCD-related parameters (fov size, etc.) for
							conversions between camera and ccd coordinates
	quaternion=quaternion
					array[4]; type: double
						ignored if 'hdr' is set
							Coriolis S/C quaternion (usually set by a call to
							smei_frm_property(hdr,/quaternion))
							Only needed for conversions between camera frame
							and equatorial frame.

	from_mode=from_mode
	to_mode=to_mode
	mode=mode		scalar; type: integer
						mode number (0,1 or 2)
						if set, overrides the value implied by 'hdr'
						if neither 'hdr' nor any of the mode keywords are set
							then mode=0 is used
							Only needed for conversion from and to CCD coordinates

						The 'from_mode' and 'to_mode' keyword are necessary only
						when both 'from_ccd' and /to_ccde are used (i.e. when
						converting CCD coordinates between different modes.
						'from_mode' takes priority over 'mode' and hdr.mode
						if from_ccd is set.
						'to_mode' takes priority over 'mode' and hdr.mode
						if /to_ccd is set.

	/boolean		only used for conversions between camera frame and
					CCD coordinates.
						if set then the output array 'inside' is a byte array of zeros
						and ones indicating whether the corresponding vectory is
						outside/inside the field of view (instead of a list of 
						indices from the IDL 'where' function identifying vectors
						inside the field of view).
 OUTPUTS:
	R				array[3,n]; type: float
						output locations as specified by /to_sky, /to_camera
						or /to_ccd keyword.
 OPTIONAL OUTPUT PARAMETER:
	inside=inside	array[n]; type: long (/boolean NOT set) or byte (/boolean set).
						Will only exist for conversion between CCD and sky coordinates
						(either camera or equatorial)..
						If /boolean is not set then 'inside' is a list of indices of
						vectors inside field of view
						If /boolean is set then 'inside' is a byte array with 0 for
						vectors inside or 1  for vectors inside the field of view.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	AngleRange, BadValue, CV_COORD, CvRotation, InitVar, Inside_Wedge, IsType, SubArray
	SyncDims, ToDegrees, ToRadians, boost, gridgen, smei_cam_quaternion, smei_camera
	smei_frm_property, smei_radial2theta, smei_theta2radial
 CALLED BY:
	smei_frm_cvhdr, smei_frm_where
 PROCEDURE:
	Conversions to and from equatorial sky coordinates require a Coriolis
	quaternion and a camera quaternion. This is provided either by specifying
	argument 'hdr', or by explicitly specifying a camera number and Coriolis
	quaternion through keywords 'camera' and 'quaternion'
 MODIFICATION HISTORY:
	MAR-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Extracted from smei_sky2ccd.


smei_cv_catalogue $SSW/smei/ucsd/camera/idl/star/smei_cv_catalogue.pro
[Previous] [Next]
 NAME:
	smei_cv_catalogue
 PURPOSE:
	Modifies formatting in bright star catalogue
 CATEGORY:
	camera/idl
 CALLING SEQUENCE:
	PRO smei_cv_catalogue
 INPUTS:
	Text file brightstars.txt in same directory as this routine.
 OUTPUTS:
	updata catalogue (overwrites old one)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, txt_read, who_am_i
 PROCEDURE:
	Fixes format problem with small negative latitudes. The minus sign
	in front of zero degrees is moved to the minute (or even the seconds
	field) e.g. entry -0 20 20 is changed to 0 -20 20
 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


SMEI_DELAY $SSW/smei/bham/idl/cli/smei_delay.pro
[Previous] [Next]
 NAME:
	SMEI_DELAY


 PURPOSE:
	Set the interframe delay for a SMEI sequence


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_delay, seqref, delay


 INPUTS:
	seqref	objref	Object reference of the SMEI sequence to be
			modified.
	delay	float	The delay in seconds


 CALLS: ***
	self_help, smei_msg
 MODIFICATION HISTORY:
	Original: 19/12/02; SJT


SMEI_DELETE_IMAGE $SSW/smei/bham/idl/cli/smei_delete_image.pro
[Previous] [Next]
 NAME:
	SMEI_DELETE_IMAGE


 PURPOSE:
	Delete an image from a SMEI sequence.


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_delete_image, seqref, image


 KEYWORD PARAMETERS
	/all	If set, then delete all images in the sequence.


 INPUTS:
	seqref	objref	Object reference to the sequence.
	image		Either an image number, or an image reference.


 CALLS: ***
	self_help, smei_msg, smei_query
 MODIFICATION HISTORY:
	Original: 19/12/02; SJT
	Add ALL keyword: 27/5/04; SJT


SMEI_DOCS $SSW/smei/bham/idl/cli/smei_docs.pro
[Previous] [Next]
 NAME:
	SMEI_DOCS


 PURPOSE:
	Find a suitable application and show the SMEI PDF
	documentation.


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_docs


 KEYWORD PARAMETERS:
	/reference		If set, then show the reference manual
				rather than the users' guide.
	/tutorial		If set, then show the tutorial.
	/admin			If set, then show the administrators
				guide.
	pdfviewer	string	Specify a PDF viewer other than the default.


 CALLS: ***
	self_help, smei_msg
 MODIFICATION HISTORY:
	Original: 6/6/05; SJT


smei_findcrazy $SSW/smei/ucsd/camera/idl/toolbox/smei_findcrazy.pro
[Previous] [Next]
 NAME:
	smei_findcrazy
 PURPOSE:
	Look for 'crazy frames'
 CATEGORY:
 CALLING SEQUENCE:
	PRO smei_findcrazy, trange, source=source, camera=camera, mode=mode, copy=copy
 INPUTS:
	trange			passed to smei_hdr_get
 OPTIONAL INPUT PARAMETERS:
	camera
	mode
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
 CALLS: ***
	GetFileSpec, InitVar, boost, destroyvar, do_file, smei_cam2angle, smei_frm_hbar
	smei_hdr_get
 SEE ALSO:
 PROCEDURE:
 MODIFICATION HISTORY:
	JAN-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_base $SSW/smei/ucsd/camera/idl/frm/smei_frm_base.pro
[Previous] [Next]
 NAME:
	smei_frm_base
 PURPOSE:
	Calculate pedestal and dark current for frame
 CATEGORY:
	smei/camera/idl/misc
 CALLING SEQUENCE:
	smei_frm_base, /init
	smei_frm_base, hdr, img
 INPUTS:
	hdr 		array[1]; type: structure
					frame header
	img 		array; type: integer
					frame data
 OPTIONAL INPUT PARAMETERS:
	nfill_control=nfill_control
				scalar; type: integer; default: 10
	/init		initialize all camera/mode combinations
	/reset		re-initialize the current camera/mode combination only
	/clear		clear all variables stored internally in common block
	silent		=0: display all messages
				=1: suppress non-essential messages
				=2: suppress all messages
 OUTPUTS:
	hdr 		array[1]; type: structure
					frame header with a number of values filled, in particular
					hdr.pedestal, hdr.dark current, hdr.squares, hdr.centerpix
	img 		array; type: float
					image with pedestal and dark current subtracted
					Any negative elements after subtraction are set to zero
					(these will mostly be pixels in the semi-covered columns
					(5 and 315 for mode 2 data)
 OPTIONAL OUTPUT PARAMETERS:
	cam_ok=cam_ok
				scalar; type: byte
				0: failed to determine pedestal and/or dark current
				1: pedestal and dark current determined successfully
	nfill_control=nfill_control
				scalar; type: integer
					# good frames used to build reference base values
	cam_full=cam_full
				0: still busy accumulating reference base data (based on 
					nfill_control preceeding good frames) for current
					camera/mode combination
				1: reference data for preceeding nfill_control good frames
					available
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
	@smei_roi_mask.pro		; SMEI masks
 CALLED BY:
	smei_frm_track
 COMMON BLOCKS:
	common smei_frm_base_save, ped_threshold, drk_threshold,			$
		ped_mean_init, drk_mean_init, ped_sigma_init, drk_sigma_init,  	$
		nfull, nbads, ifull, bfull, nbad, badv,	$
		peds_mean, peds_sigma, drks_mean, drks_sigma,$
		ped_mean , ped_sigma , drk_mean , drk_sigma , $
		drk_nout_init, drk_dout_init, drks_nout, drk_nout, drk_dout,	$
		drk_lr_ratio
 CALLS: ***
	ArrayLocation, BadValue, InitVar, IsType, MEAN, STDDEV, TimeString, TimeUnit, destroyvar
	smei_frm_property, smei_setup_roi, where_common, who_am_i
 PROCEDURE:
	
 MODIFICATION HISTORY:
	MAY-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_comments $SSW/smei/ucsd/camera/idl/frm/smei_frm_comments.pro
[Previous] [Next]
 NAME:
	smei_frm_comments
 PURPOSE:
	Returns comments for Fits header in SMEI frame
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
	hdr	array[1]; type: SMEI__FRM_HDR structure
			SMEI frame header
 OUTPUTS:
	str	array[n]; type: string
			list of comments (one for each tag name
			in the SMEI__FRM_HDR structure
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLED BY:
	smei_frm_cvhdr
 PROCEDURE:
 MODIFICATION HISTORY:
	MAR-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_cp $SSW/smei/ucsd/camera/idl/frm/smei_frm_cp.pro
[Previous] [Next]
 NAME:
	smei_frm_cp
 PURPOSE:
	Copy SMEI frames from SMEI data base
 CATEGORY:
	ucsd/camera/idl/frm
 CALLING SEQUENCE:
	smei_frm_cp, trange, destination=destination, /unzip, camera=camera
 INPUTS:
	trange				array[2]; type: time structure
						time range to be copied (see TimeSet)
 OPTIONAL INPUT PARAMETERS:
	camera=camera	scalar, or array[n] (n=1,2,3); default: [1,2,3]
						cameras to be copied
	/unzip			if set files are unzipped
	/mkdir			if set then the destination directory specified using
						the'destination' keyword is created if it doesn't exist already

	Passed to smei_getfile:

	silent=silent	controls informational messages
	mode=mode		scalar, or array[n] (n=0,1,2); default: none
					if set only the specified modes are selected
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CheckDir, FILEPATH, GetFileSpec, InitVar, IsTime, TimeGet, TimeOp, TimeSet, TimeUnit
	do_file, hide_env, smei_getfile
 RESTRICTIONS:
	Files are copied in groups of typically about 4000 frames at a time.
	See do_file for more details. The limitation arises from a restriction
	on the length of a shell command (usually 128 kB).
 PROCEDURE:
 >	Files for camera 1 are copied into subdirectory c1 of destination
	directory (the subdirectory is created if it does not exist yet).
	Same for cameras 2 and 3.
 > Specifying the mode keyword requires that file headers need to be read
	to determine the mode (the camera number is coded into the file name).
	This slows down the copy operation considerably.
 EXAMPLES:
	Copy files for cameras 1 and 2 from between 0 UT on doy 110 to 0 UT on doy 115
	for 4x4 binning (mode 2) to the $TEMP directory: Unzip files after copy
	is complete.

	tt = TimeSet(yr=2004,doy=[110,115])
	smei_frm_cp, tt,destination=getenv('TEMP'), /unzip, camera=[1,2], mode=2


	Copy all frames for the specified time period for all cameras to
	'/zulu/zone/2003_110_115', creating the subdirectory 2003_110_115 if it
	doesn't exist already; suppress informational messages:

	tt = TimeSet(yr=2004,doy=[110,115])
	smei_frm_cp, tt,destination=getenv('TEMP'), /unzip, silent=1

	See TimeSet for other ways to specify begin and end time.
 MODIFICATION HISTORY:
	JUL-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_cvhdr $SSW/smei/ucsd/camera/idl/frm/smei_frm_cvhdr.pro
[Previous] [Next]
 NAME:
	smei_frm_cvhdr
 PURPOSE:
	Convert frame headers between various formats
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	hdr = smei_frm_cvhdr(from_byte=from_byte, /to_fits)
 OPTIONAL INPUT PARAMETERS:
	from_hdr=from_hdr		array[1]; type: smei_frm_hdr structure
								frame header

	from_byte=from_byte 	array[256] or array[512]; type: byte
								binary header from L1A file (256 bytes) or
								trailer from .nic file (512 bytes).
								A trailer from .nic file should have the
								starting byte('buf') removed already.

	from_fits=from_fits 	array[n]; type: string
								fits header extracted from SMEI frame fits file

	/to_hdr 				return header as a smei_frm_hdr structure
	/to_byte				return header as a 256 or 512 byte array
	/to_fits				return header as a fits header string array
								if the fits header is not from a SMEI camera frame
								then the integer -1 is returned.
	/to_ascii				return a single string with an ascii representation
							of selected information from the header (used primarily
							for display in widgets).

	/swap_bytes 			if set, then bytes are swapped in the byte header
							(used if from_byte=from_byte or /to_byte is used.
 OUTPUTS:
	rtn_hdr 				header in format selected with /to_* keywords
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	AngleRange, CV_COORD, FXADDPAR [1], FXADDPAR [2], FXPAR [1], FXPAR [2], GetFileSpec
	InitVar, IsType, MKHDR [1], MKHDR [2], TimeGet, TimeOp, TimeSet, TimeString, TimeUnit
	eclipsed_area, jpl_body, jpl_eph, sgp4_eph, smei_cv, smei_frm_comments
	smei_frm_flag, smei_frm_name, smei_frm_property
 CALLED BY:
	img_read, smei_buf_read, smei_frm_read, smei_frm_write
 PROCEDURE:
	Only a selection of the data in the header are put in the string,
	separated by the newline character (10B).

	The binary frame header in the Hanscom L1A*.buf files binary header
	has 256 bytes. These are in Unix format (big-endian), i.e. byte swapping
	is necessary on i386 machines (which are little-endian).

	The .nic files contain a 512 byte trailer.
	The first 3 bytes in the .nic files are used to store the ASCII string 'buf'
	(to distinguish them from other .nic files, e.g. the TMO data).
	The next 256 bytes in the .nic trailer (bytes 3-258) are a copy
	of the frame header found in the Hanscom L1A*.buf files, except for byte
	swapping when necessary (i.e. they are little-endian).
	The remaining 253 bytes are partially filled with UCSD extensions:

		259 +
		byte   0- 59 (60)	name of original telemetry file
		byte  60-119 (60)	name of original L1A file
		byte 120-123 ( 4)	file pointer into L1A file

		byte 184-187 ( 4)	# pixels contributing to pedestal
		byte 188-191 ( 4)	# pixels contributing to dark current
		byte 192-196 ( 4)	# pixels in negative measles
		byte 196-199 ( 4)	# pixels in positive measles
		byte 200-203 ( 4)	# pixels in big measles
		byte 204-207 ( 4)	# pixels in cosmic rays
		byte 208-211 ( 4)	# pixels in big cosmic rays
		byte 212-215 ( 4)	residual intensity in squares
		byte 216-219 ( 4)	residual intensity in center group	
		byte 220-223 ( 4)	standard deviation of pedestal
		byte 224-227 ( 4)	standard deviation of dark current
		byte 228-231 ( 4)	flags

 MODIFICATION HISTORY:
	OCT-2003, Paul Hick (UCSD/CASS)
		Extracted from smei_buf_splitframe
	JUN-2004, Paul Hick (UCSD/CASS)
		Added room for name of another pattern file name.
		Rearranged to put everything at proper boundaries.
	MAR-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added code to fill hdr.sun,hdr.moon,hdr.venus,hdr.ra,hdr.dec
		and hdr.angle, hdr.eclipse and hdr.shadow using JPL ephemeris
		and Coriolis orbital elements run through sgd4.
		Note that for the first real-time downloads of the
		SMEI data the orbital elements will probably be out of date, so
		especially hdr.moon and hdr.eclipse should be treated with suspicion
		until this has been rerun with valid orbital elements.


smei_frm_drive $SSW/smei/ucsd/camera/idl/frm/smei_frm_drive.pro
[Previous] [Next]
 NAME:
	smei_frm_drive
 PURPOSE:
	Return time range for content of SMEI data base
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	t = smei_frm_drive([drive])
 INPUTS:
	drive		scalar or array[n]; type: integer or string
					identified SMEI drive as integer n
					or as string of type 'SMEIDBn'
					If omitted all drives are used
 OUTPUTS:
	t			array[2,n]; type: time structure
					begin and end time of data on each drive
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, InitVar, IsType, TimeSet, destroyvar, flt_read, flt_string, who_am_i
 CALLED BY:
	smei_hdr_update
 COMMON BLOCKS:
	common smei_frm_path_save, checkdrives, sdat
 PROCEDURE:
 MODIFICATION HISTORY:
	AUG-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_eclipse $SSW/smei/ucsd/camera/idl/frm/smei_frm_eclipse.pro
[Previous] [Next]
 NAME:
	smei_frm_eclipse
 PURPOSE:
	Eclipse calculations
 CATEGORY:
	smei_frm_eclipse, hdr, /may2003
 CALLING SEQUENCE:
 INPUTS:
	hdr 					array; type: structure
								headers of SMEI frames returned from a
								previous call. If hdr exists than the
								optional input parameters are ignored.
 OPTIONAL INPUT PARAMETERS:
	/may2003, orbit=0		for eclipse on 31 May 2003 04:13
	/may2003, orbit=-1		for eclipse on 31 May 2003 02:42
	/nov2003				for eclipse on 23 Nov 2003 22:53
	/apr2004				for eclipse on 19 Apr 2004 15:24

	/apr2005				for eclipse on 08 Apr 2005 20:35
	/mar2006				for eclipse on 29 Mar 2006 10:10

	/jun2003				Coriolis in Earth shadow from 13:58:19 until 14:14:51

 OUTPUTS:
	(Plot to screen)
	
	hdr 					array; type: structure
								headers of all SMEI frames processed
								This can be used as input for subsequent
								call to to bypass rereading of the frames.
 OPTIONAL OUTPUT PARAMETERS:
	loc=loc 				output from smei_frm_where
	runit=runit 			output from smei_frm_where
	area=area				output from eclipsed_area
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, IsType, TimeLimits, TimeSet, TimeString, TimeUnit, eclipsed_area, jpl_body
	smei_frm_property, smei_frm_where
 PROCEDURE:
 MODIFICATION HISTORY:
	OCT-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_findpoint $SSW/smei/ucsd/camera/idl/frm/smei_frm_findpoint.pro
[Previous] [Next]
 NAME:
	smei_frm_findpoint
 PURPOSE:
	Return frames with specified locations in the fov
 CATEGORY:
	ucsd/camera/idl
 CALLING SEQUENCE:
	smei_frm_findpoint, trange
 INPUTS:
	trange			array[2]; type: time structure
						time range of target frames
 OPTIONAL INPUT PARAMETERS:
	/degrees		if set all angles are in degrees (default: radians)

	The sky locations can be specified using any one of the methods
	used in smei_frm_where. The simplest is:
	
	points_radec	array[2]; type: float
						J2000 RA and dec of locations in the sky.
						The units are degrees or radians depending on the
						setting of keyword /degrees.

	list=list		scalar; type: string; default: none
						name of an output file where to write the fully-qualified
						file names of all SMEI frames containing the sky location.
 OUTPUTS:
	hdr=hdr 		array; type: structure
						headers for all identified SMEI frames
	theta=theta 	see smei_frm_where
	ccd=ccd 		see smei_frm_where
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CheckDir, InitVar, IsType, MEAN, TimeGet, TimeLimits, TimeOp, TimeSet, TimeString
	TimeUnit, boost, destroyvar, do_file, smei_coriolis, smei_frm_property
	smei_frm_where
 PROCEDURE:
 >	Check whole orbit starting at trange[0] for frames with the sky location
	in it. If no frames are found, try the next orbit.
 > If a transit of the sky location is found then determine the start
	and duration of the transit. Use this to estimate when the transit
	in the next orbit is.
 MODIFICATION HISTORY:
	NOV-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_flag $SSW/smei/ucsd/camera/idl/frm/smei_frm_flag.pro
[Previous] [Next]
 NAME:
	smei_frm_flag
 PURPOSE:
	Manipulates hdr.flags entry in SMEI frm header
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	result = smei_frm_flag(flag [,flag=flag, names=names])
 INPUTS:
	hdr 			array; SMEI__FRM_HDR structure
 OPTIONAL INPUTS
	flag=flag		array; type: SMEI_FRM_HDR structure or integer
 OPTIONAL INPUT PARAMETERS:
	The following flags are processed:

	base_done
	base_ok
	eclipse
	shadow
	bad_quat
	just_bad
	anneal

	tagmode
	full_frame
	shutter
	dark_offset
	flatfield
	cosmic_rays
	calibration
	flat_enabled
	led_enabled
	bos_alert
 OUTPUTS:
	results		array: type: SMEI_FRM_HDR structure or integer
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	IsType, ibsetf, ibtestf
 CALLED BY:
	smei_frm_cvhdr, smei_frm_update
 PROCEDURE:
	Each keyword corresponds to a bit in the hdr.flags entry.
	The values used here should be consistent with the value
	in the Fotran include value smei_frm_hdr.h
 MODIFICATION HISTORY:
	MAR-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_flatfield $SSW/smei/ucsd/camera/idl/frm/smei_frm_flatfield.pro
[Previous] [Next]
 NAME:
	smei_frm_flatfield
 PURPOSE:
	Get small or large-scale flatfield for the SMEI cameras.
 CATEGORY:
	camera/idl/field
 CALLING SEQUENCE:
	ff = smei_frm_flatfield(camera=camera [, /lsff)
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
	camera=camera		scalar; type: integer; default: 1
							camera number (1,2, or 3)
	/lsff				get large scale flatfield instead of
						small scale flatfield.
 OUTPUTS:
	ff					array[1272,256]; type: double
							flatfield value; the flatfield is applied
							by multiplying the uncorrected value by ff.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
	@smei_roi_mask.pro		; ROI definition
 CALLS: ***
	FILEPATH, InitVar, IsType, MagnifyArray, READFITS [1], READFITS [2], READFITS [3]
	SuperArray, smei_setup_roi, who_am_i
 PROCEDURE:
	SMALL SCALE (ON BOARD) FLAT FIELDS:

	c1_ssff.fts.gz, c2_ssff.fts.gz, c3_ssff.fts.gz

	For the small-scale flatfields, if the uncorrected CCD-readout is N ADUs,
	then the flat field corrected read-out M follows by adding one to the
	flatfield values and multiplying, i.e. with ff the array read from the
	FTS file:

	M = (1+ff)*N

	The addition of 1 is already done in the output array
	(i.e. 1+ff is returned).


	LARGE SCALE FLAT FIELDS:

	c1_lsff.fts.gz, c2_lsff.fts.gz, c3_lsff.fts.gz

	For the large-scale flatfields, if the uncorrected readout is N ADUs, then
	the flat field corrected readout M follows by dividing by the flat field
	value, i.e. with ff the array from the FTS file:

	M = N/ff

	The inversion is already done in the output array (i.e. 1/ff is returned).


	RAL TO SMEI MAPPING (applies to ssff and lsff files, NOT the lsffc files):

	All FTS files contain float arrays of size 1280x600 ('RAL frame'). The SMEI
	engineering mode (mode 0) frames have dimensions 1272x256. The pixels in a
	SMEI frame are a subset of the pixels in a RAL frame. The RAL frame is
	mapped to the SMEI frame by dropping the first 5 columns, then extracting
	the next 1272 columns; and dropping the first 65, 59 and 61 rows for
	cameras 1, 2 and 3, resp., then extracting the next 256.

	Let:
		n = 5, m = 65	for camera 1
		n = 5, m = 59	for camera 2
		n = 5, m = 61	for camera 3

	Then in IDL (with 0-based array indices):

		SMEI = RAL[n:n+1271,m:m+255]

	or pixel-by-pixel:

		SMEI[i,j] = RAL[n+i,m+j]

	In Fortran (1-based array indices):

		for j=1,256
	    	for i=1,1272
	    	    SMEI[i,j] = RAL[n+i,m+j]
	    	end for
		end for

	NORMALIZED FLAT FIELD CORRECTION (clsff):

	c1_clsff.fts.gz, c2_clsff.fts.gz, c3_clsff.fts.gz

	Contain arrays of size 1280x301 with numbers of order 1. As far as I can
	tell these are based on the large-scale flat field files with a couple of
	modifications:
	- geometrical effects are taken out (cosine effect along long dimension due
	  to changing effective aperture size, and radial effect along the narrow
	  dimension
	- a couple of 'bad pixels' are stamped out

	Even though the arrays suggest they are in engineering mode they are
	effectively in mode 2 (4x4 binning): numbers are identical in groups of 4x4.
	To use them with the SMEI an offset needs to be taken into account different
	from the large-scale flatfield discussed above: the first two columns need
	to be dropped, and the first 16, 10 and 12 rows for cameras 1,2 and 3,
	respectively.
	So let:
		n = 2, m = 16	for camera 1
		n = 2, m = 10	for camera 2
		n = 2, m = 12	for camera 3
	Then use the same code as above for the large-scale flatfields.
 MODIFICATION HISTORY:
	JAN-2004, Paul Hick (UCSD/CASS)
	NOV-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added the normalized flatfield corrections.


smei_frm_get $SSW/smei/ucsd/camera/idl/toolbox/obsolete/smei_frm_get.pro
[Previous] [Next]
 NAME:
	smei_frm_get
 PURPOSE:
	OBSOLETE, use smei_getfile instead.
	Get list of file names for all files (CCD frames or skymaps) in specified time range
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	FUNCTION smei_frm_get, frame, camera=camera, mode=mode, count=count, tt=tt,	$
		source=source, get_hdr=get_hdr, hdr=hdr, get_frm=get_frm, frm=frm,	$
		exact=exact, turbo=turbo, silent=silent, ramdisk=ramdisk,	$
		ls_corrupt=ls_corrupt, rm_corrupt=rm_corrupt
 INPUTS:
	frame			array[1], or array[2]; type: time structure
						begin and end time for requested time range
						If only a start time is given then the end time is
						taken to be the start time, plus one day.
						If 'frame' is not defined than the IDL pickfile
						dialog is called
 OPTIONAL INPUT PARAMETERS:
	source=source	scalar; type: string; default: SMEIDB?
						root directory of smei data
	camera=camera	scalar; type: integer
						camera number (1,2 or 3); if set only frames for the
						specified camera are extracted.
	mode=mode		scalar, or array[n]; type: integer or string; default: [0,1,2]
						if set then only retrieve frames for specified mode(s).
	/get_hdr		return frame headers
	/get_frm		return a pointer to the frame data
 OUTPUTS:
	ff				array[count]; type: string or smei_frm_hdr structure
						fully-qualified file names for all frames
						if no frames are found (count=0) then ff is the null string

						if /get_hdr is set then the headers are returned instead.
						if /get_frm is set then the frame data are returned instead
 OPTIONAL OUTPUT PARAMETERS:
	count=count 	scalar; type: integer
						# frames located
	tt=tt			array[count]; type: time structure
						frame times
	hdr=hdr 		array[count]; smei_frm_hdr structure
						frame headers
	frm=frm 		array[count]; heap pointer
						frame data
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, FindAllFiles, GetFileSpec, InitVar, IsTime, IsType, SetFileSpec, TimeGet
	TimeLimits, TimeOp, TimeSet, TimeString, TimeSystem, TimeUnit, UNIQ [1], UNIQ [2]
	UNIQ [3], boost, destroyvar, hide_env, smei_coriolis, smei_frm_name, smei_frm_path
	smei_frm_read, smei_sky_read, smei_time, where_common
 EXTERNAL:
	smei_frm_hdr__define
 PROCEDURE:
 MODIFICATION HISTORY:
	APR-2003, Paul Hick (UCSD/CASS)
	OCT-2003, Paul Hick (UCSD/CASS)
		Added /get_hdr and hdr=hdr keywords
	FEB-2004, Paul Hick (UCSD/CASS)
		Added /get_frm and frm=frm keywords
	MAY-2004, Paul Hick (UCSD/CASS)
		Fairly substantial rewrite of a crappy routine.
		Modified to reflect new directory structure of SMEI data base
		(frames are now organized in a separate directory for each
		doy of year, with subdirectories for each of the cameras)
	JUL-2004, Paul Hick (UCSD/CASS)
		Added /ramdisk keyword. Bug fix on processing of mode keyword.
	SEP-2004, Paul Hick (UCSD/CASS)
		Added code to select frames for a specific mode by checking the
		file name first. If the mode is encoded in the file name this
		speeds up the selection considerably.
	AUG-2006 , Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Removed some dead code that dates back to when the mode was not
		yet encoded in the filename for SMEI CCD frames.
		Generalized interpretation of mode keyword: if set to a string
		than skymaps will be processed, instead of SMEI CCD frames.


smei_frm_hbar $SSW/smei/ucsd/camera/idl/frm/smei_frm_hbar.pro
[Previous] [Next]
 NAME:
	smei_frm_hbar
 PURPOSE:
	Detects horizontal features in SMEI frames with readout
	lower than neigbouring rows (i.e. 'crazy frames')
 CATEGORY:
	ucsd/camera/idl/frm
 CALLING SEQUENCE:
	FUNCTION smei_frm_hbar, trange, length=length, _extra=_extra,	$
		roi_map=roi_map, moon=moon, sun=sun, venus=venus,	$
		bpos=bpos, bmap=bmap, hdr=hdr, bdepth=bdepth,		$
		blength=blength, dlength=dlength, pcount=pcount,	$
		excl_moon=excl_moon, excl_sun=excl_sun, excl_venus=excl_venus, $
		degrees=degrees
 INPUTS:
	trange			array[2]; type: time structure
					array; type: string
						if time structure of array this is passed to
						smei_getfile to get a list of frame file names.
					array[*,*,n]; type: numerical
						image cube of n SMEI frames
 OPTIONAL INPUT PARAMETERS:
	length			scalar; type: integer; default: 100
						maximum length of horizontal feature searched for

	blength 		scalar; type: integer; default: length
						the return arrays bmap, bpos
						provide information about horizontal features
						of length 'blength' pixels and longer.
						(if the maximum length horizontal feature is less
						than 'blength' than the maximum length is used
						for 'blength').
	dlength 		scalar; type: integer: default: length

	excl_moon		array[4]; type: float or double
	excl_sun		array[4]; type: float or double
	excl_venus		array[4]; type: float or double
						if the respective body is inside this exclusion zone
						the tx-ty (direction cosine) plane then no check is
						performed (and result -1 is returned)
						Default units are radians (unless /degrees is set)
	/degrees		sets units of exclusion zones to degrees

	If a 2D array is input as trange then additional header information
	can be provided with the following keywords:
	(these are ignored if trange is a time structure or string:
	the information is extracted from the frame headers):

	roi_map 		identifier for region of interest map used (usually 4)
	moon			location Moon
	sun 			location Sun
	venus			location Venus
 OUTPUTS:
	result			array[n]; type: long
						length of longest horizontal feature in frame
 OPTIONAL OUTPUT PARAMETERS:
	pcount			array[*,n]; type: long
						number of pixels in horizontal bars at each stage
						of the detection process
						pcount[0,n]: # pixels with length 1 and longer
						pcount[1,n]: # pixels with length 2 and longer
						etc.

	These output arguments refer to the last frame processes, so they are
	useful only when processing a single frame:

	bmap=bmap		array[*,*]; type: bytarr
						map of horizontal features with length 'blength' or
						longer marked by one; zero everywhere else.
	bpos=bpos		array[*,*,n]; type: long
						starting pixels of hor features with length 'blength'
						or longer
						If a bar is n > blength then n+1-blength
						consecutive pixels will be marked in bmap.
	bdepth=bdepth	scalar; type: float
	blength=blength scalar; type: integer
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
	@smei_roi_mask.pro
 CALLS: ***
	ArrayLocation, InitVar, IsTime, IsType, LocalExtrema, MEAN, STDDEV, TimeUnit, destroyvar
	smei_cam2angle, smei_frm_hbar_inside, smei_frm_property, smei_frm_read
	smei_getfile, smei_setup_roi, who_am_i
 CALLED BY:
	smei_findcrazy, smei_frm_hbar_inside
 PROCEDURE:
 MODIFICATION HISTORY:
	JAN-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_hbar_inside $SSW/smei/ucsd/camera/idl/frm/smei_frm_hbar.pro
[Previous] [Next]
 NAME:
	smei_frm_hbar_inside
 PURPOSE:
	(internal use by smei_frm_hbar only)
 CALLING SEQUENCE:
	FUNCTION smei_frm_hbar_inside, txy, tbox, body
 INCLUDE:
	@compile_opt.pro
 CALLS: ***
	ArrayLocation, InitVar, IsTime, IsType, LocalExtrema, MEAN, STDDEV, TimeUnit, destroyvar
	smei_cam2angle, smei_frm_hbar, smei_frm_property, smei_frm_read, smei_getfile
	smei_setup_roi, who_am_i
 CALLED BY:
	smei_frm_hbar
 MODIFICATION HISTORY:
	JAN-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_hdr__define $SSW/smei/ucsd/camera/idl/frm/smei_frm_hdr__define.pro
[Previous] [Next]
 NAME:
	smei_frm_hdr__define
 PURPOSE:
	Structure definition for frame header of SMEI .buf files
 CATEGORY:
	camera/idl/buf
 CALLING SEQUENCE:
	hdr = {smei_frm_hdr}
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL BY:
	smei_buf_getframe, smei_frm_get, smei_frm_summary, smei_frm_track
	smei_frm_where, smei_getfile, smei_hdr_plot
 PROCEDURE:
	See Don Mizuno's, SMEI_CONVERT memo
 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS)
		Based on SMEI Convert 1.0 and 1.1
	FEB-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Rearranged order. Merged all times in single structure
		elements. Added entry for exposure time. Added location
		of venus. Removed all blank_double, blank_float,
		blank_long and blank_short.


smei_frm_info $SSW/smei/ucsd/camera/idl/frm/smei_frm_info.pro
[Previous] [Next]
 NAME:
	smei_frm_info
 PURPOSE:
	Compiles statistics for list of frames
 CATEGORY:
	camera/idl/misc
 CALLING SEQUENCE:
	smei_frm_info, hdrs
 INPUTS:
	hdrs	array; type: smei_frm_hdr structure
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
	(to screen)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, TimeGet, TimeOp, TimeString, TimeUnit, smei_frm_property
 PROCEDURE:
	Counts frames for each camera and mode.
	Also distinguished between padded 'full-frame' data
	and unpadded 'ROI' data.
 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_name $SSW/smei/ucsd/camera/idl/frm/smei_frm_name.pro
[Previous] [Next]
 NAME:
	smei_frm_name
 PURPOSE:
	Construct or deconstructs file name for SMEI data files from/into its
	components (time,camera,file extension, and map mode)
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	FUNCTION smei_frm_name, tt, camera=camera, mode=mode, type=type, upto=upto
 INPUTS:
	tt				array[n]; type; time structure or string
						time or file name
 OPTIONAL INPUT PARAMETERS:
	If input 'tt' is a time structure, the file name is constructed using
	the following additional input:

	camera=camera	scalar or array[n]; type: integer
						camera number (1,2, or 3)
	type=type		scalar or array[n]; type: string; default: '.fts.gz'
						file type
	mode=mode		scalar or array[n]; type: string or integer; default: 'frm'
						file mode, e.g. 'frm', 'cal','sky','equ'
						If an integer is specified it is assumed to be the
						frame binning mode 0 (1x1), 1 (2x2) or 2 (4x4), in which
						case the type will be 'm'+mode
	upto=upto		scalar; type: integer; default: TimeUnit(/sec)
						sets time unit where file name is truncated
 OUTPUTS:
	If input 'tt' is time structure:

	name			array[n]; type: string
						name of SMEI file

	If input 'tt' is a file name

	name			array[n]; type: time structure
						time coded into SMEI file (e.g. time of frame
						or start time of orbit)
 OPTIONAL OUTPUT PARAMETERS:
	If input 'tt' is a file name several parameters coded into the file
	are extracted:

	camera=camera	array[n]; type: integer
						camera number (1,2, or 3)
	type=type		array[n]; type: string or integer
						file type
	mode=mode		array[n]; type: string or integer; default: 'frm'
						file mode, e.g. 'frm', 'cal','sky','equ'
						For a SMEI frame the frame binning mode is returned
						as an integer.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	GetFileSpec, InitVar, IsTime, IsType, SetFileSpec, TimeString, TimeUnit, UNIQ [1]
	UNIQ [2], UNIQ [3], smei_time
 CALLED BY:
	htmd_cat, qImage_cw_ImageType, qImage_cw_Where, qsmei_sky_Pick, smei_buf_prep
	smei_buf_read, smei_frm_cvhdr, smei_frm_get, smei_frm_property, smei_getfile
	smei_hdr_get, smei_sky_get, smei_sky_read, smei_star_remove, smei_zodiac_remove
 PROCEDURE:
	Uses the standard SMEI template for file names:
		c1frm_2003_123_123456.fts.gz
 MODIFICATION HISTORY:
	MAY-2004, Paul Hick (UCSD/CASS)
	JUL-2004, Paul Hick (UCSD/CASS)
		Modified to deal with new frame name syntax with mode coded
		into the file name
	JUL-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Updated documentation


smei_frm_path $SSW/smei/ucsd/camera/idl/frm/smei_frm_path.pro
[Previous] [Next]
 NAME:
	smei_frm_path
 PURPOSE:
	Locate SMEI frame
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	FUNCTION smei_frm_path, tf, base=base, source=source, camera=camera, name=name
 INPUTS:
	tf				undefined; scalar, or array[1]
						if defined then either a time (in the form of a standard
						time structure), or the name of a SMEI frame
						(e.g. 'c2frm_2003_123_456789')
 CALLED BY:
	smei_buf_prep, smei_frm_get, smei_frm_property, smei_frm_read, smei_getfile
	smei_hdr_get, smei_hdr_update, smeidb_mounted
						NOTE: if tf is NOT defined than keyword source MUST be
						set to an existing directory.
 OPTIONAL INPUT PARAMETERS:
	source=source	scalar; type: string; default: SMEIDB?
						directory where to look for SMEI frames.
						If the directory does not exist then the current SMEI
						drive is used. The default value SMEIDB? will result
						in an automatic determination of a source directory
						using the information in file smei_drives.txt.

	The SMEI frames are stored in directories of the form
	$SMEIDB#/yyyy_doy/hh. By default the name of the full directory
	where the frames for time 'tf' are located is returned.

	/base			if set only the part $SMEIDB# is returned			
	/day			if set only the part $SMEIDB#/yyyy_doy is returned
 OUTPUTS:
	ff				scalar; type: string
						directory where frame(s) for specified time are located
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 COMMON BLOCKS:
	common smei_frm_path_save, checkdrives, sdat
 CALLS: ***
	CheckDir, FILEPATH, InitVar, IsTime, IsType, TimeGet, TimeOp, TimeSet, TimeString
	TimeUnit, destroyvar, flt_read, smei_time, who_am_i
 PROCEDURE:
	The SMEI data are distributed across several hard drives.
	Env variables SMEIDB1, SMEIDB2, etc. exist pointing to the mount
	points of each drive. Each drive contains data for the time range
	specified in the file 'smei_drives.txt'.

	SMEI data are organized in separate folders for each day. E.g. the
	folder $SMEIDB1/2003_100/c2 contains all SMEI frames
	day of year 100 (in year 2003) for camera 2.

	If tf is NOT defined then the YYYY_DOY part in the returned path
	will be missing. This is useful to locate skymaps (which usually are
	split up by camera only, not by time).
 MODIFICATION HISTORY:
	JUN-2003, Paul Hick (UCSD/CASS)
		Introduced to deal with multiple hard drives containing
		SMEI data frames.
	MAY-2004, Paul Hick (UCSD/CASS)
		Modified to reflect new directory structure of SMEI data base
		(frames are now organized in a separate directory for each
		doy of year, with subdirectories for each of the cameras)
	AUG-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Modified to do something useful when tf is not defined.


smei_frm_ped $SSW/smei/ucsd/camera/idl/frm/smei_frm_ped.pro
[Previous] [Next]
 NAME:
	smei_frm_ped
 PURPOSE:
	Calculate electronic pedestal offset for SMEI frames
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	R = smei_frm_ped,
 INPUTS:
	hdr
	ff
 OPTIONAL INPUT PARAMETERS:
	pattern=pattern
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	IsType, smei_frm_property
 SEE ALSO:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 EXAMPLE:
 PROCEDURE:
 MODIFICATION HISTORY:
	OCT-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_property $SSW/smei/ucsd/camera/idl/frm/smei_frm_property.pro
[Previous] [Next]
 NAME:
	smei_frm_property
 PURPOSE:
	Get some property of a SMEI frame
 CATEGORY:
	camera/idl/misc
 CALLING SEQUENCE:
	out = smei_frm_property, frame[, /pedestal, /dark_current, /dark_columns, $
		/ccd_squares, /single_pix])
 INPUTS:
	frame		array[n,m,k]; type: short integer ??
					sequence of k SMEI frames of dimension n x m
				array[n]; type: structure
					header structure of SMEI frame(s)
 OPTIONAL INPUT PARAMETERS:
	If input 'frame' are 2D-arrays with SMEI frame data:

	/uncovered		Get uncovered arrea of CCD (between dark columns)
	/inroi			Only get pixels inside ROI
	/pedestal		Get pedestal value
					(based on a subset of the pixels in the pedestal columns)
	/dark_current
	/dark_columns	Get dark columns	
	/ccd_squares	Get CCD squares
	/sngle_pix		Get single pixel in center of fov

	If input 'frame' is a header structure:

	/time					returns time of array as time structure
	/name					returns file name of frame (name+extension)
	/path					returns fully-qualified path
	/onboard_ff_enabled 	returns 1 if ff was enabled
	/tlm_time				returns name of original telemetry file

 OUTPUTS:
	If input 'frame' are 2D-arrays with SMEI frame data:

	out 		/pedestal set:
					array[k]; type: double 
						Currently the pedestal is the average over the top
						half of dark columns (pixels 32 and up) away from the
						field of view

				/dark_columns set:
					array[nn,m,k]; type: same as input 'frame'
					dark columns (nn=2,4, or 8 depending on binning)

				/ccd_squares set:
					array[2*nn,nn,k]; type: same as input 'frame'
					squares on either side of fov (nn=10,20,40 depending on binning)

				/single_pix set
					array[nn,nn,k]; type: same as input 'frame'
					single pixel in center above field of view
					(nn=1,2,4 depending on binning)
	dark_column=dark_columns
						array[2,64] (mode 2); type: unsigned int, long or float 
							(multiply array dims by 2^(2-mode) for mode 0,1)
							pixels in covered columns on eithe side of the frame
							(with a width of 'a' pixels)
	ccd_squares=ccd_squares
						array[10,10]; type: unsigned int, long or float
							(multiply array dims by 2^(2-mode) for mode 0,1)
							pixels in open areas outside of the smei fov
							(two squares of 10 x 10 telemetry pixels)
	single_pix=single_pix
						array[1,1]
							(multiply array dims by 2^(2-mode) for mode 0,1)
							pixels horizontally centered in frame above fov
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
	@smei_roi_mask.pro		; ROI mask common block
 CALLS: ***
	ArrayLocation, BadValue, FILEPATH, GetFileSpec, InitVar, IsType, STDDEV, UNIQ [1]
	UNIQ [2], UNIQ [3], boost, smei_frm_name, smei_frm_path, smei_setup_roi, smei_time
	where_common, who_am_i
 CALLED BY:
	img_read, qImage_cw_Where, qsmei_hdr, smei_base_testcase, smei_buf_get
	smei_buf_getframe, smei_buf_mget, smei_buf_prep, smei_buf_read
	smei_cam_quaternion, smei_cv, smei_frm_base, smei_frm_cvhdr, smei_frm_eclipse
	smei_frm_findpoint, smei_frm_hbar, smei_frm_hbar_inside, smei_frm_info
	smei_frm_ped, smei_frm_read, smei_frm_track, smei_frm_where, smei_hdr_make
	smei_hdr_plot, smei_orbits_stat, smei_sky2cam
 SEE ALSO:
 RESTRICTIONS:
	The file smei_buf_roi.txt must exist in the same directory as this source
	code file.
 PROCEDURE:
	The dark_columns, ccd_squares and single pix are identified by checking for values
	2,3 and 4, respectively in the mask read from smei_buf_roi.txt.
 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_read $SSW/smei/ucsd/camera/idl/frm/smei_frm_read.pro
[Previous] [Next]
 NAME:
	smei_frm_read
 PURPOSE:
	Read SMEI frame
 CATEGORY:
	camera/idl/misc
 CALLING SEQUENCE:
	img = smei_frm_read(ff, source=source, hdr=hdr)
 INPUTS:
	ff				scalar; type: string
						file name of SMEI frame
						If no file type is specified then .nic.gz and
						.gz are tried (in that order)
						If no directory is specified then the main
						SMEI data base on cass180 is used.
 OPTIONAL INPUT PARAMETERS:
	source=source	scalar; type: string
						source directory of SMEI frames
	/nodata 		if set, only read the frame header
					(return value of img will be -1).
 OUTPUTS:
	img				array[n,m]; type: integer
						SMEI frame data
 OPTIONAL OUTPUT PARAMETERS:
	hdr=hdr			array[1]; type: structure
						frame header
	error=error		scalar; type: string
						error string. Will be the null string if
						file was read successfully.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
	@smei_roi_mask.pro		; ROI mask common block
 CALLS: ***
	FILEPATH, GetFileSpec, HEADFITS [1], HEADFITS [2], HEADFITS [3], InitVar, IsType
	READFITS [1], READFITS [2], READFITS [3], TimeOp, TimeString, TimeUnit, bin_read
	do_file, hide_env, smei_frm_cvhdr, smei_frm_path, smei_frm_property
	smei_setup_roi, smei_time, who_am_i
 CALLED BY:
	img_read, smei_buf_prep, smei_frm_get, smei_frm_hbar, smei_frm_hbar_inside
	smei_frm_track, smei_getfile
 SEE ALSO:
 SIDE EFFECTS:
 RESTRICTIONS:
	Andy renames .nic files to .raw to look at them in Adobe Photoshop.
	For now we assume that all .raw files are indeed .nic files in disguise.
 PROCEDURE:
 MODIFICATION HISTORY:
	MAY-2003, Paul Hick (UCSD/CASS)
	JUN-2003, Paul Hick (UCSD/CASS)
		Added check for missing file extension.
	JUL-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added /ramdisk keyword


smei_frm_rebin $SSW/smei/ucsd/camera/idl/frm/smei_frm_rebin.pro
[Previous] [Next]
 NAME:
	smei_frm_rebin
 PURPOSE:
	
 CATEGORY:
 CALLING SEQUENCE:
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
	@smei_roi_mask.pro		; ROI mask common block
 EXTERNAL:
 CALLS: ***
	InitVar, MagnifyArray, smei_setup_roi, who_am_i
 SEE ALSO:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 EXAMPLE:
 PROCEDURE:
 MODIFICATION HISTORY:
	APR-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_summary $SSW/smei/ucsd/camera/idl/frm/smei_frm_summary.pro
[Previous] [Next]
 NAME:
	smei_frm_summary
 PURPOSE:
	Plots time series for various basic parameters in SMEI data frames
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	smei_frm_summary, frame
 INPUTS:
	frame			array[1], or array[2]; type: time structure
						begin and end time for time range to be plotted.
						If only a start time is given then the end time is taken
						to be the start time, plus one day.
 OPTIONAL INPUT PARAMETERS:
	source=source
	destination=destination
	camera=camera
 OUTPUTS:
	(to png file)
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
	smei_frm_hdr__define
 CALLS: ***
	AngleRange, BadValue, CheckDir, Elongation, FILEPATH, Get_Page, InitVar, IsTime, IsType
	MEAN, PlotCurve, STDDEV, Set_Page, TimeGet, TimeLimits, TimeOp, TimeScale, TimeSet
	TimeString, TimeSystem, TimeUnit, TimeXAxis, WhatIs, destroyvar, jpl_body, jpl_phase
	smei_frm_track, smei_frm_where, smei_getfile
 COMMON BLOCKS:
 PROCEDURE:
 TO DO:
	- Dark current subtraction does not take slope from row to row into account
	  (especially important for camera three)
	- Definition of SAA needs improvement
 MODIFICATION HISTORY:
	APR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_track $SSW/smei/ucsd/camera/idl/frm/smei_frm_track.pro
[Previous] [Next]
 NAME:
	smei_frm_track
 PURPOSE:
	Calculates frame baseline (pedestal, dark current,
	average intensity in squares and center group) using
	information from previously processed frames.
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	smei_frm_track, frm, count, nfill_control=nfill_control
		ff=ff, hdr=hdr, img=img, /silent
 INPUTS:
	frm 		scalar; type: integer
					frame number to be processed
	count		scalar; type: integer
					total # frames to be processed
					(used to dimension a several arrays maintained internally
					in common block, and used to clear the common block whe
					frm becomes equal to count (i.e. when all frames have been
					processed).
 OPTIONAL INPUT PARAMETERS:
	/silent		suppress run-time information
					(passed to smei_frm_base)
	/reset		re-initialize the current camera/mode combination
	nfill_control=nfill_control
				scalar; type: integer; default: (set in smei_frm_base)
					# good frames used to build reference base values
					(passed to smei_frm_base)
	ff=ff
	hdr=hdr
	img=img
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
	hdr = hdr
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
	smei_frm_hdr__define
 CALLS: ***
	ArrayLocation, InitVar, IsType, TimeString, TimeUnit, destroyvar, smei_frm_base
	smei_frm_property, smei_frm_read
 CALLED BY:
	smei_frm_summary
 COMMON BLOCKS:
	common smei_frm_track_save, ncount, cam_fulls, cam_start, cam_nail, frm_ok, cameras, modes, step
 PROCEDURE:
 MODIFICATION HISTORY:
	MAY-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_frm_update $SSW/smei/ucsd/camera/idl/frm/smei_frm_update.pro
[Previous] [Next]
 NAME:
	smei_frm_update
 PURPOSE:
	Update headers of SMEI Fits frames
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	PRO smei_frm_update, cframe,	$
		shutter_open=shutter_open,	$
		bad_quat=bad_quat,			$
		just_bad=just_bad,			$
		on=on,						$
		off=off
 INPUTS:
	cframe		scalar; type: string
				fully-qualified name of SMEI frame
 OPTIONAL INPUT PARAMETERS:
	/shutter_open	if set the value of the 'shutter-open' flag is changed
	/just_bad		if set the value of the 'just_bad' flag is changed
	/on				by default the flag setting is reversed.
					/on explicitly sets the flag to 'on'
	/off			/off explicitly sets the flag to 'off'
 OUTPUTS:
	Changes are written directly into the disk file
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FXHMODIFY [1], FXHMODIFY [2], GetFileSpec, InitVar, IsType, SetFileSpec
	smei_frm_flag, smei_getfile
 PROCEDURE:
	Only one header entry can be changed in one frame at a time.
 MODIFICATION HISTORY:
	MAR-2004, Paul Hick (UCSD/CASS)
	JUL-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added /on and /off keywords
		Added /bad_quat keyword


smei_frm_where $SSW/smei/ucsd/camera/idl/frm/smei_frm_where.pro
[Previous] [Next]
 NAME:
	smei_frm_where
 PURPOSE:
	Calculate location of Coriolis and pointing of cameras
	for specified time and spacecraft quaternion.
	Check whether specified location (RA,dec in J2000) is
	inside the field of view.
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	smei_frm_where, hdr
 INPUTS:
	hdr 				can be one of the following
						array[n]; type: frame header structure
							array of headers for target frames
						array[2]; type: time structure
							time range (passed to smei_getfile) 
						scalar or array; type: string
							list of file names of target frames. These can
							be fully-qualified. If it only consists of a filename
							(e.g. c2m2_2004_101_121212) then the SMEI data base
							is used.

						if 'hdr' is not specified then the dialog_pickfile
						dialogis used to select files. If two files are
						selected, then the file names are passed to
						smei_getfile to find all frames in between the
						implied time range. If only one file or more than two
						files are selected, then the indicated frames are
						processed.
 OUTPUT PARAMETERS:
	hdr					array[n]; type: frame header structure
							array of headers for target frames
							(if the input 'hdr' was a time range or a list of
							fully-qualified filenames)
 OPTIONAL INPUT PARAMETERS:
	/open_shutter		selects frames with shutter open
	/closed_shutter 	selects frames with shutter closed
							(this checks the 'shutter_open' flag in the frame
							header; by default the 'shutter_open' flag is NOT checked)
	mode=mode			selects data for specified mode (0,1 or 2) only.

	/degrees			if set all angles are in degrees (default: radians)

	/spacecraft 		if set then sky locations of all bodies in the planetary
						JPL ephemeris and asteroid USNO ephemeris are calculated
						from a spacecraft-centric perspective (by default the locations
						are geocentric). The difference is probably only significant
						for the Moon (e.g. it matters for eclipse calculations).

						The location of the spacecraft is approximate only. It assumes
						that the spacecraft is at geocentric distance of 6367+850 km.
						The location in geocentric RA and dec is derived from the
						spacecraft quaternion assuming the spacecraft is in its default
						attitude with the s/c axis along the nadir-zenith direction (i.e.
						if breaks down during attitude changes.
	source=source		scalar; type: string
							passed to smei_getfile
	camera=camera		scalar; type: integer
							passed to smei_getfile

	show=show			scalar; type: integer: default: 0
						 1: print info for frames and all bodies for all frames
						 2: print info for frames and all bodies, but only for
							frames that contain one or more bodies.
						 3: print SMEI frame info only for all frames

						-1: 
	outfile=outfile 	scalar; type: string
							fully-qualified name of output file
							Captures same output of 'show' to the specified file
							If outfile is specified and 'show' is not set then
							show=1 is assumed.

	points_radec		array[2,n]; type: float
							J2000 RA and dec of locations in the sky.
							The units are degrees or radians depending on the
							setting of keyword /degrees.
	points_name 		array[n]; type: string
							list of ascii names for all sky locations
							in 'points_radec'. If not specified, then '1','2',
							etc. is used.

	Instead of specifying points_radec sky locations can be identified by
	the following keywords. /jpls depends on the JPL planetary ephemeris.
	/stars depends on the bright star list compiled by Susan Rappoport and
	Andy Buffington, /usnos depends on the USNO ephemeris,and
	/mpcs depends on ephemerides from the Minor Planet Center homepage.

	Locations in the sky are specified as J2000 RA and dec.
	/jpls				checks for planets, Sun and Moon (using JPL ephemeris)
							Optional if jpl_list is specified.
	/stars				checks for stars on SMEI star list (currently cut off at
							SMEI magnitude 'm_max' (default: 4.5,
							which leaves about 1000 stars).
							Optional if star_list is specified.
	/usnos				checks for asteroids on the USNO ephemeris
							Optional if usno_list is specified.
	jpl_list=jpl_list	array; type: integer; default: sun,planets and moon
							list of planets to check.
							Usually set up by a call to jpl_body
	star_list=star_list array; type: structure
							list of stars to check. Usually set up by call to
							smei_star_info(/get_struct)
	usno_list=usno_list array; type: integer or string; default: all asteroids
							list of asteroids to be checked. Usually set up by
							call to usno_body
	mpc_list=mpc_list	array; type: integer or string; default: all MPC bodies
							list of MPC bodies to be checked. Usually set up by
							call to mpc_body

	/all				by default only information about points strictly inside
							the fov is given (and output in the OPTIONAL OUTPUT
							PARAMETERS). Setting /all will return
							information about all points.

	m_max=m_max 		scalar or array[2]; type: float
							if scalar then only stars from the SMEI catalogue
							brighter then this cut-off SMEI magnitude are used.
 OPTIONAL OUTPUT PARAMETERS:
	sc_loc = sc_loc 	array[3,n]; type: double
							best guess at Coriolis location in geographic
							coordinates (derived from quaternion, assuming that
							the spacecraft is in its default attitude with
							z-axis pointing to nadir and x-axis along the
							velocity vector).
								array[0,*]: geographic longitude
								array[1,*]: geographic latitude
								array[2,*]: don't know exactly, but it's
									positive when Coriolis is heading north;
									negative when heading south.
	pointing = pointing	array[3,n]; type: double
							camera pointing in equatorial coordinates
								array[0,*]: right ascension of optical axis
								array[1,*]: declination of optical
								array[2,*]: camera tilt relative to equat north

	nobject=nobject 	scalar; type: integer
							# sky objects
							if nobject=0 then none of the output arguments
							below will exist.

	name  = name		array[nobject]; type: string
							names of bodies for which information is given

	inside = inside 	array[nobject,n]; type: byte
							0 if inside fov; 1 if outside fov

	loc    = loc		array[3,nobject,n]; type: float
								equatorial coordinates of all bodies in 'name'
								array[0,*,*]: right ascension
								array[1,*,*]: declination
								array[2,*,*]: distance (for stars and RA-dec
									pairs this will be 1)
	runit = runit		array[3,nobject,n]; type: double
							locations in the sky of planets, asteroids or stars,
							as unit vectors in the UCSD camera frame
	ccd = ccd 			array[2,nobject,n]; type: double
							CCD locations of points in the sky. These are the
							values after applying Andys' formulae.
								array[0,*,*]: x coordinate
								array[1,*,*]: y coordinate
	mags = mags 		array[nobject,n]; type: float
								apparent SMEI magnitude. This is only available
								for the stars in the SMEI star catalogue.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
	smei_frm_hdr__define
 CALLS: ***
	AngleRange, AngleUnits, CV_COORD, CombineRotations, CvRotation, CvSky, InitVar, IsTime
	IsType, REVERSE, SuperArray, TimeString, ToDegrees, ToRadians, boost, destroyvar
	jpl_body, jpl_eph, mpc_body, mpc_eph, sgp4_eph, smei_cam2angle, smei_cam_quaternion
	smei_cv, smei_frm_property, smei_getfile, smei_star_info, usno_body, usno_close
	usno_eph
 CALLED BY:
	qImage_cw_DrawEphem, smei_frm_eclipse, smei_frm_findpoint, smei_frm_summary
	smei_hdr_plot
 EXAMPLE:

	EXAMPLE 1:

	Check where Mars is inside FOV between 2:00 and 2:30 on 2003 doy 67.
	The frames are read from the default location for the SMEI data.

	hdr = timeset(yr=2003, doy=67, hr=2, min=[0,30])
	smei_frm_where, hdr, show=1, jpl_list=jpl_body(/mars)

	hdr is now filled with the headers for all frames in the specified
	time range. Subsequent calls with this header will bypass reading of frames.

	EXAMPLE 2:

	Given an array with frame names (e.g. read from a file), create a file
	with information about the position of the Sun.
	If 'file' contains records of the form c2m2_2003_101_121212 with frames
	for camera 2 only:

	status = txt_read(file, frames)
	smei_frm_where, frames, jpl_list=jpl_body(/sun), /all, $
		/longformat, outfile='sun.txt'

	The file sun.txt is created in the working directory.
 PROCEDURE:
	For single frames retrieve the header first with smei_frm_read, and
	use it as input. This circumvents the potentially very slow
	call to smei_getfile.
 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS)
	OCT-2004, Paul Hick (UCSD/CASS)
		Added rtheta keyword.
	OCT-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Replaced approximate calculation of spacecraft location based
		on quaternion to more accurate location based on orbital elements.
		Replaced stheta and rtheta by runit keyword. The function
		smei_cam2angle can be used to convert the unit vectors to angles.


smei_frm_write $SSW/smei/ucsd/camera/idl/frm/smei_frm_write.pro
[Previous] [Next]
 NAME:
	smei_frm_write
 PURPOSE:
	Write SMEI data into nic file
 CATEGORY:
	camera/idl/buf
 CALLING SEQUENCE:
	status = smei_frn_write(hdri, data, filename, count=count)
 INPUTS:
	hdri			array[1]; type: frame header structure
						frame header for frame to be written to file
	data			array[n,m]; type: unsigned integer (??)
						data to be written
	filename		scalar; type: string
						fully-qualified name for output file
 OPTIONAL INPUT PARAMETERS:
	count			array[3]; type: integer
						file counters; one or more of the counters are incremented by one
						count[0]: # frames written to disk as .nic or .fits file
						count[1]: # frames skipped because file already exists
						count[2]: # frames with times earlier than the most recent frame
							that are written to disk (these should be frames from the second dump;
							if the second dump contains the same frames as the first the number
							of these frames should be small)
 OUTPUTS:
	count			array[3]; type: integer
						updated file counters (only count[0] is updated)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CheckDir, GetFileSpec, IsType, WRITEFITS [1], WRITEFITS [2], hide_env
	smei_frm_cvhdr
 CALLED BY:
	smei_buf_get, smei_buf_mget
 RESTRICTIONS:
	If /split_dir is set then a 'mkdir --parents' is spawned to to create subdirectories, 
	and gzip is spawned to compress files. This will probably work under Linux, but not
	in Windows without some modifications.
 PROCEDURE:
	This thing still needs an I/O error handler
 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS)
	MAY-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added explicit check for existence of directory
		and create it if not.


smei_fts_read $SSW/smei/ucsd/gen/idl/util/smei_fts_read.pro
[Previous] [Next]
 NAME:
	smei_fts_read
 PURPOSE:
	Read Fits file
 CALLING SEQUENCE:
	status = smei_fts_read(File, Array, errormessage=errormessage)
 INPUTS:
	File		string		file name
 OPTIONAL INPUT PARAMETERS:
	header=header
				if set then only the Fits header is read and returned
					in 'Hdr'. The data array is set to -1.
 OUTPUTS:
	status		0: some error occurred (check 'errormessage')
				1: file properly read
	Array		array[n,m]
				2D array of requested type
				if something goes wrong or /header was set then
				Array = -1 is returned
	Hdr 		Fits header array
 OPTIONAL OUTPUT PARAMETERS:
	errormessage
				scalar; type: string
					Contains null string if file was read succesfully
					Contains error message if an error occurred
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	HEADFITS [1], HEADFITS [2], HEADFITS [3], InitVar, IsType, READFITS [1]
	READFITS [2], READFITS [3], do_file, gunzip_file
 PROCEDURE:
	Wrapper for the readfits.pro procedure in SSW.
	The SSW version decompresses Fits file in place, which won't work
	if the gzipped version is stored on a read-only file system.
	This wrapper unzips the file into a temporary file using
	gunzip_file and takes care of cleaning up the temporary file.
 MODIFICATION HISTORY:
	JUL-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_getfile $SSW/smei/ucsd/camera/idl/toolbox/smei_getfile.pro
[Previous] [Next]
 NAME:
	smei_getfile
 PURPOSE:
	Get list of file names for all files (CCD frames or skymaps) in specified time range
 CATEGORY:
	camera/idl/toolbox
 CALLING SEQUENCE:
	FUNCTION smei_getfile, frame, camera=camera, mode=mode, count=count, tt=tt,	$
		source=source, get_hdr=get_hdr, hdr=hdr, get_frm=get_frm, frm=frm,	$
		exact=exact, turbo=turbo, silent=silent, ramdisk=ramdisk,	$
		ls_corrupt=ls_corrupt, rm_corrupt=rm_corrupt
 INPUTS:
	frame			array[1], or array[2]; type: time structure
						begin and end time for requested time range
						If only a start time is given then the end time is
						taken to be the start time, plus one day.
						If 'frame' is not defined than the IDL pickfile
						dialog is called
 OPTIONAL INPUT PARAMETERS:
	source=source	scalar; type: string; default: SMEIDB?
						root directory of smei data
	camera=camera	scalar; type: integer
						camera number (1,2 or 3); if set only frames for the
						specified camera are extracted.
	mode=mode		scalar, or array[n]; type: integer or string; default: [0,1,2]
						if set then only retrieve frames for specified mode(s).
	/get_hdr		return frame headers
	/get_frm		return a pointer to the frame data
 OUTPUTS:
	ff				array[count]; type: string or smei_frm_hdr structure
						fully-qualified file names for all frames
						if no frames are found (count=0) then ff is the null string

						if /get_hdr is set then the headers are returned instead.
						if /get_frm is set then the frame data are returned instead
 OPTIONAL OUTPUT PARAMETERS:
	count=count 	scalar; type: integer
						# frames located
	tt=tt			array[count]; type: time structure
						frame times
	hdr=hdr 		array[count]; smei_frm_hdr structure
						frame headers
	frm=frm 		array[count]; heap pointer
						frame data
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, FindAllFiles, GetFileSpec, InitVar, IsTime, IsType, SetFileSpec, TimeGet
	TimeLimits, TimeOp, TimeSet, TimeString, TimeSystem, TimeUnit, UNIQ [1], UNIQ [2]
	UNIQ [3], boost, destroyvar, hide_env, smei_coriolis, smei_frm_name, smei_frm_path
	smei_frm_read, smei_sky_read, smei_time, where_common
 EXTERNAL:
	smei_frm_hdr__define
 CALLED BY:
	qsmei_hdr, smei_base_testcase, smei_buf_getframe, smei_frm_cp, smei_frm_hbar
	smei_frm_hbar_inside, smei_frm_summary, smei_frm_update, smei_frm_where
	smei_hdr_make, smei_orbits_stat, smei_star_fitone
 PROCEDURE:
 MODIFICATION HISTORY:
	APR-2003, Paul Hick (UCSD/CASS)
	OCT-2003, Paul Hick (UCSD/CASS)
		Added /get_hdr and hdr=hdr keywords
	FEB-2004, Paul Hick (UCSD/CASS)
		Added /get_frm and frm=frm keywords
	MAY-2004, Paul Hick (UCSD/CASS)
		Fairly substantial rewrite of a crappy routine.
		Modified to reflect new directory structure of SMEI data base
		(frames are now organized in a separate directory for each
		doy of year, with subdirectories for each of the cameras)
	JUL-2004, Paul Hick (UCSD/CASS)
		Added /ramdisk keyword. Bug fix on processing of mode keyword.
	SEP-2004, Paul Hick (UCSD/CASS)
		Added code to select frames for a specific mode by checking the
		file name first. If the mode is encoded in the file name this
		speeds up the selection considerably.
	AUG-2006 , Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Removed some dead code that dates back to when the mode was not
		yet encoded in the filename for SMEI CCD frames.
		Generalized interpretation of mode keyword: if set to a string
		than skymaps will be processed, instead of SMEI CCD frames.


smei_hdr_get $SSW/smei/ucsd/camera/idl/hdr/smei_hdr_get.pro
[Previous] [Next]
 NAME:
	smei_hdr_get
 PURPOSE:
	Reads Fits binary tables containing all SMEI frame headers
 CATEGORY:
	ucsd/camera/idl/frm
 CALLING SEQUENCE:
	smei_hdr_get, tt [, camera=camera]
 INPUTS:
	tt				array[2]; standard time structure
						indicates time range for which SMEI frame are to
						be processed
 OPTIONAL INPUT PARAMETERS:
	source			scalar; type: string
						either a single Fits file containing frame headers in binary
						table form, or a directory where these files are located.
						If a directory is specified then the Fits files MUST contain
						frame headers organized in daily files
	destination 	scalar; type: string
						only used if /write or /overwrite are set
						destination directory for Fits binary table file
	camera			scalar; type: integer (1,2,3)
						camera for which headers are to be extracted
						If not specified, camera 1 is used.
	mode			scalar; type: integer (0,1,2); default: none
						only frames for specified mode are extracted
	get 			scalar or array; type: string
						list of tag names of the {smei_frm_hdr} structure
						to be extracted in the one,..,seven keywords
						(to get a list of valid entry, type 'smei_hdr_get' at
						the IDL prompt).
	dbsource		only used if output arg 'dbname' is requested
					passed to smei_frm_path
						scalar; type: string; default: SMEIDB?
						location of SMEI data frames (usually SMEIDB? or SMEIDC?)
 OUTPUTS:
	time=time		array; type: standard time structure
 OPTIONAL OUTPUT PARAMETERS:
	count=count 	scalar; type: integer
					if /write or /owerwrite SET:
						number of headers written into Fits binary table (all cameras
						combined, if more than one camera was processed).
					if /write and /overwrite NOT set:
						number of headers extracted from Fits binary tables
	hdr=hdr 		complete header
	
	one=one 		Extracted keywords in the order specified in 'get'
	two=two
	three=three
	four=four
	five=five
	six=six
	seven=seven

	dbname			array; type: string
						list of fully-qualified frame file name in SMEI database
						specified in 'dbname'.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
	smei_frm_hdr
 CALLS: ***
	CheckDir, FILEPATH, FXBCLOSE [1], FXBCLOSE [2], FXBOPEN [1], FXBOPEN [2]
	FXBOPEN [3], FXBREAD [1], FXBREAD [2], FXBREAD [3], InitVar, IsType, TimeGet
	TimeLimits, TimeOp, TimeSet, TimeString, TimeUnit, boost, destroyvar, hide_env
	smei_frm_name, smei_frm_path
 CALLED BY:
	qsmei_hdr, smei_findcrazy, smei_hdr_plot, smei_orbits_stat
 SEE ALSO:
	smei_hdr_make
 PROCEDURE:
 MODIFICATION HISTORY:
	JUN-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_hdr_make $SSW/smei/ucsd/camera/idl/hdr/smei_hdr_make.pro
[Previous] [Next]
 NAME:
	smei_hdr_make
 PURPOSE:
	Writes Fits binary tables containing all SMEI frame headers
 CATEGORY:
	ucsd/camera/idl/frm
 CALLING SEQUENCE:
	PRO smei_hdr_make, tt,	$
		overwrite	= overwrite 	, $
		source		= source		, $
		destination = destination	, $
		camera		= camera		, $
		get 		= get			, $
		count		= count 		, $
		remote		= remote		, $
		silent		= silent
		;_extra		= _extra
 INPUTS:
	tt				array[2]; standard time structure
						indicates time range for which SMEI frame are to
						be processed
 OPTIONAL INPUT PARAMETERS:
	/overwrite		if SET a binary Fits table is overwritten if it exists
						By default existing files are NOT overwritten.
						The file name will have the form c#hdr_YYYY_DOY_hhmmss.fts
						where #=1,2,3 is the camera number.
						Existing files are overwritten
	source			scalar; type: string
						source of SMEI frame files (passed to smei_getfile)
						(usually set to SMEIDB? or SMEIDC?)
	destination 	scalar; type: string
						destination directory for Fits binary table file
	camera			scalar; type: integer (1,2,3)
						only camera one frames are processed. By default all three
						cameras are processed and headers are written into three
						separate files, one for each camera.
 OPTIONAL OUTPUT PARAMETERS:
	count=count 	scalar; type: integer
						number of headers written into Fits binary table (all cameras
						combined, if more than one camera was processed).
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
	smei_frm_hdr
 CALLS: ***
	CheckDir, FILEPATH, FXADDPAR [1], FXADDPAR [2], FXBADDCOL [1], FXBADDCOL [2]
	FXBCREATE [1], FXBCREATE [2], FXBFINISH [1], FXBFINISH [2], FXBHMAKE [1]
	FXBHMAKE [2], FXBWRITM, FXHMAKE [1], FXHMAKE [2], FXWRITE [1], FXWRITE [2]
	GetFileSpec, InitVar, IsTime, IsType, TimeGet, TimeOp, TimeSet, TimeString, TimeUnit
	do_file, hide_env, smei_frm_property, smei_getfile
 CALLED BY:
	smei_hdr_update
 SEE ALSO:
	smei_hdr_get
 PROCEDURE:
 MODIFICATION HISTORY:
	JUN-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_hdr_plot $SSW/smei/ucsd/camera/idl/hdr/smei_hdr_plot.pro
[Previous] [Next]
 NAME:
	smei_hdr_plot
 PURPOSE:
	Plots time series for various basic parameters in SMEI data frames
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	PRO smei_hdr_plot, tt, destination=destination, camera=camera, $
		silent=silent, printer=printer, remote=remote, _extra=_extra
 INPUTS:
	tt					array[2]; type: time structure
							time range to be updated
 OPTIONAL INPUT PARAMETERS:
	destination=destination
	camera=camera
 OUTPUTS:
	(to png file)
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
	smei_frm_hdr__define
 CALLS: ***
	AngleRange, BadValue, CheckDir, Elongation, FILEPATH, Get_Page, InitVar, IsType, MEAN
	PlotCurve, STDDEV, Set_Page, TimeGet, TimeLimits, TimeOp, TimeScale, TimeSet, TimeString
	TimeSystem, TimeUnit, TimeXAxis, do_file, hide_env, jpl_body, jpl_phase
	smei_frm_property, smei_frm_where, smei_hdr_get
 CALLED BY:
	smei_hdr_update
 PROCEDURE:
	- Definition of SAA needs improvement
 MODIFICATION HISTORY:
	SEP-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_hdr_update $SSW/smei/ucsd/camera/idl/hdr/smei_hdr_update.pro
[Previous] [Next]
 NAME:
	smei_hdr_update
 PURPOSE:
	Update Fits binary tables containing SMEI frm headers or time series plots based
	on Fits binary tables.
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	PRO smei_hdr_update, tt 		, $
		source		= source		, $
		pscmd		= pscmd			, $
		destination = destination 	, $
		camera		= camera		, $
		silent		= silent		, $
		all 		= all			, $
		drive		= drive 		, $
		update		= update		, $
		tplot		= tplot 		, $
		force		= force 		, $
		remote		= remote
 INPUTS:
	tt					array[2]; type: time structure
							time range to be updated
 OPTIONAL INPUT PARAMETERS:
	all=all 			if set the whole SMEI data base is updated (overrides 'tt')
	drive=drive 		scalar; type: integer
							if set the corresponding drive is processed (overrides 'tt' and /all)
	source=source		scalar; type: string; default: SMEIDC?
							directory indicating source of SMEI data frames (parameter is
							passed to smei_frm_path)
							(usually SMEIDB? or SMEIDC?)
	destination=destination
						scalar; type: string; default: $SSWDB_SMEI/cat/hdr
							directory where Fits binary tables are stored
	camera=camera		scalar or array[n]; type: integer; default: [1,2,3]
							cameras to be updated
	/tplot				if set the time series plots base on the Fits binary tables
							are updated
	/force				will unconditionally update Fits tables or png files
	silent=silent		suppresses informational messages if set to > 0
 OUTPUTS:
	(updated Fits binary tables.
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, FXPAR [1], FXPAR [2], FindAllFiles, HEADFITS [1], HEADFITS [2]
	HEADFITS [3], InitVar, IsType, TimeGet, TimeLimits, TimeOp, TimeSet, TimeString
	TimeSystem, TimeUnit, hide_env, is_running, smei_frm_drive, smei_frm_path
	smei_hdr_make, smei_hdr_plot, smei_time
 PROCEDURE:
 MODIFICATION HISTORY:
	AUG-2005, Paul Hick (UCSD/CASS)
	OCT-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added pscmd keyword


smei_htm_testcase $SSW/smei/ucsd/camera/idl/toolbox/smei_htm_testcase.pro
[Previous] [Next]
 NAME:
	smei_htm_testcase
 PURPOSE:
 CATEGORY:
 CALLING SEQUENCE:
	PRO smei_htm_testcase
 INPUTS:
 OUTPUTS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, FXPAR [1], FXPAR [2], InitVar, READFITS [1], READFITS [2], READFITS [3]
	WhatIs, hide_env, who_am_i
 PROCEDURE:
 MODIFICATION HISTORY:
	DEC-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


SMEI_IMAGE $SSW/smei/bham/idl/cli/smei_image.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE


 PURPOSE:
	Extract a SMEI image object from a sequence


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_image, seq, index, image


 INPUTS:
	seq	objref	Object reference of the sequence.
	index	long	The image number to get (1-based).


 OUTPUTS:
	image	objref	A named variable to contain the reference to
			the image. (If the image is not found then the
			contents are unchanged).


 CALLS: ***
	self_help, smei_msg
 RESTRICTIONS:
	DO NOT DESTROY the returned image, doing so will break the
	sequence. 


 MODIFICATION HISTORY:
	Original: 8/1/03; SJT


SMEI_IMAGE__DEFINE $SSW/smei/bham/idl/smei_image/smei_image__define.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE__DEFINE

 PURPOSE:
	Object definition for a SMEI image.

 CATEGORY:
	SMEI_IMAGE

 FIELDS:
	top	obj	Object reference to the sequence containing
			the image
	prev	obj	Reference to the previous image in the
			sequence
	next	obj	Reference to the next image in the sequence
	file	string	The name of the file from which it was read.
	start	double	The JD of the start of the image.
	stop	double	The JD of the end of the image.
	unit	string	The unit of the image
	size	int	2-element array with the image size.
	projection int	The projection used for the image (0 =
			Aitoff-hammer, 1 = Angular fisheye, -1 = unknown)
	raw_image ptr	The original image. (First plane is the raw
			image, second is the weights)
	image	ptr	The image after any processing. (Has at least
			the weights divided out).
	fitshead ptr	A pointer to the raw (or structified) FITS
			header to allow access to less often needed
			processings information.
	flags	struct	The processing flags of the raw image.
			lsff	- large-scale flat field
			dark	- Dark offset removed
			crays	- Cosmic ray filter applied
			lpoint	- Frame pointing correction applied
			gpoint	- Global pointing correction applied
			zody	- Zodiacal correction applied
			stellar	- stellar background removed.
	pflags	struct	The processing flags between raw and display.
			weight	- Final image derived from raw * weights
			compact	- Raw image deleted to save memory
			skip	- Skip image in displaying movie.
	pixmap	int	The window index of an X-pixmap for movies,
			and position of corner.

 CALLED BY:
	SMEI_RESTORE
 MODIFICATION HISTORY:
	First cut: 6/12/02; SJT
	Added linked list stuff: 8/12/02; SJT
	Add scaling info: 10/12/02; SJT
	Add compact flag: 13/12/02; SJT
	Add skip flag: 14/1/03; SJT
	Add n_planes and bright flag: 24/4/03; SJT
	Add projection index, to handle fish-eye projections (and in
	principal any others that we may think of later): 13/2/04; SJT


SMEI_IMAGE_HEADER $SSW/smei/bham/idl/cli/smei_image_header.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE_HEADER


 PURPOSE:
	Gets the FITS header from a SMEI_IMAGE


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_image_header, imref, header[, /fitshead]
	or
	smei_image_header, seqref, header, index=index[, /fitshead]


 INPUTS:
	imref	objref	Object reference to the image object


 OPTIONAL INPUTS:
	seqref	objref	Object reference to the SMEI_SEQUENCE
			containing the image to be extracted.


 KEYWORD PARAMETERS:
	index	long	Image index (1-based) used when the first
			argument is a sequence
	/fitshead	If set, then return a string array FITS
			header, rather than a structure.

 OUTPUTS:
	header	struct|string	A named variable to receive the header.


 CALLS: ***
	self_help, smei_msg
 RESTRICTIONS:
	If the source is a sequence, then the index keyword must be
	used. If it is an image then index is ignored.


 MODIFICATION HISTORY:
	Original (after SMEI_IMAGE_IMAGE): 8/1/03; SJT
	Fix clot error: 18/6/03; SJT


SMEI_IMAGE_IMAGE $SSW/smei/bham/idl/cli/smei_image_image.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE_IMAGE


 PURPOSE:
	Gets the actual image data from a SMEI_IMAGE


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_image_image, imref, image[, /raw]
	or
	smei_image_image, seqref, image, index=index[, /raw]


 INPUTS:
	imref	objref	Object reference to the image object


 OPTIONAL INPUTS:
	seqref	objref	Object reference to the SMEI_SEQUENCE
			containing the image to be extracted.


 KEYWORD PARAMETERS:
	index	long	Image index (1-based) used when the first
			argument is a sequence
	/raw		If set, then extract the raw image and
			weights, rather than the normalized image
			(will fail if the image object is compacted).
	plane	int	If set, then select the specified 1-based
			plane of the raw image.

 OUTPUTS:
	image	float	A named variable to receive the image data.


 CALLS: ***
	self_help, smei_msg
 RESTRICTIONS:
	If the source is a sequence, then the index keyword must be
	used. If it is an image then index is ignored.


 MODIFICATION HISTORY:
	Original: 8/1/03; SJT
	Added missing plane keyword: 20/1/04; SJT


SMEI_IMAGE_INFO $SSW/smei/bham/idl/cli/smei_image_info.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE_INFO


 PURPOSE:
	Get various information from a SMEI_IMAGE


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_image_info, source, info, <selector keyword>, [, index=index]


 INPUTS:
	source	objref	Either a SMEI_IMAGE object or a SMEI_SEQUENCE
                       object 


 KEYWORD PARAMETERS:
	index	int	If source is a sequence, then this keyword
			MUST be set to specify which image is to be
			queried.
	/planes		If set, then return the number of planes in
			the raw image
	/scale		If set, then return the image scale
	/size		If set, then return the image size
	/summary	If set, then return a 1-line summary of the
			image.
	/time		If set, then return the time range of the image.
	/unit		If set, then return the unit of the image.
	/file		If set, then return the original fits file
			name of the image
	/projection	If set, then return the image projection.
	/start & /stop	Qualify the /time keyword to only return the
			start or stop time.
	/convert	If set and /time and one of /start or /stop is
			set, then return the DOY format.
	/x & /y		Qualify the /scale and /size keywords to only
			return the X or Y components.
	/string		Qualify the projection key to return the name
			of the projection
	/astrom_code	Qualify the projection key to return the code
			needed by wcsxy2sph and WCSSPH2XY

 OUTPUTS:
 	info	various	A named variable to hold the returned information

 CALLS: ***
	self_help, smei_msg
 RESTRICTIONS:
	Exactly one primary selector key must be given. If the source
	is a sequence, then the index key must be given. Inappropriate
	secondary selectors are ignored.


 MODIFICATION HISTORY:
	Original: 20/1/04; SJT
	Add handling for projections: 13/2/04; SJT


SMEI_IMAGE_MOVE $SSW/smei/bham/idl/cli/smei_image_move.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE_MOVE


 PURPOSE:
	To move a SMEI_IMAGE within its sequence.


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_image_move, image, ishift[, imoved]
	or
	smei_image_move, seqref, ishift, index=index[, imoved]


 INPUTS:
	image	objref	The SMEI_IMAGE to move
	ishift	long	How far to move the image (positive values
			move it later, negative earlier)


 OPTIONAL INPUTS:
	seqref	objref	Object reference to the SMEI_SEQUENCE
			containing the image to be extracted.


 OPTIONAL OUTPUTS:
	imoved	long	A named variable to receive the actual
			distance moved (this will be less than ishift
			if the image is moved all the way to one end
			of the sequence).

 KEYWORD PARAMETERS:
	index	long	Image index (1-based) used when the first
			argument is a sequence


 CALLS: ***
	self_help, smei_msg
 RESTRICTIONS:
	If the source is a sequence, then the index keyword must be
	used. If it is an image then index is ignored.


 MODIFICATION HISTORY:
	Original: 9/1/03


SMEI_IMAGE_PRINT $SSW/smei/bham/idl/cli/smei_image_print.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE_PRINT


 PURPOSE:
	Send a SMEI_IMAGE to a PostScript file.


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_image_print, image[, <option keys>]
	or
	smei_image_print, seqref, index=index[, <option keys>]


 INPUTS:
	image	objref	Reference to the SMEI_IMAGE to be printed.


 OPTIONAL INPUTS:
	seqref	objref	Object reference to the SMEI_SEQUENCE
			containing the image to be extracted.



 KEYWORD PARAMETERS:
	index	long	Image index (1-based) used when the first
			argument is a sequence
	/menu		If specified then use a widget interface to
			set up the print settings. If this is given,
			then any keywords listed below are ignored.
	/grid		If specfied, then add a grid to the image
	/nodate		If specified, then do not add the date and
			time range of the image
	/file		If specified, then add the filename to the
			image.
	range	float	The min and max values for the display
			(implies adding the range to the plot)
	colour_table int The colour table to use. (-1 or unset to use
			the sequence map)
	xsize	float	The size in cm of the x-dimension of the image
			(y is always adjusted to preserve the aspect
			ratio)
	/no_colour	Do not generate colour PS (equivalent to
			colour_table=0)
	/portrait	Print in portrait mode (default is landscape).
	plot_file str	Specify a filename other than the default idl.ps
	/encapsulated	If set, then make an eps file (handled
			explicitly as other things are done
			differently for eps).

	Any keywords to DEVICE that do not clash with the above and
	which are accepted by the PS device may be passed.


 CALLS: ***
	self_help, smei_msg
 MODIFICATION HISTORY:
	Original: 9/1/03; SJT


SMEI_IMAGECLEANUP $SSW/smei/bham/idl/smei_image/smei_image__cleanup.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::CLEANUP


 PURPOSE:
	Destructor for SMEI_IMAGE object.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	obj_destroy, imref


 INPUTS:
	imref	objref	The object to destroy


 SIDE EFFECTS:
	An object is destroyed, possibly those linked to it are modified.


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT
	Avoid problems when the sequence is already destroyed:
	10/1/03; SJT
	Allow for images parented to operators: 14/1/03; SJT


SMEI_IMAGECOMPACT $SSW/smei/bham/idl/smei_image/smei_image__compact.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::COMPACT


 PURPOSE:
	Save storage by deleting the raw image from a SMEI_IMAGE


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> compact

 KEYWORD_PARAMETERS
	/mk_nan		If set, then convert points in the weighted
			image with zero weight into NaN values.

 MODIFICATION HISTORY:
	Original: 13/12/02; SJT


SMEI_IMAGECOPY $SSW/smei/bham/idl/smei_image/smei_image__copy.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::COPY


 PURPOSE:
	Make a copy of a SMEI_IMAGE


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref2 = imref -> copy([sequence=sequence,prev=prev])


 KEYWORD_PARAMETERS
	sequence objref	Object reference of the containing sequence of
			the new image.
	prev	objref	Object reference to the image prior to the
			desired location of the	copied image. (Must be
			a member of the same sequence as the new
			image).

 OUTPUTS:
	imref2	objref	The new copy of the object.


 MODIFICATION HISTORY:
	Original: 8/1/03; SJT
	Add prev setting and make target sequence a keyword: 9/1/03; SJT
	Support copying to a SMEI_OPERATOR and copying a derived
	image: 14/1/03; SJT


SMEI_IMAGEEVAL $SSW/smei/bham/idl/smei_image/smei_image__eval.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::EVAL


 PURPOSE:
	A Wrapper for get_image to facilitate operators.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	val = imref -> eval()


 KEYWORD PARAMETERS
	/raw		Return the raw-image
	plane	int	The plane of the raw image (1-based) to
			return.
	Any other keys accepted by the get_raw_image method can be
	used with the /raw setting.

 OUTPUTS:
	val	float	The image values


 MODIFICATION HISTORY:
	Original: 14/1/03; SJT
	Added raw keyword: 20/1/03; SJT
	Support passing of selectors: 11/7/03; SJT
	Add explicit plane keyword: 8/10/03; SJT


SMEI_IMAGEGET_CENTRE $SSW/smei/bham/idl/smei_image/smei_image__get_centre.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_CENTRE


 PURPOSE:
	To get the image centre of a SMEI image.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	centre = imref -> get_centre()


 KEYWORD PARAMETERS:
	/x	Only return the X-coordinate of the image centre
	/y	Only return the Y-coordinate of the image centre


 OUTPUTS:
	centre	The centre of the image


 MODIFICATION HISTORY:
	Original (after get_size): 8/1/03; SJT


SMEI_IMAGEGET_FILE $SSW/smei/bham/idl/smei_image/smei_image__get_file.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_FILE


 PURPOSE:
	Returns the file name from which the image was read.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	file = imref -> get_file()


 KEYWORD PARAMTETERS
	/directory	If set then return the directory rather than
			the filename.
	/full		If set, then return the full path.

 OUTPUTS:
	file	string	The filename


 MODIFICATION HISTORY:
	Original: 12/12/02; SJT
	Return file & dir separately: 13/1/03; SJT
	Add _extra to silently swallow operator keys: 15/1/03; SJT


SMEI_IMAGEGET_FLAGS $SSW/smei/bham/idl/smei_image/smei_image__get_flags.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_FLAGS


 PURPOSE:
	Return the pipeline processing flags of a SMEI image.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	flag = imref -> get_flags([<Selector>])


 KEYWORD PARAMETERS:
	/lsff		Large scale flat fielding applied?
	/dark		Dark offset removed?
	/crays		Cosmic ray filter applied?
	/lpoint		Frame pointing corrections applied?
	/gpoint		Global pointing corrections applied?
	/zody		Zodiacal background removed?
	/stellar	Stellar background removed?
	/bright		Lunar & Cytherean saturation eliminated.
	/c_equal	Camera equalizations applied


 OUTPUTS:
	flag	The requested flag value or the flags structure if no
		flag is given.


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT
	Add bright and c_equal: 24/4/03; SJT


SMEI_IMAGEGET_HEADER $SSW/smei/bham/idl/smei_image/smei_image__get_header.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_HEADER


 PURPOSE:
	Get the "structified" FITS header of a SMEI image


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	fitshdr = imref -> get_header()


 KEYWORD PARAMETERS:
	/fitshead	If set, then convert the header structure back
			to a string array.
	/quiet		If set, then don't emit a warning if the image
			has no header
	/test		If set then just return whether there is a
			header or not.


 OUTPUTS:
	fitshdr	The header structure from the original fits file.


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT
	Added /fitshead keyword: 8/1/03; SJT
	Fix typo: 18/6/03; SJT
	Add quiet keyword: 24/7/03; SJT
	Support both new (string) and old (structure) formats:
	24/7/03; SJT
	Handle case where no header present gracefully: 19/02/04; SJT


SMEI_IMAGEGET_IMAGE $SSW/smei/bham/idl/smei_image/smei_image__get_image.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_IMAGE


 PURPOSE:
	Get the processed image data of a SMEI image


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	image = imref -> get_image()


 OUTPUTS:
	The normalized image


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_IMAGEGET_LOCATE $SSW/smei/bham/idl/smei_image/smei_image__get_locate.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_LOCATE


 PURPOSE:
	Convert image coordinates to a structure giving useful
	information about that location.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	loc = imref -> get_locate(x,y)


 INPUTS:
	x,y	long	The X & Y coordinates of the point of interest.


 OUTPUTS:
	loc	struct	The information on the location.


 MODIFICATION HISTORY:
	Original: 17/12/02; SJT
	Add RA and DEC: 24/7/03; SJT
	Support fisheye projection: 13/2/04; SJT
	Get fisheye support right: 16/2/04; SJT


SMEI_IMAGEGET_NEXT $SSW/smei/bham/idl/smei_image/smei_image__get_next.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_NEXT


 PURPOSE:
	Get the reference to the next image in the sequence


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	next=imref -> get_next()


 OUTPUTS:
	next	objref	Reference to the next image in the sequence.


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_IMAGEGET_PFLAGS $SSW/smei/bham/idl/smei_image/smei_image__get_pflags.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_PFLAGS


 PURPOSE:
	Returns the state of local processing flags.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	flag = imref -> get_pflags([<flag specifier>])


 KEYWORD PARAMETERS:
	/weight		If specified then return whether a weighting
			normalization has been done
	/compact	If specified, then return whether the raw
			image has been deleted
	/skip		If sepecified, then return whether the image
			is flagged for skipping in movies.
	

 OUTPUTS:
	flag	If a flag key is given, then the value of that flag,
		otherwise the whole pflag structure.


 RESTRICTIONS:
	WIll have other keys added as their meanings become defined.


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT
	Added skip flag: 14/1/03; SJT


SMEI_IMAGEGET_PIXMAP $SSW/smei/bham/idl/smei_image/smei_image__get_pixmap.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_PIXMAP


 PURPOSE:
	Return details of a SMEI image pixmap


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	rv = imref -> get_pixmap()



 KEYWORD PARAMETERS:
	/id	Just return the window ID of the pixmap
	/llc	Just return the lower-left corner of the image in the
		pixmap.


 OUTPUTS:
	The desired numbers


 MODIFICATION HISTORY:
	Original: 11/12/02; SJT


SMEI_IMAGEGET_PLANES $SSW/smei/bham/idl/smei_image/smei_image__get_planes.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_PLANES


 PURPOSE:
	Return how many planes the raw image has.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	n_planes = imref -> get_planes()


 OUTPUTS:
	n_planes	int	The number of planes in the image.


 MODIFICATION HISTORY:
	Original: 24/4/03; SJT


SMEI_IMAGEGET_PREV $SSW/smei/bham/idl/smei_image/smei_image__get_prev.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_PREV


 PURPOSE:
	Get the reference to the previous image in the sequence


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	prev=imref -> get_prev()


 OUTPUTS:
	prev	objref	Reference to the previous image in the sequence.


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_IMAGEGET_PROJECTION $SSW/smei/bham/idl/smei_image/smei_image__get_projection.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_PROJECTION


 PURPOSE:
	Return the projection of a SMEI image


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	proj = imref -> get_projection()


 KEYWORD PARAMETERS:
	/string		If set, then return a descriptive string
			rather than a number.
	/astrom_code	If set, then return the code needed by
			wcsxy2sph and WCSSPH2XY


 OUTPUTS:
	proj	int/str	The projection, either an index or the name.


 MODIFICATION HISTORY:
	Original: 13/2/04; SJT


SMEI_IMAGEGET_RAW_IMAGE $SSW/smei/bham/idl/smei_image/smei_image__get_raw_image.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_RAW_IMAGE


 PURPOSE:
	Get the raw image from a SMEI image object


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	rimage = imref -> get_raw_image()


 KEYWORD PARAMETERS:
	/data	Only return the raw data plane of the image
		(equivalent to plane =1)
	/weight	Only return the weight plane of the image (the same as
		plane=2)
	plane	The image plane to return (1-based).

 OUTPUTS:
	The raw image


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT
	Added plane keyword: 16/5/03; SJT
	Handle "Weight-only" images: 11/7/03; SJT


SMEI_IMAGEGET_SCALE $SSW/smei/bham/idl/smei_image/smei_image__get_scale.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_SCALE


 PURPOSE:
	To get the image scale of a SMEI image.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	scale = imref -> get_scale()


 KEYWORD PARAMETERS:
	/x	Only return the X-component of the scale
	/y	Only return the Y-component of the scale


 OUTPUTS:
	scale	The scale of the image


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_IMAGEGET_SEQUENCE $SSW/smei/bham/idl/smei_image/smei_image__get_sequence.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_SEQUENCE


 PURPOSE:
	Return a reference to the SMEI_SEQUENCE that contains this
	image.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	top = imref -> get_sequence()


 OUTPUTS:
	top	objref	Reference to the containing SMEI_SEQUENCE


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_IMAGEGET_SIZE $SSW/smei/bham/idl/smei_image/smei_image__get_size.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_SIZE


 PURPOSE:
	To get the image size of a SMEI image.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	size = imref -> get_size()


 KEYWORD PARAMETERS:
	/x	Only return the X-dimension of the image
	/y	Only return the Y-dimension of the image


 OUTPUTS:
	size	The size of the image


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_IMAGEGET_SUMMARY $SSW/smei/bham/idl/smei_image/smei_image__get_summary.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_SUMMARY


 PURPOSE:
	Generate a 1-line summary of a SMEI image.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	desc = imref->get_summary()


 KEYWORD PARAMETERS:
	/nofile		If set, then don't include the filename


 OUTPUTS:
	desc	string	The summary.	


 MODIFICATION HISTORY:
	Original: 13/12/02; SJT
	Add bright and c_equal fields: 24/4/03; SJT


SMEI_IMAGEGET_TIME $SSW/smei/bham/idl/smei_image/smei_image__get_time.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_TIME


 PURPOSE:
	Get the start and/or stop times of a SMEI image


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	time = imref -> get_time()


 KEYWORD PARAMETERS:
	/convert	If set then convert to DOY format.
	/start		If set, then only return the start time.
	/stop		If set, then only return the stop time.


 OUTPUTS:
	time	The time or times requested.


 RESTRICTIONS:
	The convert keyword is ignored unless one of start or stop is
	specified.


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_IMAGEGET_UNIT $SSW/smei/bham/idl/smei_image/smei_image__get_unit.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::GET_UNIT


 PURPOSE:
	Get the units of a SMEI image


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	unit = imref -> get_unit()


 OUTPUTS:
	unit	The units of the image


 MODIFICATION HISTORY:
	Original (after get_orbit): 8/1/03; SJT


SMEI_IMAGEINIT $SSW/smei/bham/idl/smei_image/smei_image__init.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::INIT

 PURPOSE:
	Constructor for a SMEI image object.


 CATEGORY:
	SMEI IMAGE


 CALLING SEQUENCE:
	imref = obj_new('smei_image', top, prev, copy=copy, file=file)


 INPUTS:
	top	objref	Reference to the sequence or operator object.


 OPTIONAL INPUTS:
	prev	objref	Reference to the previous image in the
			sequence. If not given, then insert at start.


 KEYWORD PARAMETERS:
	file		string	The file from which to read the image.
	/compact		If set, then remove the raw image after
				creating the normalized image.
	copy		objref	Another SMEI_IMAGE which is to be copied to
				this one.
	/silent			If set, then supress messages from readfits.
	/at_end			If set, this is equivalent to setting prev to
				top->get_last()
	image_data	Float	The image values (usually a 1-plane
				derived image)
	start		double	The start time of the image (DI only)
	stop		double	The end time of the image (DI only)
	unit		string	The unit of the image (DI)
	centre		float	The centre point of the image
				coordinates (DI)
       scale		float	The image scale (DI)
       fitshead	struct	A "fake" fitsheader for the image (DI)
       flags		struct	The processing flags for the image (DI)
       fakename	string	A "fake" filename for the image (DI)
       projection	int	The projection of the image (DI)

 SIDE EFFECTS:
	Returns 0 or 1 for failure or success.


 RESTRICTIONS:
	Incomplete, will need ways to initialize by time etc.


 MODIFICATION HISTORY:
	Original: 6/12/02; SJT
	Add prev: 9/12/02; SJT
	Add compact option: 13/12/02; SJT
	Add copy option (and fix docs): 8/1/03; SJT
	Add silent keyword: 10/1/03; SJT
	Allow images to be children of an operator: 14/1/03; SJT
	Add AT_END keyword: 16/1/03; SJT
	Add keys for passing image as data: 22/10/03; SJT
	Added fakename key: 1/12/03; SJT
	Add projection key for derived images: 13/2/04; SJT
	Verify projection with rest of sequence: 16/2/04; SJT


SMEI_IMAGEMK_PA_MAP $SSW/smei/bham/idl/smei_image/smei_image__mk_pa_map.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::MK_PA_MAP


 PURPOSE:
	Make a map of PA and elongation (and optionally P).


 CATEGORY:
	SMEI_IMAGE


 OUTPUTS:
	elon	float	The elongation angles.
	pat	float	The position angles.
	p	float	The closest-approaches.

 CALLING SEQUENCE:
	imref -> mk_pa_map,elon, pat,p


 MODIFICATION HISTORY:
	Original: 12/12/03; SJT
	Add fisheye support: 17/2/04; SJT
	Fix half-pixel offset in centres: 28/4/04; SJT


SMEI_IMAGEMK_PIXMAP $SSW/smei/bham/idl/smei_image/smei_image__mk_pixmap.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::MK_PIXMAP


 PURPOSE:
	To copy a displayed SMEI image to a pixmap.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> mk_pixmap
	imref -> mk_pixmap, /destroy


 KEYWORD PARAMETERS:
	/destroy	Remove the pixmap info for the image
			(indicates that a sequence setting has
			invalidated it).
	top_right	A named variable to contain the location of
			the top right corner of the image in the
			pixmap.
	zoom	float	The zoom factor for the image.	


 SIDE EFFECTS:
	A pixmap is updated


 MODIFICATION HISTORY:
	Original: 11/12/02; SJT
	Add check for existence of pixmap: 16/12/02; SJT
	Remove explicit positioning (too dangerous and not used) and
	handle 2-D layouts: 10/1/03; SJT


SMEI_IMAGEMOVE $SSW/smei/bham/idl/smei_image/smei_image__move.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::MOVE


 PURPOSE:
	Moves an image within a sequence.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imove = imref -> move(ishift)


 INPUTS:
	ishift	long	How many places to move the image (+ = towards
			end, - = towards beginning)


 OUTPUTS:
	imove	long	How many places it was actually moved. (<=
			ishift) 


 MODIFICATION HISTORY:
	Original: 16/12/02; SJT
	Fix end effects: 13/1/03; SJT


smei_imagemvi_frame $SSW/smei/bham/idl/smei_image/smei_image__mvi_frame.pro
[Previous] [Next]
 NAME:
	smei_image::mvi_frame

 PURPOSE:
	This procedure adds an image to a file in the disk movie format.

 CATEGORY:
	SMEI_IMAGE

 CALLING SEQUENCE:
	imref -> mvi_frame, fname

 INPUTS:
	fname	string	File name of the movie disk file, with full path


 KEYWORD PARAMETERS:
	NEW:	If set this keyword indicates that a new file is to be created.
		The default is to write to an existing file


 PROCEDURE:
	The disk movie format is:

	file header:	# images in the file
			# columns in each image
			# rows in each image
			# maximum number of images in file
			# bytes in image header
			# version number

	for version 1:	# bytes in file header
	for version 1:	# sunxcen * 10
	for version 1:	# sunycen * 10
	for version 1:	# arc sec per pixel * 100
	for version 1:	# red color vector BYTARR(256)
	for version 1:	# green color vector BYTARR(256)
	for version 1:	# blue color vector BYTARR(256)

	img hdr #1:	date of image, string (15)
			time of image, string (15)
			file name, string (15)
			filter wheel, string (10)
			polarizer wheel, string (10)
			detector, string (10)
	img hdr #2
		...
	img #1
	img #2
		...

 MODIFICATION HISTORY:
 	Written by:	RA Howard, NRL, 16 Mar 1996

 Modified    : SEP  05 Feb 1997 - Mods for mvi version 1 format.
               SEP  08 Sep 1997 - Added REPLACE option.
	Converted to SMEI_IMAGE method: 17/12/02; SJT


SMEI_IMAGENORM_WEIGHT $SSW/smei/bham/idl/smei_image/smei_image__norm_weight.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::NORM_WEIGHT


 PURPOSE:
	Normalize a raw SMEI image by dividing through by the
	weights. 


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> norm_weight


 SIDE EFFECTS:
	The image field is filled.


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT
	Use normalized plane if it's there: 24/4/03; SJT
	Use best-bet plane if it's there: 9/6/03; SJT
	Allow single-plane images with a warning: 3/10/03; SJT


SMEI_IMAGEPEEK $SSW/smei/bham/idl/smei_image/smei_image__peek.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::PEEK


 PURPOSE:
	Debugging tool to allow peeking into a SMEI_IMAGE object.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> peek


 MODIFICATION HISTORY:
	Original: 16/1/03; SJT


SMEI_IMAGEPRINT $SSW/smei/bham/idl/smei_image/smei_image__print.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::PRINT


 PURPOSE:
	Make a PostScript file of a SMEI image


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> print


 KEYWORD PARAMETERS:
	/grid		If specfied, then add a grid to the image
	date	int	The date format for the image.
	/file		If specified, then add the filename to the
			image.
	range	float	The min and max values for the display
			(implies adding the range to the plot)
	kill	float	The range of values considered "good" data.
	colour_table int The colour table to use. (-1 or unset to use
			the sequence map)
	xsize	float	The size in cm of the x-dimension of the image
			(y is always adjusted to preserve the aspect
			ratio)
	/no_colour	Do not generate colour PS (equivalent to
			colour_table=0)
	/portrait	Print in portrait mode (default is landscape).
	plot_file str	Specify a filename other than the default idl.ps
	/encapsulated	If set, then make an eps file (handled
			explicitly as other things are done
			differently for eps).
	plane	int	If zero (or absent) then the processed image
			is displayed, otherwise the nth plane of the
			raw image is displayed.
	null_index byte	A 2-element array of colour indices for
			missing data and out-of-sky		

	Any keywords to DEVICE that do not clash with the above and
	which are accepted by the PS device may be passed.

 SIDE EFFECTS:
	A PostScript file is generated.


 RESTRICTIONS:
	Pro-tem it doesn't print the file.


 MODIFICATION HISTORY:
	Original: 11/12/02; SJT
	Add log scaling: 10/1/03; SJT
	Moved mechanics of image display to SMEI_IMAGE::PS_SHOW:
	16/5/03; SJT
	Added PLANE keyword: 20/6/03; SJT
	Add null_index keyword: 18/7/03; SJT
	Pass KILL keyword through: 29/3/04; SJT
	Spool file to printer: 6/6/05; SJT


SMEI_IMAGEPRINT_MENU $SSW/smei/bham/idl/smei_image/smei_image__print_menu.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::PRINT_MENU


 PURPOSE:
	GUI to control printing of a SMEI image.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> print_menu


 KEYWORD PARAMETERS:
	group	long	Widget ID of a group leader
	/block		If set, then block any other widget events.


 SIDE EFFECTS:
	A print file may be generated.


 MODIFICATION HISTORY:
	Original: 11/12/02; SJT
	Add log scaling: 10/1/03; SJT
	Add plane selection & extend grids: 20/6/03; SJT
	Add 3-state date format: 3/6/05; SJT
	Add spooling options: 6/6/05; SJT


SMEI_IMAGEPS_SHOW $SSW/smei/bham/idl/smei_image/smei_image__ps_show.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::PS_SHOW


 PURPOSE:
	Display a SMEI image to a PS device.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> ps_show, xsize, ysize


 INPUTS:
	xsize	float	The X-dimension of the image to display
	ysize	float	The Y-dimension of the image to display


 OPTIONAL INPUTS:
	xposition	The X-position on the page (in cm) of the
			lower-left corner of the image
	yposition	The Y-position on the page (in cm) of the
			lower-left corner of the image


 KEYWORD PARAMETERS:
	/grid		If specfied, then add a grid to the image
	idate	int	The date format for the image.
	/file		If specified, then add the filename to the
			image.
	range	float	The min and max values for the display
			(implies adding the range to the plot)
	kill	float	The range of values considered "good" data.
	colour_table int The colour table to use. (-1 or unset to use
			the sequence map)
	logarithmic int	Whether to plot with a logarithmic data
			mapping.
	plane	int	If zero (or absent) then the processed image
			is displayed, otherwise the nth plane of the
			raw image is displayed.
	null_index byte	A 2-element array of colour indices for
			missing data and out-of-sky		



 MODIFICATION HISTORY:
	Extracted from SMEI_IMAGE::PRINT: 16/5/03; SJT
	Add PLANE  key (and document logarithmic): 20/6/03;
	SJT
	Add null_index keyword: 18/7/03; SJT
	Support fisheye projections: 13/2/04; SJT
	Fix kill ranges for Log scaling: 20/5/04; SJT
	Add 3-state date format: 3/6/05; SJT


SMEI_IMAGEREAD_FITS $SSW/smei/bham/idl/smei_image/smei_image__read_fits.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::READ_FITS


 PURPOSE:
	Read a SMEI fits file and store its data in a SMEI_IMAGE object.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	ok = imref -> read_fits(file)


 INPUTS:
	file	string	The fits file to read.


 KEYWORD PARAMETERS:
	/silent		If set, then supress messages from readfits.


 OUTPUTS:
	ok	int	Status flag 1 for success, 0 for failure.


 SIDE EFFECTS:
	The object is populated


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT
	Add scaling info & get size from header: 10/12/02; SJT
	Added silent keyword: 10/1/03; SJT
	Modify for degenerate Aitoff files: 7/3/03; SJT
	Extract values from HISTORY: 24/4/03; SJT
	Store the original fits header rather than the structified
	version: 24/7/03; SJT
	Handle single-plane images properly: 3/10/03; SJT
	Store projection information: 13/2/04; SJT
	Verify projection with rest of sequence: 16/2/04; SJT
	Add support for compressed FITS files: 24/6/05; SJT


SMEI_IMAGERESEQUENCE $SSW/smei/bham/idl/smei_image/smei_image__resequence.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::RESEQUENCE


 PURPOSE:
	Moves a SMEI image from one SMEI sequence or operator to another.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> resequence, seqref


 INPUTS:
	seqref	objref	Object reference of the sequence or operator
			to which it is to be attached


 SIDE EFFECTS:
	The image is moved from one sequence to another.


 RESTRICTIONS:
	The image can only be attached at the end of a
	sequence. This is a dangerous tool.


 MODIFICATION HISTORY:
	Original: 20/12/02; SJT
	Allow images to be parented to an operator: 14/1/03; SJT


SMEI_IMAGESET_IMAGE $SSW/smei/bham/idl/smei_image/smei_image__set_image.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::SET_IMAGE


 PURPOSE:
	To manually set the processed image of a SMEI_IMAGE (e.g. for
	a user-defined background subtractor).


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> set_image, image_data


 INPUTS:
	image_data	float	The new image data. Must be the same
				size as the image.


 KEYWORD PARAMETERS:
	/restore	If set, then restore the default settings.


 MODIFICATION HISTORY:
	Original: 5/3/04; SJT


SMEI_IMAGESET_NEXT $SSW/smei/bham/idl/smei_image/smei_image__set_next.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::SET_NEXT


 PURPOSE:
	Set the reference to the next image in the sequence


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> set_next, next


 INPUTS:
	next	objref	Reference to the next image in the sequence.


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_IMAGESET_PLOT_SCALE $SSW/smei/bham/idl/smei_image/smei_image__set_plot_scale.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::SET_PLOT_SCALE


 PURPOSE:
	Set up data coordinates for a SMEI image plot.


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> set_plot_scale[, box]


 OPTIONAL INPUTS
	box	float	A 4-element array with the NDC space box into
			which the coordinates are to go.

 SIDE EFFECTS:
	The !X & !Y plot variables are changed.

 MODIFICATION HISTORY:
	Original: 10/12/02; SJT
	Add box option: 16/5/03; SJT
	Add support for Fisheyes: 13/2/04; SJT
	Correct for half-pixel shift in image centre: 28/4/04; SJT


SMEI_IMAGESET_PREV $SSW/smei/bham/idl/smei_image/smei_image__set_prev.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::SET_PREV


 PURPOSE:
	Set the reference to the previous image in the sequence


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> set_prev, prev


 INPUTS:
	prev	objref	Reference to the previous image in the sequence.


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_IMAGESET_SKIP $SSW/smei/bham/idl/smei_image/smei_image__set_skip.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::SET_SKIP


 PURPOSE:
	Set the skip flag on a SMEI_IMAGE


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> set_skip, flag


 OPTIONAL INPUTS:
	flag	bool	State to which to set the skip flag (if not
			given then the flag is flipped)


 MODIFICATION HISTORY:
	Original: 14/1/03; SJT


SMEI_IMAGESHOW $SSW/smei/bham/idl/smei_image/smei_image__show.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::SHOW


 PURPOSE:
	Display a SMEI image


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> show


 KEYWORD PARAMETERS:
	window	long	Window ID to display the image (this should
			only be used in exceptional circumstances --
			e.g. by the mpeg generator).
	grid		If specfied, then add a grid to the image, =2
			means grid is elongation and position angle
	date		Specify the date format.
	/file		If specified, then add the filename to the
			image.
	range	float	The min and max values for the display
			(implies adding the range to the plot)
	kill	float	The range of values considered "good" data.
	colour_table int The colour table to use.
	logarithmic int	Whether to plot with a logarithmic data
			mapping.
	plane	int	If zero (or absent) then the processed image
			is displayed, otherwise the nth plane of the
			raw image is displayed.
	/nosave		If set, then do not save the plot environment
			and don't restore afterwards (this key is used
			by smei_sequence::show as that handles the
			saving itself).
	zoom	float	A factor by which to zoom the image (must be
			int or 1/int)
	smooth	int	Whether to smooth when zoom > 1		


 SIDE EFFECTS:
	Graphics are output


 RESTRICTIONS:
	If keys and arguments are omitted, then values are taken from
	the sequence if available.
	The plane keyword is silently ignored for compacted images.


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT
	Use pixmap if present and no keys given: 11/12/02; SJT
	Handle logarithmic scalings: 10/1/03; SJT
	Add support for planes: 16/5/03; SJT
	Handle 3-state grid setting: 17/6/03; SJT
	Add nosave keyword: 18/6/03; SJT
	Add zoom support: 28/7/03; SJT
	Add fisheye support: 13/2/04; SJT
	Add kill ranges: 29/3/04; SJT
	Fix kill ranges for Log scaling: 20/5/04; SJT
	Add /nan key to min calls in renage determination: 4/8/04; SJT
	Handle 3-state date settings: 3/6/05; SJT


SMEI_IMAGESHOW_HEADER $SSW/smei/bham/idl/smei_image/smei_image__show_header.pro
[Previous] [Next]
 NAME:
	SMEI_IMAGE::SHOW_HEADER


 PURPOSE:
	Display the FITS header of a SMEI image


 CATEGORY:
	SMEI_IMAGE


 CALLING SEQUENCE:
	imref -> show_header


 KEYWORD PARAMETERS:
	group	long	Optional group leader of the widget heirarchy


 MODIFICATION HISTORY:
	Original: 24/7/03; SJT


SMEI_JOIN $SSW/smei/bham/idl/cli/smei_join.pro
[Previous] [Next]
 NAME:
	SMEI_JOIN


 PURPOSE:
	To join two SMEI sequences into a single sequence.


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_join, seq1, seq2


 INPUTS:
	seq1	objref	Reference to the first sequence. On return
			this will be the concatenated sequence.
	seq2	objref	Reference to the second sequence. On return
			this will be a null object, unless the
			preserve keyword is set..


 KEYWORD_PARAMETERS:
	/preserve	If set then copy the second sequence images
			rather than moving them.
	/sort		If set, then sort the resultant sequence after
			concatenation.

 CALLS: ***
	self_help, smei_msg
 SIDE EFFECTS:
	The first sequence is extended and the second is destroyed
	(unless preserve is set).


 MODIFICATION HISTORY:
	Original: 8/1/03; SJT
	Added preserve option: 9/1/03; SJT
	Added sort keyword: 13/1/03; SJT


SMEI_MENU $SSW/smei/bham/idl/cli/smei_menu.pro
[Previous] [Next]
 NAME:
	SMEI_MENU


 PURPOSE:
	GUI for controlling display of SMEI data


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_menu[, seqref, files=files]


 OPTIONAL INPUTS:
	seqref	objref	Object reference for the SMEI_SEQUENCE
			object. If it is not a SMEI_SEQUENCE, a new
			object will be created, otherwise an existing
			object will be opened. If not given, then a
			new object will be created and then destroyed
			on exit.


 KEYWORD PARAMETERS:
	files	string	A specification of the fits files to be used
			in the sequence. Only used for a new object.
	/no_progress	If set, then disable the progress bars (useful
			if slow network means the progress bars are
			slowing operation).


 CALLS: ***
	self_help, smei_msg
 CALLED BY:
	SMEI_CALC_MENU
 MODIFICATION HISTORY:
	Original: 18/12/02; SJT
	Add no_progress keyword: 25/8/05; SJT


smei_mkglare $SSW/smei/ucsd/camera/idl/toolbox/smei_mkglare.pro
[Previous] [Next]
 NAME:
	smei_mkglare
 PURPOSE:
	Converts glare related grd files to Fits files
 CATEGORY:
	camera/idl/toolbox
 CALLING SEQUENCE:
	PRO smei_mkglare
 INPUTS:
	From $SMEIDB/glare
 OUTPUTS:
	To $SMEIDB
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, FXADDPAR [1], FXADDPAR [2], IsType, MKHDR [1], MKHDR [2], WRITEFITS [1]
	WRITEFITS [2], do_file, grd_read
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_mksidereal $SSW/smei/ucsd/camera/idl/toolbox/smei_mksidereal.pro
[Previous] [Next]
 NAME:
	smei_mksidereal
 PURPOSE:
	Combine three grid files:
		eq_allskymeed.grd.gz
		np_allskymeed.grd.gz, and
		sp_allskymeed.grd.gz
	into one compressed Fits file:
		$SMEIDB/sidereal_sky.fts.gz.
	The resulting FITS file represents sidereal background information useful for star removal algorithms.
 CALLING SEQUENCE:
	PRO smei_mksidereal
 INPUTS:
	None
 OPTIONAL INPUT PARAMETERS:
	None
 INCLUDE:
	@compile_opt.pro
 CALLS: ***
	FILEPATH, FXADDPAR [1], FXADDPAR [2], IsType, MKHDR [1], MKHDR [2], TimeSet
	TimeString, TimeUnit, WRITEFITS [1], WRITEFITS [2], grd_read, gzip_file, hide_env
 RESTRICTIONS:
	The input grid file paths and output FITS file path are hardcoded into the program.
 PROCEDURE:
	The three grid files mentioned above are assumed to be valid grid files.
	Additional FITS header information is added to each map as they are
	written to the output FITS file.
	A special version number header keyword, BKGNDVER, is added to the main FITS header.
 MODIFICATION HISTORY:
	JUL-2006, Jordan Vaughan (UCSD)


smei_mkstdstar $SSW/smei/ucsd/camera/idl/star/smei_mkstdstar.pro
[Previous] [Next]
 NAME:
	smei_mkstdstar
 PURPOSE:
	Convert grd files for standard stars to Fits files
	used by smei_htm
 CATEGORY:
	camera/idl/star
 CALLING SEQUENCE:
	PRO smei_mkstdstar
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, FXADDPAR [1], FXADDPAR [2], IsType, MKHDR [1], MKHDR [2], WRITEFITS [1]
	WRITEFITS [2], grd_read, gzip_file, who_am_i
 MODIFICATION HISTORY:
	JUN-2006, Paul Hick (UCSD/CASS)
	SEP-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		In addition to old PSF there now is an alternative PSF
		(presumably with the background removed more accurately)
		The old standard_star.fts is now standard_star_fixd.fts;
		the new PSF is in standard_star_fill.fts.


SMEI_MOVIE $SSW/smei/bham/idl/cli/smei_movie.pro
[Previous] [Next]
 NAME:
	SMEI_MOVIE


 PURPOSE:
	Write a SMEI sequence to a movie file


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_movie, seqref, file, /<type selector key>


 INPUTS:
	seqref	objref	The SMEI sequence to save.
	file	string	The file to which to save the movie (excluding
			the extension)

 KEYWORD PARAMETERS:
	frame_rate	float	Number of frames per second. [avi,
				quicktime]
	/avi			If set, then make an avi (divx5) movie
				(default) 
	/quicktime		If set, then make a quicktime movie.
	/ffmpeg			If set, then make an ffmpeg avi
				movie. 
	/mpeg			If set, then make a plain old mpeg
				movie.
	/mvi			If set, them make a LASCO MVI format
				movie.
	compress	int	The compression level (0..3) [mpeg]
	quality		int	The quality setting [01] [mpeg]
	multiplex	int	The number of times to repeat each
				image to get a sensible speed. [mpeg]
	codec		string	Specify the codec to use for ffmpeg or
				quicktime movies.


 CALLS: ***
	self_help, smei_msg
 MODIFICATION HISTORY:
	Original (after smei_avmv): 17/2/04; SJT
	Add ffmpeg and codec keys: 7/6/05; SJT


smei_msg $SSW/smei/bham/idl/utils/smei_msg.pro
[Previous] [Next]
 SMEI_MSG
	Display an error message, in a suitable manner.

 Usage:
	smei_msg, message

 Argument:
	message	string	input	The error message to be displayed.

 Keywords:
	error	If set, then the message is an error.
	warning	If set, then the message is a warning.
	alert	If set, then then message is a warning that needs to
		be noticed.
	inform	If set, then the message is for information only.
	noshow	If set, then don't pop the main widget to the front.
	dialog_parent	long	Optional "parent" for the dialogue.

 Other keys used by dialog_message can also be passed (they will of
 course be ignored if no pop-up is generated).

 CALLED BY:
	FF_SUMMARY, MAKE_SMEI_ARG, MAKE_SMEI_OP, MAKE_SMEI_OPF, PARSE_OP, PARSE_OP_TOKEN
	READ_SMEI_OP, RESTORE_SEQUENCE, SMEI_ADD_IMAGE, SMEI_CALCULATE, SMEI_CALC_MENU
	SMEI_CHOOSE_SOP, SMEI_COLOUR, SMEI_COMPACT, SMEI_DELAY, SMEI_DELETE_IMAGE
	SMEI_DOCS, SMEI_IMAGE, SMEI_IMAGE_HEADER, SMEI_IMAGE_IMAGE, SMEI_IMAGE_INFO
	SMEI_IMAGE_MOVE, SMEI_IMAGE_PRINT, SMEI_JOIN, SMEI_MENU, SMEI_MOVIE
	SMEI_NULL_INDEX, SMEI_OPTS, SMEI_PRINT, SMEI_PROFILE, SMEI_RANGE, SMEI_RESTORE
	SMEI_SAVE, SMEI_SEQUENCE, SMEI_SEQ_INFO, SMEI_SHOW, SMEI_SUBTRACT_MODEL, SMEI_ZOOM
	norm_time
 History:
	Temporary Version: 18/11/99; SJT
	Use dialog_message: 2/12/99; SJT
	Rewrote to use the message panel on the TLM: 11/7/00; SJT
	Added alert keyword: 21/2/01; SJT
	Add dialog keys and remove common block: 22/2/01; SJT
	Prevent duplication of alert and error level messages:
	19/6/01; SJT


SMEI_NULL_INDEX $SSW/smei/bham/idl/cli/smei_null_index.pro
[Previous] [Next]
 NAME:
	SMEI_NULL_INDEX


 PURPOSE:
	To set the colour index/indices to use for missing data.


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_null_index, seqref, index[, /screen|/print]


 INPUTS:
	seqref	objref	Object reference to the sequence.
	index	byte	The colour index to use (or a 2-element list).


 KEYWORD PARAMETERS:
	/screen		If set, then only set the index for screen displays.
	/print		If set, then only set the index for printouts.
	/off_sky	If set, then set the value to use for
			points outside the sky area


 CALLS: ***
	self_help, smei_msg
 MODIFICATION HISTORY:
	Original: 11/7/03; SJT
	Separate in and out of sky: 18/7/03; SJT


SMEI_OPERATOR__DEFINE $SSW/smei/bham/idl/smei_operator/smei_operator__define.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR__DEFINE


 PURPOSE:
	To define the structure of a smei operator.


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	<implicit>


 ELEMENTS:
 	operator	string	The operator or function to apply.
 	class		int	The class of operator (function or op
 				etc.) this is a convenience as it can
 				be determined from the rest of the
 				elements.
 	arg_count	int	How many arguments.
 	arglist		pointer	A pointer to a list of arguments for
 				the operator
 	extras		ptr	A pointer to any keywords (function
 				ops only).
	array_count	int	The number of elements returned by
				any array returning arguments.
	sequence	objref	The generated sequence.		
 	is_cumulative	byte	A flag to indicate if the operator
 				returns a sequence or an image.

 MODIFICATION HISTORY:
	Original (this version is a clean-sheet rethink of the whole
	operations system): 22/10/03; SJT


SMEI_OPERATOR_ARGUMENT__DEFINE $SSW/smei/bham/idl/smei_operator/smei_operator_argument/smei_operator_argument__define.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR_ARGUMENT__DEFINE


 PURPOSE:
	Structure definition for an argument to a smei operator 


 CATEGORY:
	SMEI_OPERATOR_ARGUMENT


 CALLING SEQUENCE:
	<implicit>


 ELEMENTS:
	value		pointer	One of (a) a smei_sequence, (b) a smei_image
				(c) a smei operator or (d) a regular numeric
				value which will be used in the operation.
	class		int	A flag to indicate which of the above it is.
				1 = sequence
				2 = image
				3 = operator
				4 = number
	plane		int	Which plane of the image to use. (sequences
				and images).
	range		int[3]	Start image, stop image and stride (sequences
				only)
	transient 	byte	Whether this arg has been created
				transiently, used by the interpreters
				to flag that it should be deteted with
				its operator

 MODIFICATION HISTORY:
	Original: 22/10/03; SJT
	Added transient flag: 5/11/03; SJT


SMEI_OPERATOR_ARGUMENTCLEANUP $SSW/smei/bham/idl/smei_operator/smei_operator_argument/smei_operator_argument__cleanup.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR_ARGUMENT::CLEANUP


 PURPOSE:
	Destructor for a smei operator argument


 CATEGORY:
	SMEI_OPERATOR_ARGUMENT


 CALLING SEQUENCE:
	obj_destroy, soparg


 INPUTS:
	soparg	objref	The object to be destroyed


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT


SMEI_OPERATOR_ARGUMENTEVAL $SSW/smei/bham/idl/smei_operator/smei_operator_argument/smei_operator_argument__eval.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR_ARGUMENT::EVAL


 PURPOSE:
	Return the value from a smei operator argument


 CATEGORY:
	SMEI_OPERATOR_ARGUMENT


 CALLING SEQUENCE:
	value = arg->eval(index)


 INPUTS:
	index	int	Which element of the value is needed.


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT
	Handle different dimensionalities of numericals:6/11/03; SJT


SMEI_OPERATOR_ARGUMENTGET_CLASS $SSW/smei/bham/idl/smei_operator/smei_operator_argument/smei_operator_argument__get_class.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR_ARGUMENT::GET_CLASS


 PURPOSE:
	Return the class of argument that this is.


 CATEGORY:
	SMEI_OPERATOR_ARGUMENT


 CALLING SEQUENCE:
	class = arg -> get_class()


 OUTPUTS:
	class	int	The class of argument that this is


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT


SMEI_OPERATOR_ARGUMENTGET_COUNT $SSW/smei/bham/idl/smei_operator/smei_operator_argument/smei_operator_argument__get_count.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR_ARGUMENT::GET_COUNT


 PURPOSE:
	Return how many values will be generated by evaluating the
	argument.


 CATEGORY:
	SMEI_OPERATOR_ARGUMENT


 CALLING SEQUENCE:
	count = arg -> get_count()


 OUTPUTS:
	count	int	The number of elements generated by the
			evaluation.


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT
	Use get_range method for class=1: 31/10/03; SJT
	Handle different dimensionalities of numericals:6/11/03; SJT


SMEI_OPERATOR_ARGUMENTGET_IMAGE $SSW/smei/bham/idl/smei_operator/smei_operator_argument/smei_operator_argument__get_image.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR_ARGUMENT::GET_IMAGE


 PURPOSE:
	Return a smei image from a smei operator argument


 CATEGORY:
	SMEI_OPERATOR_ARGUMENT


 CALLING SEQUENCE:
	value = arg->get_image(index)


 INPUTS:
	index	int	Which element of the value is needed.


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT
	Handle different dimensionalities of numericals:6/11/03; SJT


SMEI_OPERATOR_ARGUMENTGET_PLANE $SSW/smei/bham/idl/smei_operator/smei_operator_argument/smei_operator_argument__get_plane.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR_ARGUMENT::GET_PLANE


 PURPOSE:
	Return how many values will be generated by evaluating the
	argument.


 CATEGORY:
	SMEI_OPERATOR_ARGUMENT


 CALLING SEQUENCE:
	plane = arg -> get_plane()


 OUTPUTS:
	plane	int	The image plane to use (for images and sequences)


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT


SMEI_OPERATOR_ARGUMENTGET_RANGE $SSW/smei/bham/idl/smei_operator/smei_operator_argument/smei_operator_argument__get_range.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR_ARGUMENT::GET_RANGE


 PURPOSE:
	Return how many values will be generated by evaluating the
	argument.


 CATEGORY:
	SMEI_OPERATOR_ARGUMENT


 CALLING SEQUENCE:
	range = arg -> get_range()


 KEYWORD PARAMETERS:
	/start	If set, then return only the initial image number
	/stop	If set, then return only the final image number
	/step	If set, then return only the step between images.

 OUTPUTS:
	range	int	The image range to use (for sequences)


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT
	Allow limit on sequences to be negative (count from end):
	31/10/03; SJT


SMEI_OPERATOR_ARGUMENTGET_SIZE $SSW/smei/bham/idl/smei_operator/smei_operator_argument/smei_operator_argument__get_size.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR_ARGUMENT::GET_SIZE


 PURPOSE:
	Return the effective size of a smei operator argument


 CATEGORY:
	SMEI_OPERATORE_ARGUMENT


 CALLING SEQUENCE:
	size = argref->get_size()


 OUTPUTS:
	size	int/lng	The size of the argument image


 MODIFICATION HISTORY:
	Original: 19/2/04; SJT


SMEI_OPERATOR_ARGUMENTGET_TRANSIENT $SSW/smei/bham/idl/smei_operator/smei_operator_argument/smei_operator_argument__get_transient.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR_ARGUMENT::GET_TRANSIENT


 PURPOSE:
	Return whether this object was transiently created or not.


 CATEGORY:
	SMEI_OPERATOR_ARGUMENT


 CALLING SEQUENCE:
	transient = arg -> get_transient()


 OUTPUTS:
	transient	byte	Whether the object is "transient".


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT


SMEI_OPERATOR_ARGUMENTGET_VALUE $SSW/smei/bham/idl/smei_operator/smei_operator_argument/smei_operator_argument__get_value.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR_ARGUMENT::GET_VALUE


 PURPOSE:
	Return the value wrapped by the operator argument


 CATEGORY:
	SMEI_OPERATOR_ARGUMENT


 CALLING SEQUENCE:
	val = argref -> get_value()


 OUTPUTS:
	val	obj/num	The valeu which the object wraps.


 MODIFICATION HISTORY:
	Original: 31/10/03; SJT


SMEI_OPERATOR_ARGUMENTINIT $SSW/smei/bham/idl/smei_operator/smei_operator_argument/smei_operator_argument__init.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR_ARGUMENT::INIT


 PURPOSE:
	Constructor for a smei operator argument


 CATEGORY:
	SMEI_OPERATOR_ARGUMENT


 CALLING SEQUENCE:
	arg = obj_new('SMEI_OPERATOR_ARGUMENT', value, [plane, [range]])


 INPUTS:
	value	various	The value to be used, this can be a regular
			numerical value, a SMEI_SEQUENCE, a
			SMEI_IMAGE or a SMEI_OPERATOR.


 OPTIONAL INPUTS:
	plane	int	The image plane to extract from smei_images
			(only applicable for images or sequences)
	range	int[3]	A 3-element array indicating which images of a
			sequence to use (only applicable to
			sequences). A stride of zero is equivalent to
			a stride of 1 (however negative strides are
			meaningful).
	/transient	If set, then this object was created by an
			interpreter and should be deleted with the
			operator that it is attached to. N.B. there is
			nothing to prevent you abusing this.


 OUTPUT:
	arg	objref	The SMEI_OPERATOR_ARGUMENT object reference
			generated. 

 MODIFICATION HISTORY:
	Original: 22/10/03; SJT
	Added transient flag: 5/11/03; SJT
	Handle different dimensionalities of numericals:6/11/03; SJT


SMEI_OPERATORCLEANUP $SSW/smei/bham/idl/smei_operator/smei_operator__cleanup.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::CLEANUP


 PURPOSE:
	Destructor for a smei operator


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	obj_destroy, sop


 INPUTS:
	sop	objref	The object to be destroyed


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT
	Delete transient arguments: 5/11/03; SJT


SMEI_OPERATORCOMPUTE $SSW/smei/bham/idl/smei_operator/smei_operator__compute.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::COMPUTE


 PURPOSE:
	Generate a SMEI_SEQUENCE from an operator.


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	sop -> compute


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT
	Get times etc. from first multi-image sequence if available:
	4/11/03; SJT
	Pass filename of "dominant" file down: 1/12/03; SJT
	Add %median operator: 19/2/04; SJT


SMEI_OPERATORCOMPUTE_AVERAGE $SSW/smei/bham/idl/smei_operator/smei_operator__compute_average.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::COMPUTE_AVERAGE


 PURPOSE:
	Evaluate the %mean operation on a SMEI_OPERATOR


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	sop -> compute_average


 MODIFICATION HISTORY:
	Original: 23/10/03; SJT
	Pass projection information: 13/2/04; SJT


SMEI_OPERATORCOMPUTE_MAX $SSW/smei/bham/idl/smei_operator/smei_operator__compute_max.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::COMPUTE_MAX


 PURPOSE:
	Evaluate the %max operation on a SMEI_OPERATOR


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	sop -> compute_max


 MODIFICATION HISTORY:
	Original: 23/10/03; SJT
	Pass projection information: 13/2/04; SJT


SMEI_OPERATORCOMPUTE_MEDIAN $SSW/smei/bham/idl/smei_operator/smei_operator__compute_median.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::COMPUTE_MEDIAN


 PURPOSE:
	Evaluate the %median operation on a SMEI_OPERATOR


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	sop -> compute_median


 RESTRICTIONS:
	This is likely to run out of memory for big sequences.


 MODIFICATION HISTORY:
	Original (after compute_average): 19/2/04; SJT


SMEI_OPERATORCOMPUTE_MIN $SSW/smei/bham/idl/smei_operator/smei_operator__compute_min.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::COMPUTE_MIN


 PURPOSE:
	Evaluate the %min operation on a SMEI_OPERATOR


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	sop -> compute_min


 MODIFICATION HISTORY:
	Original: 23/10/03; SJT
	Pass projection information: 13/2/04; SJT


SMEI_OPERATORCOMPUTE_SUM $SSW/smei/bham/idl/smei_operator/smei_operator__compute_sum.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::COMPUTE_SUM


 PURPOSE:
	Evaluate the %sum operation on a SMEI_OPERATOR


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	sop -> compute_sum


 MODIFICATION HISTORY:
	Original: 23/10/03; SJT
	Pass projection information: 13/2/04; SJT


SMEI_OPERATORCONCATENATE $SSW/smei/bham/idl/smei_operator/smei_operator__concatenate.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::CONCATENATE


 PURPOSE:
	Evaluate the %cat operation on a SMEI_OPERATOR


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	sop -> concatenate


 MODIFICATION HISTORY:
	Original: 5/11/03; SJT


SMEI_OPERATOREVAL $SSW/smei/bham/idl/smei_operator/smei_operator__eval.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::EVAL


 PURPOSE:
	Return a value from a SMEI operator.


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	value = sop -> eval(index)


 INPUTS:
	index	int	The index of the value to return.


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT


SMEI_OPERATORGET_ARG_COUNT $SSW/smei/bham/idl/smei_operator/smei_operator__get_arg_count.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::GET_ARG_COUNT


 PURPOSE:
	To return the number of arguments of a smei operator


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	count = sop -> get_arg_count()


 OUTPUTS:
	count	int	The number of arguments to the operator.


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT


SMEI_OPERATORGET_ARGUMENT $SSW/smei/bham/idl/smei_operator/smei_operator__get_argument.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::GET_ARGUMENT


 PURPOSE:
	To return an argument of the operator


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	argument = sop -> get_argument(index)


 INPUTS:
	index	int	Which argument is required.

 OUTPUTS:
	argument	objref	The operator's argument


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT


SMEI_OPERATORGET_CLASS $SSW/smei/bham/idl/smei_operator/smei_operator__get_class.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::GET_CLASS


 PURPOSE:
	To return the operator class.


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	class = sop -> get_class()


 OUTPUTS:
	class	int	The operator's class.


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT


SMEI_OPERATORGET_COUNT $SSW/smei/bham/idl/smei_operator/smei_operator__get_count.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::GET_COUNT


 PURPOSE:
	To return the length of sequence that will be returned by
	evaluating the operator.


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	count = sop -> get_count()


 OUTPUTS:
	count	int	The length of the sequence that will be
			returned by evaluating the operator


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT


SMEI_OPERATORGET_OPERATOR $SSW/smei/bham/idl/smei_operator/smei_operator__get_operator.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::GET_OPERATOR


 PURPOSE:
	To return the operator operator.


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	operator = sop -> get_operator()


 OUTPUTS:
	operator	string	The operator's operator.


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT


SMEI_OPERATORGET_SEQUENCE $SSW/smei/bham/idl/smei_operator/smei_operator__get_sequence.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::GET_SEQUENCE


 PURPOSE:
	Return the SMEI sequence generated by the operator


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	seqref = sop -> get_sequence()


 KEYWORD PARAMETERS:
	/destroy	If set, then the operator will be destroyed
			before returning.


 OUTPUTS:
	seqref	objref	The sequence object reference


 MODIFICATION HISTORY:
	Original: 23/10/03; SJT


SMEI_OPERATORINIT $SSW/smei/bham/idl/smei_operator/smei_operator__init.pro
[Previous] [Next]
 NAME:
	SMEI_OPERATOR::INIT


 PURPOSE:
	Constructor method for a SMEI operator.


 CATEGORY:
	SMEI_OPERATOR


 CALLING SEQUENCE:
	sop = obj_new('SMEI_OPERATOR', op, arglist)


 INPUTS:
	op	string	The operator (or function) to apply
	arglist	obj	An array of SMEI_OPERATOR_ARGUMENT objects.


 KEYWORD PARAMETERS:
	If the operator is a function, then any keywords to the
	function are accepted.

 OUTPUTS:
	sop	The SMEI_OPERATOR object generated.


 MODIFICATION HISTORY:
	Original: 22/10/03; SJT
	Add median special OP, and correct flagging in %cat: 19/02/04;
	SJT


SMEI_OPTS $SSW/smei/bham/idl/cli/smei_opts.pro
[Previous] [Next]
 NAME:
	SMEI_OPTS


 PURPOSE:
	Set plotting annotation and printing options.


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_opts, seqref[, <option keys>]


 INPUTS:
	seqref	objref	Object reference of a SMEI sequence


 KEYWORD PARAMETERS:
	grid	int	Which type of coordinate grid.
	date	int	Specify date format (0=none, 1=Year-Day, 2=Y-M-D)
	range	bool	Whether to add the data dange
	file	bool	Whether to add the filename.
	
	columns	int	Set the number of columns in the layout
	rows	int	Set the number of rows in the layout.
	order	bool	Set the order in which the images are to be
			printed 
	type	int	Set the type of postscript file to generate
			(0=landscape, 1 = portrait, 2 = eps)
	plot_file string Set the filename to use for the output.
	xsize	float	Set the x-size of the printed area
	ysize	float	Set the y-size of the printed area.
	print	string	Set the printing command
	preview	string	Set the preview command.


 CALLS: ***
	self_help, smei_msg
 MODIFICATION HISTORY:
	Original: 18/12/02; SJT
	Redocument grid keyword: 19/6/03; SJT
	Add printing options: 6/6/05; SJT


smei_orbit_get $SSW/smei/ucsd/camera/idl/toolbox/smei_orbit_get.pro
[Previous] [Next]
 NAME:
	smei_orbit_get
 PURPOSE:
	Extracts fields from orbit structure
 CATEGORY:
	camera/gen/idl/toolbox
 CALLING SEQUENCE:
	FUNCTION smei_orbit_get, orb, number=number, fraction=fraction, doublex=doublex
 INPUTS:
	orb			array; type: orbit structure
					orbit structure as created by smei_orbit_set
 OPTIONAL INPUTS:
	/number 	extract integer orbit number
	/fraction	extract double precison fraction
	/doublex	extract orbit as double precision number, i.e. the
				sum of number and fraction part. Note that this number
				looses precision pretty quick for high orbit numbers.
 OUTPUTS:
	rtn 		scalar or array
					integer orbit number of double precision
					fraction depending on setting of /number
					or /fraction
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar
 CALLED BY:
	smei_coriolis, smei_orbits_stat
 PROCEDURE:
 MODIFICATION HISTORY:
	JAN-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_orbit_set $SSW/smei/ucsd/camera/idl/toolbox/smei_orbit_set.pro
[Previous] [Next]
 NAME:
	smei_orbit_set
 PURPOSE:
	Creates structure for manipulating SMEI orbit numbers
 CATEGORY:
	camera/gen/idl/toolbox
 CALLING SEQUENCE:
	rtn = smei_orbit_set(number, [fraction])
 INPUTS:
	number			scalar or array; any numerical type
	fraction		scalar or array; any numerical type
						number and fraction are added together
						and put in the structure
 OUTPUTS:
	rtn 			array; type: orbit structure
						rtn.number is integer orbit number
						rtn.fraction is double precision orbital fraction
							with 0 <= fraction < 1
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	IsType
 CALLED BY:
	smei_coriolis
 PROCEDURE:
 MODIFICATION HISTORY:
	JAN-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_orbits_stat $SSW/smei/ucsd/camera/idl/toolbox/smei_orbits_stat.pro
[Previous] [Next]
 NAME:
	smei_orbits_stat
 PURPOSE:
	Extracts information about frame counts and state changes from
	the SMEI data base. The information is stored in ASCII files.
 CATEGORY:
	camera/idl/toolbox
 CALLING SEQUENCE:
	PRO smei_orbits_stat, trange, destination=destination, update=update,	$
		state_changes=state_changes, camera=camera, mode=mode,		 	$
		ndoy_lag=ndoy_lag, silent=silent, source=source,				$
		tnow=tnow, usedb=usedb
 INPUTS:
	trange
 OPTIONAL INPUT PARAMETERS:
	/state_changes	if NOT set then frame counts are made only.
					if SET then a log of state changes over time is made

	/update 		/update is ignored if trange is set.
					if set then the existing ASCII files are updated

	source=source	scalar; type: string; default: SMEIDB?
					specifies the location of the SMEI data base
					(passed to smei_getfile).
	destination=destination
					scalar; type: string
					destination directory for the ASCII data base
					files.
					/update NOT: default: $TEMP
					/update SET: default: $SSWDB_SMEI/cat/list

	camera=camera	scalar or array[2]; type: integer; default: [1,3]
					ignored if /state_changes is NOT set
					create/update state changes for specified cameras only

	mode=mode		scalar; type: integer
					ignored if /state_changes is SET
					if set the frame counts are for the specified mode
					only (by default all three modes are combined)

	tnow=tnow		array[1]; type: time structure; default: TimeSystem()
					ignored when /state_changes is set
					sets the end time when /update is set

	ndoy_lag		scalar; type: integer; default: -3
					sets overlap with existing ASCII files when /update
					is set (i.e. the last ndoy_lag days in the ASCII
					files is redone).

	/usedb			by default the header data base is used.
					If /usedb is set the frame data base is used
					(this takes a lot longer) 
	silent=silent	scalar; type: integer; default: 0
					controls level of informational messages
 OUTPUTS:
	(to ASCII files; see PROCEDURE)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CheckDir, FILEPATH, InitVar, IsType, REVERSE, SMEI_ORBITS_BAD, TimeGet, TimeOp, TimeSet
	TimeString, TimeSystem, TimeUnit, boost, destroyvar, do_file, flt_string
	smei_coriolis, smei_frm_property, smei_getfile, smei_hdr_get, smei_orbit_get
	smei_time, smeidb_mounted, txt_read
 PROCEDURE:
	/state_changes NOT set (i.e. frame counts only)
		if no mode is specified then create/update files
			destination/smei_frm_day.txt and destination/smei_frm_orb.txt
		if mode is specified then create/update files
			destination/smei_frm_day_m#.txt and destination/smei_frm_orb_m#.txt
			(where # is 0,1,2)

	/state_changes SET (i.e. state changes only)
		create/update files destination/smei_state_cam#.txt'
		where # is 1,2,3
 MODIFICATION HISTORY:
	SEP-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_orient_test $SSW/smei/ucsd/camera/idl/toolbox/smei_orient_test.pro
[Previous] [Next]
 NAME:
	smei_orient_test
 PURPOSE:
	Check orientation of cameras
 CATEGORY:
	camera/idl/tricks
 CALLING SEQUENCE:
	smei_orient_test
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	AngleRange, CombineRotations, CvRotation, HAFB_GET_CAMERA_DATA, WhatIs
 RESTRICTIONS:
	Probably need to compile smeipoint.pro explicitly to get access to
	Don's get_camera_data
 SEE ALSO:
	smei_camera
 PROCEDURE:
	The UCSD s/c coordinate system:
		X-axis along velocity vector
		Y-axis along rotation axis spacecraft
		Z-axis to zenith
	The HAFB s/c coordinate system (as in Don's smeipoint.pro routine):
		X-axis along velocity vector
		Y-axis opposite to rotation axis spacecraft
		Z-axis pointing to nadir (i.e. down to Earth)

	To go from UCSD to HAFB s/c coordinate system, rotate around
	x-axis by 180 degrees:
		R[sc UCSD -> s/c HAFB]: Euler angles: [0,!pi,!pi]; quaternion: [1,0,0,0].

	The UCSD camera coordinate system:
		X-axis along long dimension (on CCD positive X goes to larger pixel indices)
		Y-axis along narrow dimension (on CCD positive Y goes to smaller radius)
		Z-axis along optical axis
	The HAFB camera coordinate system (as in Don's smeipoint.pro routine):
		X-axis is UCSD Z-axis (along optical axis)
		Z-axis is UCSD Y-axis
		Y-axis is UCSD X-axis

	To go from HAFB to UCSD camera coordinate system, apply
	Euler angles:
		R[camera HAFB -> camera UCSD]:   [0,!pi/2,!pi/2]; quaternion: [1,1,1,1]/2.
	(this is a rotation of 120 degrees around a unit vector with equal components
	along positive x,y and z axes).

	The Euler angles provided to Spectrum Astro rotate from the UCSD
	s/c coordinate system to the UCSD camera coordinate system.
		R[sc UCSD -> camera UCSD]
	The Euler angles provided to Spectrum Astro apply rotations to Z,X and
	Z axes. We want Euler angles applied to Z,Y,Z axes. To go from Z,Y,Z angles
	to Z,X,Z angles add 90 deg to the first and subtract 90 deg from the
	last Euler angle.

	The HAFB camera quaternions rotate from the HAFB camera coordinate
	system to the HAFB s/c coordinate system.

		R[camera HAFB -> sc HAFB]

	To retrieve the equivalent Spectrum Astro angles from the HAFB quaternions
	apply the following rotations in sequence:

		R[sc UCSD -> s/c HAFB]						quaternion [1,0,0,0]
		Inverse of R[camera HAFB -> sc HAFB]		(inverse of smeipoint quaternion)
		R[camera HAFB -> camera UCSD]   			quaternion: [1,1,1,1]/2.
		Convert the resulting quaternion to Z,Y,Z angles, i.e.
			add 90 to first and -90 to third to get Z,X,Z angles:

	The Euler angles given to Spectrum Astro are:

	camera 1:  -28.207646       69.541377      -21.4776600
	camera 2:  -86.023031       58.285313       -6.5798011
	camera 3: -143.782150       62.553932        0.3674422

	We frequently need to convert from equatorial coordinates to UCSD
	camera coordinates. The quaternions provided to us in the SMEI data
	rotate from the ECI (J2000 equatorial) to the HAFB s/c frame.
	So to go from UCSD camera frame to the ECI frame apply the following
	rotations

		R[camera UCSD -> camera HAFB]			quaternion [-1,-1,-1,1/2
		R[camera HAFB -> s/c HAFB]				(from smeipoint)
		Inverse of R[sc HAFB -> ECI]			(inverse of quaternion from SMEI data)

	The first two of these (rotating from UCSD camera to HAFB s/c frame)
	is returned by smei_camera. The inverse of all three combined
	rotations is returned by smei_cam_quaternion.
 MODIFICATION HISTORY:
	MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_pick_stars $SSW/smei/ucsd/camera/idl/tmo/smei_pick_stars.pro
[Previous] [Next]
 NAME:
	smei_pick_stars
 PURPOSE:
	Select stars to be used for frame registration
 CATEGORY:
	camera/idl
 CALLING SEQUENCE:
	FUNCTION smei_pick_stars, pp, mag, dmin=dmin, magmax=magmax, count=count
 INPUTS:
	pp				array[2,*]; type: float
						x,y pixel coordinates
 OPTIONAL INPUT PARAMETERS:
	dmin=dmin		only entries at least dmin pixels
					removed from the nearest neighbour are put in 'list'
	magmax=magmax	only entries with magnitudes less then magmax
					are put in 'list'
 OUTPUTS:
	pp				array[2,*]; type: float
						subset of input for stars fitting criterion
						pp will not exist on return if no stars fit.
	list			array; type: integer
						list of stars fitting the criterion
						If no stars fit then list = -1 is returned
 OPTIONAL OUTPUT PARAMETERS:
	count=count 	scalar; type: integer
					# stars in 'list'
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	IsType
 PROCEDURE:
 MODIFICATION HISTORY:
	FEB-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


SMEI_PRINT $SSW/smei/bham/idl/cli/smei_print.pro
[Previous] [Next]
 NAME:
	SMEI_PRINT


 PURPOSE:
	Send a SMEI sequence to a PostScript file


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_print, seqref


 INPUTS:
	seqref	objref	Object reference to the SMEI sequence to print.


 KEYWORD PARAMETERS:
	/grid		If specfied, then add a grid to the images
	/nodate		If specified, then do not add the date and
			time range of the images
	/file		If specified, then add the filename to the
			images.
	/add_range	If set, then add the range to the plot.
	range	float	The min and max values for the display
			(implies adding the range to the plot)
	colour_table int The colour table to use. (-1 or unset to use
			the sequence map)
	xsize	float	The size in cm of the x-dimension of the page
	ysize	float	The size in cm of the y-dimension of the page
	/no_colour	Do not generate colour PS (equivalent to
			colour_table=0)
	/portrait	Print in portrait mode (default is landscape).
	plot_file str	Specify a filename other than the default idl.ps
	/encapsulated	If set, then make an eps file (handled
			explicitly as other things are done
			differently for eps).
	ncolumns int	The number of columns to arrange the images
	nrows	int	The number of rows to arrange the images
	/logarithmic	If set, then use a logarithmic mapping of the
			colour table.
	/in_rows	If set, then go arrange the frames in rows
			rather than in columns.

	Any keywords to DEVICE that do not clash with the above and
	which are accepted by the PS device may be passed.

 CALLS: ***
	self_help, smei_msg
 SIDE EFFECTS:
	A PostScript file is generated.


 RESTRICTIONS:
	Pro-tem it doesn't print the file.


 MODIFICATION HISTORY:
	Original: 16/5/03; SJT
	Add row orientation: 21/7/03; SJT


SMEI_PROFILE $SSW/smei/bham/idl/cli/smei_profile.pro
[Previous] [Next]
 NAME:
	SMEI_PROFILE


 PURPOSE:
	Generate a profile from a SMEI sequence


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_profile, seqref, npa, nel, pmin, pmax, profile[, pa, $
		elong, date]


 INPUTS:
	seqref	objref	The smei_sequence object from which to get the
			profile 
	npa	int	The number of bins in the position-angle
			direction 
	nel	int	The number of bins in the elongation direction
	pmin	float	The lower limit of position angle or
			elongation (circumferential profiles)
	pmax	float	The upper limit of position angle or
			elongation (circumferential profiles)


 KEYWORD PARAMETERS:
	/circumferential	If set, then make a circumferential
				rather than a radial profile.
	/verbose		If set, then show the region being profiled.
	save	string	input	A filename to which to save the
				profile and its axes.
	plane	int	input	The image plane to use (0 for
				processed, 1-n for raw planes).


 OUTPUTS:
	profile	float	The profile generated (indices are [pa,
			elongation, image])

 OPTIONAL OUTPUTS:
	pa	float	The midpoints of the bins in position angle
	elong	float	The midpoints of the bins in elongation.
	date	double	The Julian dates of the start and end of each
			image.

 CALLS: ***
	self_help, smei_msg
 MODIFICATION HISTORY:
	Original: 15/12/03; SJT
	Added plane keyword: 13/1/04; SJT


smei_query $SSW/smei/bham/idl/utils/smei_query.pro
[Previous] [Next]
 smei_query
	Get a Yes/No answer to a question

 Usage:
	ireply = smei_query(message)

 Arguments:
 	message	string	The message to be displayed.

 Keywords:
	dialog_parent	long	Optional "parent" for the dialogue.

 Other keys used by dialog_message can also be passed (they will of
 course be ignored if no pop-up is generated).
 
 CALLED BY:
	SMEI_DELETE_IMAGE
 History:
	original: 20/12/99; SJT
	Support dialog_message keywords: 22/2/01; SJT


smei_radial2theta $SSW/smei/ucsd/camera/idl/toolbox/smei_radial2theta.pro
[Previous] [Next]
 NAME:
	smei_radial2theta
 PURPOSE:
	Converts a radial offset Rccd-R0 to an angle thetay
 CATEGORY:
	camera
 CALLING SEQUENCE:
	thetay = smei_radial2theta(delta_r[, thetax, tol=tol])
 INPUTS:
	delta_r 	array; type: float
					radial offsets in left-hand side of Eq. 3
					in pixels
 OPTIONAL INPUT PARAMETERS:
	thetax		scalar or array with structure type as 'delta_r';
				type: same as 'delta_r'; default: 0.0
					thetax value in right-hand side of Eq. 3
					in degrees
 OUTPUTS:
	thetay		array with same structure as 'delta_r'; type: same as 'delta_r'
					thetay value that satisfies Eq. 3 for specified
					radial offset and thetax in degrees.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
	smei_theta2radial
 CALLS: ***
	InitVar, SubArray, SuperArray, nrZBrent, nrZbrac
 CALLED BY:
	smei_ccd2sky, smei_cv
 PROCEDURE:
	See Andy's memo "Defining the field of view for the SMEI cameras" (11-July-2001)
	This function inverts Equation 3.
 MODIFICATION HISTORY:
	FEB-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


SMEI_RANGE $SSW/smei/bham/idl/cli/smei_range.pro
[Previous] [Next]
 NAME:
	SMEI_RANGE


 PURPOSE:
	Set the data range of a SMEI sequence


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_range, seqref, range[, range1]


 INPUTS:
	seqref	objref	Object reference to the sequence.
	range	float	2-element array giving a min to max data
			range, or a scalar giving the minimum.


 OPTIONAL INPUTS:
	range1	float	The maximum of the data range if RANGE is a
			scalar

 KEYWORD PARAMETERS:
	logarithmic	int	Whether to use logarithmic scaling or not.
	kill		float	Set a range of values outside which
				data are considered bad (2-element
				array or a scalar == [-kill, kill])

 CALLS: ***
	self_help, smei_msg
 MODIFICATION HISTORY:
	Original: 19/12/02; SJT
	Add logarithmic and kill keywords: 30/3/04; SJT


SMEI_RESTORE $SSW/smei/bham/idl/cli/smei_restore.pro
[Previous] [Next]
 NAME:
	SMEI_RESTORE


 PURPOSE:
	Restores a SMEI sequence from a save file and clears anything
	that would have been lost.


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_restore, seqref, file


 OPTIONAL INPUTS:
	file	string	The IDL SAVE file from which to restore, if
			not given then a dialogue box is used to
			select.


 KEYWORD PARAMETERS:
	/menu	If set, then go straight into the menu.


 OUTPUTS:
	seqref	objref	The object reference of the restored smei
			sequence. (optional iff /menu is given).


 CALLS: ***
	SMEI_IMAGE__DEFINE, SMEI_SEQUENCE__DEFINE, self_help, smei_msg
 CALLED BY:
	RESTORE_SEQUENCE
 MODIFICATION HISTORY:
	Original: 17/12/02; SJT
	Add calls to structure definers to ensure latest are used:
	18/12/02; SJT
	Renamed as SMEI_RESTORE: 9/8/04; SJT


smei_roi_mask $SSW/smei/ucsd/camera/idl/buf/smei_roi_mask.pro
[Previous] [Next]
 NAME:
	smei_roi_mask
 PURPOSE:
	Common block definition with ROI information
 CATEGORY:
	camera/idl/buf
 CALLING SEQUENCE:
	@smei_roi_mask.pro
 INPUTS:
	From text file smei_buf_roi.txt
 OUTPUTS:
	Stored in common block
 CALLS:
	smei_setup_roi, who_am_i
 MODIFICATION HISTORY:
	APR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


SMEI_SAVE $SSW/smei/bham/idl/cli/smei_save.pro
[Previous] [Next]
 NAME:
	SMEI_SAVE


 PURPOSE:
	Save a SMEI sequence to an IDL SAVE file.


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_save, seqref, file


 INPUTS:
	seqref	objref	The SMEI sequence to save.
	file	string	The file to which to save.


 CALLS: ***
	self_help, smei_msg
 MODIFICATION HISTORY:
	Original: 18/12/02; SJT


SMEI_SEQ_INFO $SSW/smei/bham/idl/cli/smei_seq_info.pro
[Previous] [Next]
 NAME:
	SMEI_SEQ_INFO


 PURPOSE:
	Return various information about a SMEI_SEQUENCE


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_seq_info, source, info, <selector keys>


 INPUTS:
	source	objref	The sequence to be queried


 KEYWORD PARAMETERS:
	/count		If set, then return the number of images in the
			sequence.
	/name		If set, then return the user-defined name of the
			sequence.
	/n_planes	If set, then return the number of planes in the
			image.
	/size		If set, then return the size of the biggest
			image in the sequence.
	/summary	If set, then return a summary of the sequence.

 OUTPUTS:
	info	various	A named variable to hold the requested
			information.


 CALLS: ***
	self_help, smei_msg
 RESTRICTIONS:
	The selector keywords are mutually exclusive


 MODIFICATION HISTORY:
	Original: 20/1/04; SJT


SMEI_SEQUENCE $SSW/smei/bham/idl/cli/smei_sequence.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE


 PURPOSE:
	Generate a SMEI sequence object


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_sequence, seqref, files[, name=name]
	or
	smei_sequence, seqref, start, stop[, name=name]
	or
	smei_sequence, seqref, /menu[, name=name]
	

 INPUTS:
	files	string	List of files or wildcards specifying the
			files to build into the sequence (optional if
			menu is requested).
	start	dbl/int	Either a scalar JD of the start or an array with
			[y,d,h,m,s]. N.B. even if only the year is to
			be given it must be an array (e.g. [2003]
			rather than 2003)
	stop	dbl/int	Either a scalar JD of the end point or an array with
			[y,d,h,m,s]. N.B. even if only the year is to
			be given it must be an array (e.g. [2003]
			rather than 2003)

 KEYWORD PARAMETERS:
	name	string	A name to give to the sequence
	/show		If set, then go ahead and show the sequence.
	/compact	If set, then compact the images.
	/menu		If set, then use a GUI to set options
	/aitoff		If set, then use aitoff projections only (only
			applicable if a time range is given).
	/fisheye	If set, then use fisheye projections only (only
			applicable if a time range is given).
	/nostop		If set, then don't stop if no images are
			found (useful for batch operation). It will
			still stop on bad inputs.


 OUTPUTS:
	seqref	objref	The object reference of the sequence


 CALLS: ***
	FF_SUMMARY, doy2jd, self_help, smei_msg
 RESTRICTIONS:
	Will later aquire a GUI and ways of setting time bounds


 MODIFICATION HISTORY:
	Original: 11/12/02; SJT
	Add compact & menu: 13/12/02; SJT
	Check the we're not overwiting an existing object: 19/12/02;
	SJT
	Add support for aitoff & fisheye projections: 18/2/04; SJT
	Include images starting up to 1 orbit before the given start
	time: 12/10/06; SJT


SMEI_SEQUENCE__DEFINE $SSW/smei/bham/idl/smei_sequence/smei_sequence__define.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE__DEFINE


 PURPOSE:
	Object definition of a SMEI image sequence


 CATEGORY:
	SMEI_SEQUENCE


 FIELDS:
	name		string	An arbitrary name to label the sequence
	first_image	objref	A reference to the first object of the
				sequence.
	last_image	objref	A reference to the final object of the
				sequence.
	n_image		long	The number of images in the sequence.
	colour_table	byte	The colour table to use for display.
	options.date	byte	Whether to add the image date to plots
		grid	byte	Whether to overlay the coordinate grid
				on plots
		file	byte	Whether to put the filename on plots
		range	byte	Whether to put the data range on plots.
		window	long	The window index of the display window.
		data_range float The data range to display.
		data_kill float Points outside this level are set to undefined.
		data_log byte	Whether data display is linear or
				logarithmic.
		delay	float	The delay between frames in a movie.
		plane	int	The image plane to display (0 =
				processed, 1=raw image plane 0 etc.)
	pixmap.id	long	The window ID of the pixmap used for
				fast display
		hwm	long	The next available row in the
				pixmap. It's 1 pixel above the top
				left corner of the last image added.
		colwidth long	The width of a column of images in the
				pixmap
	sourcedir	string	The directory tree of the last
				image(s) added to the sequence.	
	file		string	The savefile name used for the sequence.
	canvas		long	The widget ID of the plotting widget
				(N.B. this is not the same as the
				window ID).

 CALLED BY:
	SMEI_RESTORE
 MODIFICATION HISTORY:
	Original: 9/12/02; SJT
	Fixed range scaling info, added colour table: 12/12/02; SJT
	Incorporate DELAY: 19/12/02; SJT
	Update Doc comments and remove disused fields: 9/1/03; SJT
	Add logarithmic option, make pixmap hwm 2-D: 10/1/03; SJT
	Add plane option, (to allow display of raw image planes):
	16/5/03; SJT
	Separate in and out of sky for null pixels: 18/7/03; SJT
	Add print settings: 22/7/03; SJT
	Add sourcedir: 29/10/03; SJT
	Add data_kill: 29/3/04; SJT
	Add spooling commands for print: 6/6/05; SJT


SMEI_SEQUENCE__MODEL_MENU $SSW/smei/bham/idl/smei_sequence/smei_sequence__model_menu.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE__MODEL_MENU


 PURPOSE:
	Select a background model set and subtract it.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> model_menu[, group = group]


 KEYWORD PARAMETERS:
	group	long	A possible group leader for the menu


 SIDE EFFECTS:
	A background is subtracted from the sequence.


 RESTRICTIONS:
	Can only be applied to uncompacted sequences.


 MODIFICATION HISTORY:
	Original: 7/5/04; SJT
	Add ability to change model directory: 23/11/04; SJT


smei_sequence__vmain $SSW/smei/bham/idl/smei_sequence/smei_sequence__vmain.pro
[Previous] [Next]
 smei_sequence::vmain
	Put a value into a top-level variable.

 Usage:
	seqref -> vmain, value[, name]

 Arguments:
	value	input	any	The value to be sent up to the main
				program level
	name	input	string	The name of the variable to use.


 Keywords:
	default_name	input	string	A default value for the
					variable name
	group		input	long	The widget ID of a calling
					widget.

 Notes:
	If the name argument is not given, then the user is prompted
	for a name (possibly with a default).
	If the group keyword is given, then the prompt is via a widget
	interface, otherwise it is via the command line.

 History:
	Original: 13/7/01; SJT
	Add ability to send to a file: 19/12/02; SJT
	Move to smei_sequence method as save-to-file is detail specific:
	6/1/02; SJT


SMEI_SEQUENCEADD_IMAGE $SSW/smei/bham/idl/smei_sequence/smei_sequence__add_image.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::ADD_IMAGE


 PURPOSE:
	Add a new image to a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	imref = seqref -> add_image(file)


 INPUTS:
	file	string	The FITS file containing the image.


 KEYWORD PARAMETERS:
	/first	If set, then add the image at the beginning of the
		sequence.
	/last	If set, add the image at the end of the sequence (this
		is the default behaviour).
	after	Either a location number or an image reference after
		which the new images is to be inserted.
	before	Either a location number of an image reference before
		which the new image is to be inserted.
	/compact If set, then compact the image on adding it.
	/silent	Passed via image constructor to readfits, if set, then
		messages about the images read are supressed
	image_data	Float	The image values (usually a 1-plane
				derived image)
	start		double	The start time of the image (DI only)
	stop		double	The end time of the image (DI only)
	unit		string	The unit of the image (DI)
	centre		float	The centre point of the image
				coordinates (DI)
       scale		float	The image scale (DI)
       fitshead	struct	A "fake" fitsheader for the image (DI)
       flags		struct	The processing flags for the image (DI)
       filename	string	The filename of the "dominant" image (DI)
       projection	int	The projection of the "dominant" image (DI)


 OUTPUTS:
	imref	objref	The objrect reference of the image added (or
			invalid on failure)

 MODIFICATION HISTORY:
	Original: 10/12/02; SJT
	Add compact option: 13/12/02; SJT
	Corrected documentation: 19/12/02; SJT
	Added silent key: 10/1/03; SJT
	Added keys to handle new methods of deriving images: 22/10/03; SJT
	Add filename key for derived images: 1/12/03; SJT
	Add projection key for derived images: 13/2/04; SJT


SMEI_SEQUENCEADD_MENU $SSW/smei/bham/idl/smei_sequence/smei_sequence__add_menu.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::ADD_MENU


 PURPOSE:
	To interactively add images to a SMEI sequence (old IDL)


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	status = seqref -> add_menu(group=group)


 INPUTS:



 OPTIONAL INPUTS:



 KEYWORD PARAMETERS:
	group	long	A possible group leader for the menu
	/no_progress	If set, then disable the progress bars (useful
			if slow network means the progress bars are
			slowing operation).


 OUTPUTS:
	status	1 or 0 for success or failure


 RESTRICTIONS:
	If any managed widgets are present then the GROUP keyword MUST
	be present.


 MODIFICATION HISTORY:
	Original: 16/12/02; SJT
	Hourglass TLM during read: 9/1/03; SJT
	Show progress: 10/1/03; SJT
	Support applying calc progs on load: 29/7/03; SJT
	Update properly on picking directory: 3/10/03; SJT
	Add projection handling: 16/2/04; SJT
	Add copy start & end buttons and increment/decrement buttons:
	26/7/05; SJT
	Add no_progress keyword: 25/8/05; SJT


SMEI_SEQUENCEAPPLY_COLOUR_MAP $SSW/smei/bham/idl/smei_sequence/smei_sequence__apply_colour_map.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::APPLY_COLOUR_MAP


 PURPOSE:
	Apply the selected colour table to the current device.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> apply colour_map


 MODIFICATION HISTORY:
	Original: 12/12/02; SJT


SMEI_SEQUENCECALC_COUNT $SSW/smei/bham/idl/smei_sequence/smei_sequence__calc_count.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::CALC_COUNT


 PURPOSE:
	To calculate the number of images in a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> calc_count


 SIDE EFFECTS:
	The count field is updated.


 MODIFICATION HISTORY:
	Original: 10/12/02; SJT


SMEI_SEQUENCECLEANUP $SSW/smei/bham/idl/smei_sequence/smei_sequence__cleanup.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::CLEANUP


 PURPOSE:
	Destructor for a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	obj_destroy,seqref


 MODIFICATION HISTORY:
	Original: 10/12/02; SJT


SMEI_SEQUENCECOMPACT $SSW/smei/bham/idl/smei_sequence/smei_sequence__compact.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::COMPACT


 PURPOSE:
	Compacts all the images in a sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> compact


 KEYWORD_PARAMETERS
	/mk_nan		If set, then convert points in the weighted
			images with zero weight into NaN values.

 MODIFICATION HISTORY:
	Original: 13/12/02; SJT


SMEI_SEQUENCECONCATENATE $SSW/smei/bham/idl/smei_sequence/smei_sequence__concatenate.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::CONCATENATE


 PURPOSE:
	Joins two SMEI sequences together


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> concatenate, seq2


 INPUTS:
	seq2	objref	The reference to the sequence to be appended.


 KEYWORD_PARAMETERS:
	/preserve	If set then copy the second sequence images
			rather than moving them.
	/sort		If set, then sort the resultant sequence after
			concatenation.

 SIDE EFFECTS:
	The second sequence is destroyed unless the preserve keyword
	is set.


 MODIFICATION HISTORY:
	Original: 20/12/02; SJT
	Added preserve keyword: 9/1/03; SJT
	Added sort keyword: 13/1/03; SJT


SMEI_SEQUENCEDELETE_IMAGE $SSW/smei/bham/idl/smei_sequence/smei_sequence__delete_image.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::DELETE_IMAGE


 PURPOSE:
	To remove an image from a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> delete_image, image


 INPUTS:
	image	Either an image number, or an image reference.


 MODIFICATION HISTORY:
	Original: 10/12/02; SJT


SMEI_SEQUENCEDELETE_MENU $SSW/smei/bham/idl/smei_sequence/smei_sequence__delete_menu.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::DELETE_MENU


 PURPOSE:
	To interactively delete images from and/or sort a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	status = seqref -> delete_menu(group=group)


 INPUTS:



 OPTIONAL INPUTS:



 KEYWORD PARAMETERS:
	group	long	A possible group leader for the menu


 OUTPUTS:
	status	1 or 0 for success or failure


 RESTRICTIONS:
	If any managed widgets are present then the GROUP keyword MUST
	be present.


 MODIFICATION HISTORY:
	Original: 16/12/02; SJT
	Fix memory leak and add sort: 13/1/03; SJT
	Allow multiple deletes: 25/7/03
	Fix another memory leak: 2/9/05; SJT


SMEI_SEQUENCEGET_ANNOTATIONS $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_annotations.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_ANNOTATIONS


 PURPOSE:
	Return the state of the various plot annotation flags


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	flag = seqref -> get_annotation(<selector>)


 KEYWORD PARAMETERS:
	grid	Query plotting of a grid or not
	date	Query adding the date
	file	Query adding the filename
	range	Query adding the range.


 OUTPUTS:
	flag	byte	The state of the requested option


 MODIFICATION HISTORY:
	Original: 12/12/02; SJT


SMEI_SEQUENCEGET_BIGGEST_IMAGE $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_biggest_image.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_BIGGEST_IMAGE


 PURPOSE:
	Find the largest image in a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	sz = seqref -> get_biggest_image


 OUTPUTS:
	sz	The maximum X & Y sizes of the images in the sequence


 MODIFICATION HISTORY:
	Original: 11/12/02; SJT


SMEI_SEQUENCEGET_COLOUR_MAP $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_colour_map.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_COLOUR_MAP


 PURPOSE:
	Returns the colour table used for a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	map = seqref -> get_colour_map()


 KEYWORD PARAMETERS:
	/red	Only return the red component
	/green	Only return the green component
	/blue	Only return the blue component


 OUTPUTS:
	map	The colour map.


 MODIFICATION HISTORY:
	Original: 12/12/02; SJT


SMEI_SEQUENCEGET_COUNT $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_count.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_COUNT


 PURPOSE:
	Return the number of images in a SMEI sequence.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	count=seqref -> get_count()


 OUTPUTS:
	count	long	The number of images attached to the sequence.


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_SEQUENCEGET_DATA_RANGE $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_data_range.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_DATA_RANGE


 PURPOSE:
	Return the data range of values for plotting.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	range=seqref -> get_data_range()


 OUTPUTS:
	range	float	A 2-element array containing the data_range.


 KEYWORD PARAMETERS
	/logarithmic	If set, then return whether the scaling is
			logarithmic.
	/kill		If set, then return the "Kill range"

 MODIFICATION HISTORY:
	Original: 10/12/02; SJT
	Renamed: 12/12/02; SJT
	Added logarithmic keyword: 10/1/03; SJT
	Added KILL keyword: 29/3/04; SJT


SMEI_SEQUENCEGET_DELAY $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_delay.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_DELAY


 PURPOSE:
	Get the interframe interval of a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	delay = seqref -> get_delay()


 OUTPUTS:
	delay	float	The interframe delay in seconds


 MODIFICATION HISTORY:
	Original: 19/12/02; SJT


SMEI_SEQUENCEGET_FILE $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_file.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_FILE


 PURPOSE:
	Get the name of the file to which a SMEI sequence was last
	saved.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> get_file()


 MODIFICATION HISTORY:
	Original: 16/12/02; SJT


SMEI_SEQUENCEGET_FIRST $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_first.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_FIRST


 PURPOSE:
	Get the first image of a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	imref = seqref->get_first()


 OUTPUTS:
	imref	objref	A reference to the first image in the sequence.

 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_SEQUENCEGET_IMAGE $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_image.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_IMAGE


 PURPOSE:
	Get the reference for an image in the sequence.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	imref = seqref->get_image(location)


 INPUTS:
	location	long	The sequence number of the required image.


 OUTPUTS:
	imref	objref	The reference to the selected image.


 MODIFICATION HISTORY:
	Original: 10/12/02; SJT


SMEI_SEQUENCEGET_LAST $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_last.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_LAST


 PURPOSE:
	Get the last image of a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	imref = seqref->get_last()

 OUTPUTS:
	imref	objref	A reference to the last image in the sequence.

 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_SEQUENCEGET_N_PLANES $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_n_planes.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_N_PLANES


 PURPOSE:
	Return number of available planes in the images of a SMEI
	sequence. 


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	planes=seqref->get_n_planes()


 OUTPUTS:
	planes	The number of available RAW images planes in the sequence.


 MODIFICATION HISTORY:
	Original: 19/5/03; SJT


SMEI_SEQUENCEGET_NAME $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_name.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_NAME


 PURPOSE:
	Return the name of a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	name = seqref -> get_name()


 OUTPUTS:
	name	string	The name of the sequence


 MODIFICATION HISTORY:
	Original: 10/12/02; SJT


SMEI_SEQUENCEGET_NULL_INDEX $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_null_index.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_NULL_INDEX


 PURPOSE:
	Return the colour index to use for pixels with no data.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	index = seqref -> get_null_index([/print|/screen])


 KEYWORD PARAMETERS:
	/print		If set, then return the colour index to use for
			printed output
	/screen		If set, then return the colour index to use for screen
			displays. (This is the default).
	/off_sky	If set, then return the value to use for
			points outside the sky area


 OUTPUTS:
	index	byte	The colour index to use.


 MODIFICATION HISTORY:
	Original: 11/7/03; SJT
	Separate in and out of sky: 18/7/03; SJT


SMEI_SEQUENCEGET_PIXMAP $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_pixmap.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_PIXMAP


 PURPOSE:
	Get the window ID of the pixmap mirroring a SMEI image
	sequence 


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	id = seqref -> get_pixmap()

 KEYWORD PARAMETERS:
	/hwm		If set, then return the pixmap high water mark.
	/colwidth	If set, then return the width of the columns
			in the pixmap.

 OUTPUTS:
	id	The window ID of the pixmap (or hwm or column width as
		requested).


 MODIFICATION HISTORY:
	Original: 11/12/02; SJT
	Added colwidth keyword: 10/1/03; SJT


SMEI_SEQUENCEGET_PLANE $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_plane.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_PLANE


 PURPOSE:
	Get the image plane to display in a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	plane = seqref -> get_plane()


 OUTPUTS:
	plane		The image plane to display


 MODIFICATION HISTORY:
	Original (after get_delay): 16/5/03; SJT


SMEI_SEQUENCEGET_PRINT_OPTS $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_print_opts.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_PRINT_OPTS


 PURPOSE:
	Return the print-specific options for a sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	value = seqref -> get_print_opts([<selector>])


 KEYWORD PARAMETERS:
	/columns	If set, then return the number of columns in
			the layout
	/rows		If set, then return the number of rows in the
			layout.
	/order		If set, then return the order in which the
			images are to be printed
	/type		If set, then return the type of postscript
			file to generate (0=landscape, 1 = portrait, 2
			= eps)
	/file		If set, then return the filename to use for
			the output.
	/xsize		If set, then return the x-size of the page.
	/ysize		If set, then return the y-size of the page.
	/print		If set, then return the printing command.
	/preview	If set, then return the preview command.
	

 OUTPUTS:
	value	The value of the requested option, or the whole
		options structure if no selector was given.

 RESTRICTIONS
	The only keys that is meaningful to combine is columns and
	rows, or xsize and ysize in which case a 2-element array with
	both is returned.


 MODIFICATION HISTORY:
	Original: 22/7/03; SJT
	Add print & preview: 3/6/05


SMEI_SEQUENCEGET_PROJECTION $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_projection.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_PROJECTION


 PURPOSE:
	Return the image projection of a SMEI sequence.


 CATEGORY:
	smei sequence


 CALLING SEQUENCE:
	proj = seqref -> get_projection()


 KEYWORD PARAMETERS:
	/string		If set, then return a descriptive string
			rather than a number.
	/astrom_code	If set, then return the code needed by
			wcsxy2sph and WCSSPH2XY


 OUTPUTS:
	proj	int/str	The projection, either an index or the name.


 MODIFICATION HISTORY:
	Original: 18/5/04; SJT


SMEI_SEQUENCEGET_SOURCEDIR $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_sourcedir.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_SOURCEDIR


 PURPOSE:
	Get the name of the dir from which a SMEI sequence  last
	added images.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> get_sourcedir()


 MODIFICATION HISTORY:
	Original: 29/10/03; SJT


SMEI_SEQUENCEGET_SUMMARY $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_summary.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_SUMMARY


 PURPOSE:
	Generate a summary of the images in a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	desc = seqref->get_summary()


 KEYWORD PARAMETERS:
	/nofile		If set, then don't include the filename
	/print		If set, then print the description.
	/nohead		If set, then don't add a header.


 OUTPUTS:
	desc	string	A string array with the descriptions.


 MODIFICATION HISTORY:
	Original: 13/12/02; SJT


SMEI_SEQUENCEGET_WINDOW $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_window.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_WINDOW


 PURPOSE:
	Return the window index for plotting SMEI images


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	index = seqref -> get_window()


 OUTPUTS:
	windex	long	The index of the window.


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_SEQUENCEGET_ZOOM $SSW/smei/bham/idl/smei_sequence/smei_sequence__get_zoom.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::GET_ZOOM


 PURPOSE:
	To get the zoom factor for showing a smei sequence.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	factor=seqref -> get_zoom()


 OUTPUTS:
	factor	float	The factor by which to scale the images.


 KEYWORD PARAMETERS:
	/raw	If set, then return the internal format of the factor
		(i.e. integer with negative values for 1/n)
	/smooth	If set, then return the smoothing flag.


 MODIFICATION HISTORY:
	Original: 28/7/03; SJT


SMEI_SEQUENCEINIT $SSW/smei/bham/idl/smei_sequence/smei_sequence__init.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::INIT


 PURPOSE:
	Constructor for a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref = obj_new("SMEI_SEQUENCE", flist, name=name)


 OPTIONAL INPUTS:
	flist	string	Optional list of FITS files to be added as
			attached SMEI_IMAGEs (findfile() wildcards are
			allowed).


 KEYWORD PARAMETERS:
	name	string	A name for the sequence
	/compact	If set, then compact the images as they are
			added (N.B. This only applies to images added
			during initialization).
	/menu		If set, then generate a menu to select files
			and options
	group	long	A possible group leader for a menu.
	/noexpand	If set, then do not try to expand wildcards in
			a file list.
	/no_progress	If set, then disable the progress bars (useful
			if slow network means the progress bars are
			slowing operation).


 OUTPUTS:
	ok	int	Status flag returned to obj_new


 MODIFICATION HISTORY:
	Original: 10/12/02; SJT
	Add compact option: 13/12/02; SJT
	Make sure we destroy attached images after a quit & destroy
	from the menu: 10/1/03; SJT
	Add no-data index: 11/7/03; SJT
	Add off sky colours: 18/7/03; SJT
	Add print options: 22/7/03; SJT
	Add noexpand keyword and change findfile to file_search:
	29/7/03; SJT
	Add print spooling commands: 6/6/05; SJT
	Add no_progress keyword: 25/8/05; SJT


SMEI_SEQUENCEMAKE_AVMV $SSW/smei/bham/idl/smei_sequence/smei_sequence__make_avmv.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::MAKE_AVMV


 PURPOSE:
	Generates a movie from a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> make_avmv, file


 INPUTS:
	file	string	The name of the file to which to write the movie


 KEYWORD PARAMETERS:
	frame_rate	(float)	The frame rate desired (fps)
	/avi			If set, then make a DIVX5 AVI movie.
	/quicktime		If set, then make a Quicktime movie
	/ffmpeg			If set, then make an FFmpeg AVI movie.
	codec		string	For quicktime and ffmpeg, specify the
				codec to use for the movie.
	/no_progress	If set, then disable the progress bars (useful
			if slow network means the progress bars are
			slowing operation).

 RESTRICTIONS:
	Requires that transcode be installed on the system.


 MODIFICATION HISTORY:
	Original (from MAKE_MPEG): 17/2/04; SJT
	Updated transcode options: 3/12/04; SJT
	Add ffpmeg & codec selections: 7/6/05; SJT
	Fix file-decriptor leak: 8/6/05; SJT
	Add no_progress keyword: 25/8/05; SJT


SMEI_SEQUENCEMAKE_MPEG $SSW/smei/bham/idl/smei_sequence/smei_sequence__make_mpeg.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::MAKE_MPEG


 PURPOSE:
	Generates an mpeg movie from a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> make_mpeg, file


 INPUTS:
	file	string	The name of the file to which to write the MPEG


 KEYWORD PARAMETERS:
	compress	int	The compression level (0..3)
	quality		int	The quality setting [01]
	multiplex	int	The number of times to repeat each
				image to get a sensible speed.
	/no_progress	If set, then disable the progress bars (useful
			if slow network means the progress bars are
			slowing operation).


 RESTRICTIONS:
	Requires that mpeg_encode and pngtopnm or pngtoppm be
	installed on the system.


 MODIFICATION HISTORY:
	Original (from LASCO original by JW): 18/12/02; SJT
	Skip hidden frames: 13/6/03; SJT
	Use IDL's WRITE_PPM if no PNG->PPM converter found: 31/3/04; SJT
	Add no_progress keyword: 25/8/05; SJT


SMEI_SEQUENCEMAKE_MVI $SSW/smei/bham/idl/smei_sequence/smei_sequence__make_mvi.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::MAKE_MVI


 PURPOSE:
	Saves a SMEI sequence to a LASCO MVI format movie.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref->make_mvi, file


 OPTIONAL INPUTS:
	file	string	Name of the MVI file to create


 KEYWORD PARAMETERS:
	group	long	A possible group leader (strictly dialogue
			parent) for the menu.
	/no_progress	If set, then disable the progress bars (useful
			if slow network means the progress bars are
			slowing operation).


 SIDE EFFECTS:
	An MVI file is created


 MODIFICATION HISTORY:
	Original: 17/12/02; SJT
	Skip hidden images: 13/6/03; SJT
	Add no_progress keyword: 25/8/05; SJT


SMEI_SEQUENCEMAKE_PNG $SSW/smei/bham/idl/smei_sequence/smei_sequence__make_png.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::MAKE_PNG


 PURPOSE:
	Generates a set of PNG images from a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> make_png, file


 INPUTS:
	file	string	The name stem of the file to which to write the PNGs

 KEYWORD PARAMETERS:
	/no_progress	If set, then disable the progress bars (useful
			if slow network means the progress bars are
			slowing operation).


 MODIFICATION HISTORY:
	Original (cut down from MPEG): 16/9/03; SJT
	Skip hidden frames: 13/6/03; SJT
	Add no_progress keyword: 25/8/05; SJT


SMEI_SEQUENCEMAKE_PROFILE $SSW/smei/bham/idl/smei_sequence/smei_sequence__make_profile.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::MAKE_PROFILE


 PURPOSE:
	Generate a radial or circumferential profile set for a SMEI
	sequence.


 CATEGORY:
	SMEI SEQUENCE


 CALLING SEQUENCE:
	profile = seqref->make_profile(npa, nel, pamin, pamax)
		or
	profile = seqref->make_profile(npa, nel, elmin, elmax, $
			/circumferential)


 INPUTS:
	nel	int	The number of bins in the elongation axis.
	npa	int	The number of bins in the position angle axis.
	pamin	float	The lowest position angle to use
	pamax	float	The highest position angle to use
			 In future if pamin >
			pamax, then the sector will be assumed to
			cross north, but for the moment pamin must be
			less than pamax.
	elmin	float	The lowest elongation angle to use.
	elmax	float	The highest elongation angle to use.


 KEYWORD PARAMETERS:
	/circumferential	If set, then make a ring all around
				the image at a fixed elongation range.
	pa	float	output	A named variable to hold the position
				angles of the bin centres.
	elong	float	output	A named variable to hold the
				elongations of the bin centres.
	date	double	output	A named variable to receive the dates
				of the images.
	/verbose		If set, then show the region during
				the generation of the first image.


 OUTPUTS:
 	profile	float	An nel x npa x nimages array holding the
 			profiles.



 MODIFICATION HISTORY:
	Original: 12/12/03; SJT
	Add plane keyword: 12/1/04; SJT
	Replace old clumsy REVERSE_INDEX method with pointers owing to
	off by one per step error: 20/7/04; SJT


SMEI_SEQUENCEMENU [1] $SSW/smei/bham/idl/smei_sequence/smei_sequence__menu.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::MENU


 PURPOSE:
	To interactively define a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	status = seqref -> menu([flag, group=group])


 INPUTS:



 OPTIONAL INPUTS:



 KEYWORD PARAMETERS:
	group	long	A possible group leader for the menu
	/no_progress	If set, then disable the progress bars (useful
			if slow network means the progress bars are
			slowing operation).


 OPTIONAL OUTPUTS:
	flag	1 or 0 for success or failure (needed when called from
		the constructor)


 RESTRICTIONS:
	If any managed widgets are present then the GROUP keyword MUST
	be present if the sequence doesn't already exist.


 MODIFICATION HISTORY:
 	Reduced to stub for alternates depending on IDL version:
 	26/11/03; SJT
	Add no_progress keyword: 25/8/05; SJT


SMEI_SEQUENCEMENU [2] $SSW/smei/bham/idl/smei_sequence/smei_sequence__menu1.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::MENU


 PURPOSE:
	To interactively define a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	status = seqref -> menu([flag, group=group])


 INPUTS:



 OPTIONAL INPUTS:



 KEYWORD PARAMETERS:
	group	long	A possible group leader for the menu
	/no_progress	If set, then disable the progress bars (useful
			if slow network means the progress bars are
			slowing operation).


 OPTIONAL OUTPUTS:
	flag	1 or 0 for success or failure (needed when called from
		the constructor)


 RESTRICTIONS:
	If any managed widgets are present then the GROUP keyword MUST
	be present if the sequence doesn't already exist.


 MODIFICATION HISTORY:
	Original: 16/12/02; SJT
	Rearranged layout: 6/1/03; SJT
	Added progress bar: 10/1/03; SJT
	Added print option: 16/5/03; SJT
	Redesigned: 11/6/03; SJT
	Handle 3-state grid setting: 17/6/03; SJT
	Renamed as __menu1 (for IDL <= 5.5): 26/11/03; SJT
	Merge movie types into a single button: 31/3/04; SJT
	Add support for background model subtraction: 7/5/04; SJT
	Add 3-state date settings: 3/6/05; SJT
	Add no_progress keyword: 25/8/05; SJT


SMEI_SEQUENCEMENU [3] $SSW/smei/bham/idl/smei_sequence/smei_sequence__menu2.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::MENU


 PURPOSE:
	To interactively define a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	status = seqref -> menu([flag, group=group])


 INPUTS:



 OPTIONAL INPUTS:



 KEYWORD PARAMETERS:
	group	long	A possible group leader for the menu
	/no_progress	If set, then disable the progress bars (useful
			if slow network means the progress bars are
			slowing operation).


 OPTIONAL OUTPUTS:
	flag	1 or 0 for success or failure (needed when called from
		the constructor)


 RESTRICTIONS:
	If any managed widgets are present then the GROUP keyword MUST
	be present if the sequence doesn't already exist.


 MODIFICATION HISTORY:
	Original: 16/12/02; SJT
	Rearranged layout: 6/1/03; SJT
	Added progress bar: 10/1/03; SJT
	Added print option: 16/5/03; SJT
	Redesigned: 11/6/03; SJT
	Handle 3-state grid setting: 17/6/03; SJT
	Renamed menu2 and changed to use tab widgets (for IDL >= 5.6):
	26/11/03; SJT
	Merge movie types into a single button: 31/3/04; SJT
	Add support for background model subtraction: 7/5/04; SJT
	Add 3-state date settings: 3/6/05; SJT
	Add no_progress keyword: 25/8/05; SJT


SMEI_SEQUENCEMK_PIXMAP $SSW/smei/bham/idl/smei_sequence/smei_sequence__mk_pixmap.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::MK_PIXMAP


 PURPOSE:
	To create a pixmap window in which to store SMEI images.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqid->mk_pixmap

 KEYWORD PARAMETERS:
	/destroy	Delete the pixmap window (needed if images are
			added or removed from the sequence)
	/clear		Clear the pixmap flags of the images (when
			display options are changed)

 SIDE EFFECTS:
	A pixmap window large enough to store all the images is
	created


 MODIFICATION HISTORY:
	Original: 11/12/02; SJT


SMEI_SEQUENCEMOVIE_MENU $SSW/smei/bham/idl/smei_sequence/smei_sequence__movie_menu.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::MOVIE_MENU


 PURPOSE:
	GUI to set up making a SMEI sequence movie


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> movie_menu


 KEYWORD PARAMETERS:
	group	long	A group leader for the widgets
	/no_progress	If set, then disable the progress bars (useful
			if slow network means the progress bars are
			slowing operation).


 MODIFICATION HISTORY:
	Original (After avmv version): 31/3/04; SJT
	Add ffpmeg & codec selections: 7/6/05; SJT
	Remove Codec selection again: 10/6/06; SJT
	Add no_progress keyword: 25/8/05; SJT


SMEI_SEQUENCEPEEK $SSW/smei/bham/idl/smei_sequence/smei_sequence__peek.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::PEEK


 PURPOSE:
	Debugging tool to allow peeking into a SMEI_SEQUENCE object.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	imref -> peek


 MODIFICATION HISTORY:
	Original: 16/1/03; SJT


SMEI_SEQUENCEPNG_MENU $SSW/smei/bham/idl/smei_sequence/smei_sequence__png_menu.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::PNG_MENU


 PURPOSE:
	Set the filename stem for saving a SMEI sequence to a series
	of PNG files.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref->png_menu[, group=group]


 KEYWORD PARAMETERS:
	group	long	A group leader for the widgets
	/no_progress	If set, then disable the progress bars (useful
			if slow network means the progress bars are
			slowing operation).

 MODIFICATION HISTORY:
	Original: 16/9/03; SJT
	Add no_progress keyword: 25/8/05; SJT


SMEI_SEQUENCEPRINT $SSW/smei/bham/idl/smei_sequence/smei_sequence__print.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::PRINT


 PURPOSE:
	Make a PostScript file of a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> print


 KEYWORD PARAMETERS:
	/grid		If specfied, then add a grid to the images
	date	int	Date format for the images.
	/file		If specified, then add the filename to the
			images.
	/add_range	If set, then add the range to the plot.
	range	float	The min and max values for the display
			(implies adding the range to the plot)
	colour_table int The colour table to use. (-1 or unset to use
			the sequence map)
	xsize	float	The size in cm of the x-dimension of the page
	ysize	float	The size in cm of the y-dimension of the page
	/no_colour	Do not generate colour PS (equivalent to
			colour_table=0)
	/portrait	Print in portrait mode.
	/landscape	Print in landscape mode
	plot_file str	Specify a filename other than the default idl.ps
	/encapsulated	If set, then make an eps file (handled
			explicitly as other things are done
			differently for eps).
	ncolumns int	The number of columns to arrange the images
	nrows	int	The number of rows to arrange the images
	/logarithmic	If set, then use a logarithmic mapping of the
			colour table.
	/in_rows	If set, then go arrange the frames in rows
			rather than in columns.

	Any keywords to DEVICE that do not clash with the above and
	which are accepted by the PS device may be passed.

 SIDE EFFECTS:
	A PostScript file is generated.


 RESTRICTIONS:
	Pro-tem it doesn't print the file.


 MODIFICATION HISTORY:
	Original (after image version): 16/5/03; SJT
	Add row orientation: 21/7/03; SJT
	Use print options: 22/7/03; SJT
	Add spooling of print file: 6/6/05; SJT


SMEI_SEQUENCEPRINT_MENU $SSW/smei/bham/idl/smei_sequence/smei_sequence__print_menu.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::PRINT_MENU


 PURPOSE:
	GUI to control printing of a SMEI sequence.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> print_menu


 KEYWORD PARAMETERS:
	group	long	Widget ID of a group leader
	/block		If set, then block any other widget events.


 SIDE EFFECTS:
	A print file may be generated.


 MODIFICATION HISTORY:
	Original: 11/12/02; SJT
	Add log scaling: 10/1/03; SJT
	Add plane selection & extend grids: 20/6/03; SJT
	Add no-data index: 11/7/03; SJT
	Add off_sky colour: 18/7/03; SJT
	Use print_options: 22/7/03; SJT
	Add kill range support: 29/3/04; SJT
	Add 3-state date settings: 3/6/05; SJT
	Add spooling options: 6/6/05; SJT


SMEI_SEQUENCEPROFILE_MENU $SSW/smei/bham/idl/smei_sequence/smei_sequence__profile_menu.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::PROFILE_MENU


 PURPOSE:
	Create a radial or circumferential profile of the images in a
	smei sequence.


 CATEGORY:
	SMEI SEQUENCE


 CALLING SEQUENCE:
	seqref -> profile_menu[, group = group]


 KEYWORD PARAMETERS:
	group	long	The widget ID of a group leader for the menu.


 MODIFICATION HISTORY:
	Original: 15/12/03; SJT
	Add plane selection: 12/1/04; SJT


SMEI_SEQUENCERANGE_MENU $SSW/smei/bham/idl/smei_sequence/smei_sequence__range_menu.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::RANGE_MENU


 PURPOSE:
	Simple GUI to set display range for SMEI data.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref->range_menu


 KEYWORD PARAMETERS:
	group	long	Widget ID of a group leader.
	/block		If set, then the widget blocks other
			events. (So it pauses a movie for example).


 SIDE EFFECTS:
	A widget menu is generated, and the range settings of the
	sequence may be changed.


 MODIFICATION HISTORY:
	Original: 11/12/02; SJT
	Add logarithmic support: 10/1/03; SJT
	Add no-data index: 11/7/03; SJT
	Add off_sky colour: 18/7/03; SJT
	Add Kill ranges: 29/3/04; SJT


SMEI_SEQUENCESAVE $SSW/smei/bham/idl/smei_sequence/smei_sequence__save.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SAVE


 PURPOSE:
	Save a SMEI sequence to an IDL save file.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> save[, file]


 INPUTS:



 OPTIONAL INPUTS:
	file	string	The file to which to save the sequence.


 KEYWORD PARAMETERS:
	/menu		If set, then use a dialogue box to choose the
			file. (If file is provided it will be treated
			as a filter).
	group	long	A possible group leader (strictly dialogue
			parent) for the menu.


 MODIFICATION HISTORY:
	Original: 16/12/02; SJT


SMEI_SEQUENCESET_ANNOTATIONS $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_annotations.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_ANNOTATIONS


 PURPOSE:
	Select which annotations to add to the plot.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> set_annotations, <selector keys>


 KEYWORD PARAMETERS:
	grid	Select plotting of a grid or not
	date	Select adding the date (0=none, 1=DoY, 2=Y-M-D)
	file	Select adding the filename
	range	Select adding the range.


 MODIFICATION HISTORY:
	Original: 12/12/02; SJT
	Handle 3-state grid setting: 17/6/03; SJT
	Handle 3-state date setting: 3/6/05; SJT


SMEI_SEQUENCESET_COLOUR_MAP $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_colour_map.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_COLOUR_MAP


 PURPOSE:
	Load and store colour map to use when plotting SMEI images


 CATEGORY:
	SMEI_SEQUENCE


 KEYWORD PARAMETERS:
	/menu		If set, then load a table using xloadct.
	group	long	A widget group leader for xloadct
	table	int	If set, then load the numbered colour table
	map	byte	A 256x3 byte array that contains an explicit
			colour map to use

 CALLING SEQUENCE:
	seqref -> set_colour_map


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT
	Merge with set_colour_table and allow explicit tables:
	19/12/02; SJT
	Made call to XLOADCT modal so that it stores the colour table
	correctly: 17/9/03; SJT


SMEI_SEQUENCESET_DATA_RANGE $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_data_range.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_DATA_RANGE


 PURPOSE:
	To set the data range to show in plots.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> set_data_range, min, max
		or
	seqref -> set_data_range, range


 INPUTS:
	min	float	The lower bound to set
	max	float	The upper bound to set
	range	float	2-element array containing the above.

 KEYWORD PARAMETERS:
	logarithmic	int	Whether to use logarithmic scaling or not.
	kill		float	Set a range of values outside which
				data are considered bad (2-element
				array or a scalar == [-kill, kill])


 MODIFICATION HISTORY:
	Original: 10/12/02; SJT
	Renamed: 12/12/02; SJT
	Add logarithmic option: 10/1/03; SJT
	Add KILL keyword: 229/3/04; SJT


SMEI_SEQUENCESET_DELAY $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_delay.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_DELAY


 PURPOSE:
	Set the inter-frame interval for a SMEI sequence.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> set_delay, delay


 INPUTS:
	delay	float	The inter-frame delay in seconds.

 RESTRICTIONS
	Delays less than 0.05s cannot be set. This is to prevent the
	possibility of an event pile-up


 MODIFICATION HISTORY:
	Original: 19/12/02; SJT


SMEI_SEQUENCESET_FILE $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_file.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_FILE


 PURPOSE:
	Sets the filename for saving a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> set_file, file


 INPUTS:
	file	string	The filename to use.


 MODIFICATION HISTORY:
	Original: 17/12/02; SJT


SMEI_SEQUENCESET_FIRST $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_first.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_FIRST


 PURPOSE:
	Set the first image of a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	imref = seqref->set_first, imref


 INPUTS:
	imref	objref	A reference to the first image in the sequence.

 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_SEQUENCESET_LAST $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_last.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_LAST


 PURPOSE:
	Set the last image of a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	imref = seqref->set_last, imref


 INPUTS:
	imref	objref	A reference to the last image in the sequence.

 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_SEQUENCESET_NAME $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_name.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_NAME


 PURPOSE:
	Set name of a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> set_name, name


 INPUTS:
	name	string	The name of the sequence


 MODIFICATION HISTORY:
	Original: 10/12/02; SJT


SMEI_SEQUENCESET_NULL_INDEX $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_null_index.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_NULL_INDEX


 PURPOSE:
	Set the colour indices to use for missing data/out of sky.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> set_null_index, index[, /print|/screen]


 INPUTS:
	index	byte	The colour index or indices to use. (If no key
			is given, then it should be a 2x2-element array,
			else a scalar)

 KEYWORD PARAMETERS:
	/screen		If set, then only set the index for screen displays.
	/print		If set, then only set the index for printouts.
	/off_sky	If set, then set the value to use for
			points outside the sky area


 MODIFICATION HISTORY:
	Original: 11/7/03; SJT
	Separate in and out of sky: 18/7/03; SJT


SMEI_SEQUENCESET_PLANE $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_plane.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_PLANE


 PURPOSE:
	Set the plane to show in a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> set_plane, plane


 INPUTS:
	plane	int	The plane to display.



 MODIFICATION HISTORY:
	Original (after set_delay): 16/5/03; SJT


SMEI_SEQUENCESET_PRINT_OPTS $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_print_opts.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_PRINT_OPTS


 PURPOSE:
	Set the print-specific options for a sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> set_print_opts, <keys>


 KEYWORD PARAMETERS:
	columns	int	Set the number of columns in the layout
	rows	int	Set the number of rows in the layout.
	order	bool	Set the order in which the images are to be
			printed 
	type	int	Set the type of postscript file to generate
			(0=landscape, 1 = portrait, 2 = eps)
	file	string	Set the filename to use for the output.
	xsize	float	Set the x-size of the printed area
	ysize	float	Set the y-size of the printed area.
	print	string	Set the printing command
	preview	string	Set the preview command.


 MODIFICATION HISTORY:
	Original: 22/7/03; SJT
	Add print & preview keys: 3/6/05; SJT


SMEI_SEQUENCESET_PXM_HWM $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_pxm_hwm.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_PXM_HWM


 PURPOSE:
	Set the high-water mark of a SMEI sequence pixmap.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> set_pxm_hwm, hwm


 INPUTS:
	hwm	long	The new high water mark (2 element array).


 MODIFICATION HISTORY:
	Original: 11/12/02; SJT


SMEI_SEQUENCESET_SOURCEDIR $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_sourcedir.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_SOURCEDIR


 PURPOSE:
	Sets the dirname for reading to a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> set_sourcedir, sourcedir


 INPUTS:
	sourcedir	string	The dirname to use.


 MODIFICATION HISTORY:
	Original: 29/10/03; SJT


SMEI_SEQUENCESET_WINDOW $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_window.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_WINDOW


 PURPOSE:
	Set window index to use when plotting SMEI images


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> set_window, window


 INPUTS:
	window	long	The window index


 MODIFICATION HISTORY:
	Original: 9/12/02; SJT


SMEI_SEQUENCESET_ZOOM $SSW/smei/bham/idl/smei_sequence/smei_sequence__set_zoom.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SET_ZOOM


 PURPOSE:
	To set the zoom factor for showing a smei sequence.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> set_zoom, factor


 INPUTS:
	factor	int	The factor by which to scale the images.
			The for reductions, use the inverse key. (0 is
			the same as 1)


 KEYWORD PARAMETERS:
	/inverse	If set, then the factor is a reduction.
	smooth		Controls whether smoothing will be done on
			rebinning the image (Note this is only
			applicable to zoom-in).


 MODIFICATION HISTORY:
	Original: 28/7/03; SJT


SMEI_SEQUENCESHOW $SSW/smei/bham/idl/smei_sequence/smei_sequence__show.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SHOW


 PURPOSE:
	Show a sequence of SMEI images, better version.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref->show[, image]


 OPTIONAL INPUTS:
	image	int	The location of a single image to select. If
			this is specified then that image will be the
			first shown and the movie will be started in a
			paused state.


 KEYWORD PARAMETERS:
	delay	float	The wait between images
	group	long	Widget ID of a group leader for the widget.


 MODIFICATION HISTORY:
	Original: 11/12/02; SJT
	Add image argument and send drag events from the slider:
	19/12/02; SJT
	Add reverse play and hiding options: 15/1/03; SJT
	Handle 3-state grid setting: 17/6/03; SJT
	Add ability to use a wheelmouse to scroll though a movie:
	19/6/03; SJT
	Extend wheel mouse to mark mode and flag mark mode with a
	different cursor: 2/7/03; SJT
	Rationalize and fix updates on option changes: 6/8/04; SJT
	Add blinking capability im mark mode: 6/8/04; SJT
	Print location stats on ctrl or shift click: 15/9/04; SJT
	Add 3-state date settings: 3/6/05; SJT


SMEI_SEQUENCESHOW_INFO $SSW/smei/bham/idl/smei_sequence/smei_sequence__show_info.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SHOW_INFO


 PURPOSE:
	Print basic information about a SMEI sequence


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> show_info


 KEYWORD PARAMETERS:
	group	If this is a valid widget ID, then the info will be
		displayed in a pop-up window, otherwise it is printed
		on the terminal.


 MODIFICATION HISTORY:
	Original: 19/5/03; SJT


SMEI_SEQUENCESORT $SSW/smei/bham/idl/smei_sequence/smei_sequence__sort.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::SORT


 PURPOSE:
	Sorts the images of a SMEI sequence into time order.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> sort


 SIDE EFFECTS:
	The order of the images in the sequence is changed.

 PROCEDURE:
 	Simple minded slide sort, this will still sort the biggest
 	mess that something with 1GB can cope with in well under a
 	second. 


 MODIFICATION HISTORY:
	Original: 13/1/03; SJT


smei_sequencesubtract_model $SSW/smei/bham/idl/smei_sequence/smei_sequence__subtract_model.pro
[Previous] [Next]
 NAME:
	smei_sequence::subtract_model


 PURPOSE:
	Subtract a background model from a smei sequence


 CATEGORY:
	smei_sequence


 CALLING SEQUENCE:
	seqref -> subtract_model

 INPUTS:
	model	string	The background-model identifier 

 KEYWORD PARAMETERS:
	plane	int	AN optional specification of which plane of
			the model to use. This should only be used for
			diagnostic purposes to subtract only the
			stellar or only the solar components.
	/restore	If set, then restore the unsubtracted
			processed image
	path	string	The path to the model files, if not the
			default.

 MODIFICATION HISTORY:
	Original (after low-level versions): 4/5/04; SJT
	Separate stellar and other components: 13/5/04; SJT
	Revert to single model: 23/5/04; SJT
	Clean dead code: 25/5/04; SJT
	Add restore keyword: 4/8/04; SJT
	Add PATH keyword: 22/11/04; SJT
	Allow compressed fits files: 24/6/05; SJT


SMEI_SEQUENCEZOOM_MENU $SSW/smei/bham/idl/smei_sequence/smei_sequence__zoom_menu.pro
[Previous] [Next]
 NAME:
	SMEI_SEQUENCE::ZOOM_MENU


 PURPOSE:
	Menu to set the zoom factor for showing a smei sequence.


 CATEGORY:
	SMEI_SEQUENCE


 CALLING SEQUENCE:
	seqref -> zoom_menu


 KEYWORD PARAMETERS:
	group	long	Group leader of the widget heirarchy


 MODIFICATION HISTORY:
	Original: 28/7/03; SJT


smei_setup_roi $SSW/smei/ucsd/camera/idl/buf/smei_setup_roi.pro
[Previous] [Next]
 NAME:
	smei_setup_roi
 PURPOSE:
	Fill common block with ROI information
 CATEGORY:
	camera/idl
 CALLING SEQUENCE:
	smei_setup_roi
 INPUTS:
	(from text file smei_roi.txt)
 OPTIONAL INPUTS:
	/destroy	destroys ROI heap variables
 OUTPUTS:
 CALLS: ***
	ArrayLocation, FILEPATH, InitVar, IsType, MagnifyArray, destroyvar, txt_read, who_am_i
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
	@smei_roi_mask.pro
 CALLED BY:
	qImage_cw_Where, qView_Destroy, smei_buf_get, smei_buf_mget, smei_buf_read
	smei_frm_base, smei_frm_flatfield, smei_frm_hbar, smei_frm_hbar_inside
	smei_frm_property, smei_frm_read, smei_frm_rebin, smei_roi_mask
 PROCEDURE:
	Sets up pointers to list of array indices into SMEI frames for each of the modes
	For i=0,1,2 (three different modes):
	*roi_siz[i] 	2-element array with image dimension
	*roi_frm[i] 	list of pixels included in the SMEI roi
	*roi_fov[i] 	list of pixels inside the field of view (incl. *roi_bad[i])
	*roi_drk[i] 	list of pixels in dark current columns
	*roi_sqr[i] 	list of pixels in two squares outside fov arc
	*roi_pix[i] 	list of pixels in center square inside fov arc
	*roi_ped[i] 	list of pixels in pedestal columns
	*roi_col[i] 	list of pixels in pedestal and dark current columns
	*roi_bad[i] 	list of pixels with partially covered pixels
					(i.e. the column to the right of the dark columns on the left, and
					the column to the left of the dark columns on the right of the frame)
 MODIFICATION HISTORY:
	APR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_sgp4_orbits $SSW/smei/ucsd/gen/idl/ephem/smei_sgp4_orbits.pro
[Previous] [Next]
 NAME:
	smei_sgp4_orbits
 PURPOSE:
	Build list of start times for all orbits using TLM data base.
 CALLING SEQUENCE:
	PRO smei_sgp4_orbits
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	FILEPATH, INTERPOL, TimeOp, TimeSet, TimeString, TimeUnit, big_eph, sgp4_orbit_period
	txt_read, who_am_i
 MODIFICATION HISTORY:
	JAN-2006, Paul Hick (UCSD/CASS)
	OCT-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Replaced NewcombSun by big_eph calls


smei_sgp4_quat $SSW/smei/ucsd/gen/idl/ephem/smei_sgp4_quat.pro
[Previous] [Next]
 NAME:
	smei_sgp4_quat
 PURPOSE:
	Calculates quaternion for nominal SMEI attitude at indicated times.
 CATEGORY:
 CALLING SEQUENCE:
	FUNCTION smei_sgp4_quat,  tt
 INPUTS:
	tt		array; type: time structure
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
	qq		array[4,*]; type: double
				spacecraft quaternion
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CV_COORD, CvRotation, sgp4_eph
 PROCEDURE:
	Should match the quaternion specified in the SMEI frame header.
 MODIFICATION HISTORY:
	JUL-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


SMEI_SHOW $SSW/smei/bham/idl/cli/smei_show.pro
[Previous] [Next]
 NAME:
	SMEI_SHOW


 PURPOSE:
	Display a SMEI sequence


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_show, seqref[, image]


 INPUTS:
	seqref	objref	Object reference of the SMEI sequence


 OPTIONAL INPUTS:
	image	int	The number of an image for a static
			display. If this is specified, then the
			sequence is started at that image and in a
			paused state.

 KEYWORD PARAMETERS:
	delay		float	The delay in seconds between images.
	colour_table	int	The colour table to use
	colour_map	byte	A 256x3 byte array that contains an explicit
				colour map to use
	grid		bool	Whether to add a grid
	nodate		bool	Whether to omit the date range
	range		float	2-element array with the range from
				black to white


 CALLS: ***
	self_help, smei_msg
 RESTRICTIONS:
	The keyword settings are persistent.


 MODIFICATION HISTORY:
	Original: 11/12/02; SJT
	Renamed: 18/12/02; SJT
	Modify colour handling: 19/12/02; SJT


smei_sky $SSW/smei/ucsd/camera/idl/sky/smei_sky.pro
[Previous] [Next]
 NAME:
	smei_sky
 PURPOSE:
	View orbital sky maps
 CATEGORY:
	camera/idl/sky
 CALLING SEQUENCE:
	PRO smei_sky, wanted_map, _extra=_extra,	$
		source		= source	, $

		allraw		= allraw	, $
		equatraw	= equatraw 	, $
		northraw	= northraw	, $
		southraw	= southraw	, $

		allcnt		= allcnt	, $
		equatcnt	= equatcnt 	, $
		northcnt	= northcnt	, $
		southcnt	= southcnt	, $

		allstars	= allstars	, $
		equatstars	= equatstars, $
		northstars	= northstars, $
		southstars	= southstars, $

		time		= time		, $
		degrees 	= degrees	, $
		maxelo		= maxelo	, $
		ndim		= ndim		, $
		equator 	= equator	, $
		range		= range 	, $
		ctable		= ctable	, $
		breakval	= breakval	, $
		antisolar	= antisolar , $
		silent		= silent	, $
		zero_point	= zero_point, $
		difference	= difference, $
		xysize		= xysize	, $
		rawmap		= rawmap	, $
		noplot		= noplot	, $

		skymap		= skymap	, $
		hdrs		= hdrs		, $
		count		= count 	, $
		imgfile 	= imgfile	, $

		logo		= logo		, $
		charsize	= charsize
 INPUTS:
	wanted_map			scalar; type: integer
 OPTIONAL INPUT PARAMETERS:
	time=time			array[1]; type: time structure
						overrides the time extracted from the
						file header as the time determining the position
						of the Sun in the sun-centered maps.
	/degrees			if set, all angles are in degrees
							default: radians

	mode = 'sky':

	The following keywords work with the raw skymaps (i.e. the
	output files from the indexing program). The keywords correspond to
	an extension in a Fits file.

	/allraw 			if set, plot all three skymaps
	/equatraw			if set, plot equatorial map
	/northraw			if set, plot polar map of north pole
	/southraw			if set, plot polar map of south pole

	/allcnt
	/equatcnt
	/northcnt
	/southcnt

	For these keywords the equatorial maps are always in equi-rectangular
	coordinates (i.e. maxelo=0 is explicitly passed to PlotEarthSkymap).

	If none of these keywords are specified than the result will depend
	on keywords passed to smei_sky_read in the _extra structure.
	The following keywords displays one of the lowres maps, or the bad
	pixel map. The lowres maps are displayed with PlotEarthSkymap. The map
	projection is determined by the maxelo keyword, and the display is
	sun-centered (or centered anti-solar if /antisolar is set)

	/dirtysky
	/orbtime
	/orbsecs
	/psfn
	/psfe
	/badsky
	/badhtm
	/fovx
	/thetax
	/thetay
	/badpixels

	If none of these keywords are specified either than the equatorial
	and two polar maps are assembled into a single map covering the full
	latitude range [-90,+90]. As with the lowres maps PlotEarthSkymap
	displays the map, and maxelo controls the map projection, and the display is
	sun-centered (or centered anti-solar if /antisolar is set)

	A few keyword are only used for lowres maps and the hires map
	assembly from all equatorial and both polar maps.

	/equator			passed to PlotEarthSkymap. Puts the equatorial plane on the
						horizontal instead of the ecliptic
	/rawmap 			This displays the sun-centered map without interpolation
						to obtain the map values. In this case the keyword
						/equator is set in PlotEarthSkymap.
	maxelo=maxelo		passed to PlotEarthSkymap. Determines the map projection
						(Hammer-Aitoff, equi-rectangular or fish-eye)
	/antisolar			shifts from sun-centered map to map centered on
						anti-solar direction.


	Other keywords passed to smei_sky_read

	camera=camera		scalar, or array[n]; type:integer; default: 2
							camera numbers
	/compose			if set, same as camera=[1,2,3]
	source=source		scalar; type: string; default: $SMEISKY1
							source directory for sky maps
	/digsource			if set, use camera-specific subdirectories
							c1,c2,c3.
	nbin=nbin

	/noplot 			suppresses plotting
						mostly used to pull out the skymap array
						ignored if keyword allraw is set
 OUTPUTS:
	skymap=skymap		skymap array as returned by smei_sky_read
	hdrs=hdrs 			scalar or array; type: string
							list of fully-qualified filenames read
							by smei_sky_read
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	BadValue, CvPrecess, CvSky, Get_Page, InitVar, IsType, LOADCT, PlotEarthSkymap
	PlotPolarSkymap, Reset_Colors, STRETCH, Set_Page, SuperArray, TimeLimits, TimeSet
	ToDegrees, ToRadians, UNIQ [1], UNIQ [2], UNIQ [3], big_eph, destroyvar, gridgen
	jpl_body, smei_sky_read
 CALLED BY:
	qsmei_sky_Pick, smei_star_fit, smei_zodiac_fit
 PROCEDURE:
 MODIFICATION HISTORY:
	DEC-2004, Paul Hick (UCSD/CASS)
	JUL-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added time keyword


smei_sky2cam $SSW/smei/ucsd/camera/idl/toolbox/obsolete/smei_sky2cam.pro
[Previous] [Next]
 NAME:
	smei_sky2cam
 PURPOSE:
	Convert from equatorial coordinates to coordinates in the UCSD
	SMEI camera frame.
 CATEGORY:
	camera/idl
 CALLING SEQUENCE:
	R = smei_sky2cam( rvec, [ camera=camera, quaternion=quaternion, /degrees] )
 INPUTS:
	rvec		array[2,n] or array[3,n]; type: float
					positions in the sky as spherical or rectangular
					equatorial coordinates.

					/rect NOT SET: spherical coordinates
						rvec[0,*] is RA;
						rvec[1,*] is declination
						rvec[3,*] (usually the distance)

					/rect SET: rectangular coordinates
						rvec[0,*] is x-coordinate (toward vernal equinox
						rvec[1,*] is y-coordinate
						rvec[3,*] is z-coordinate (toward equatorial north)

					The units of the angles are determined by the setting of /degrees.
 OPTIONAL INPUT PARAMETERS:
	/degrees		if set, all in- and output angles are in degrees
					(default: radians). Note that the input 'camera' structure,
					if specified, must be consistent with the setting of /degrees.

	/rectangular	if set then rvec is in rectangular Cartesian coordinates.
					The 1st dimension in rvec MUST be 3; if it is not then
					this keyword is ignored.

	camera=camera	Identifies the SMEI camera

					Can be any one of the following three.

					array[1]; type: SMEI_FRM_HDR structure
						this determines the camera and the quaternion.
						The keyword 'quaternion', if present,
						will be ignored.

					array[1]; type: SMEI_CAMERA_FOV structure
						structure containing information about SMEI field of
						view; usually the return value of smei_camera
						with the /get_structure keyword set.
						This determines the fixed S/C-to-camera quaternion. The
						Coriolis quaternion must be specified using the
						'quaternion' keyword.

					scalar; type: integer
						camera number (1,2 or 3).
						This determines the fixed S/C-to-camera quaternion. The
						Coriolis quaternion must be specified using the
						'quaternion' keyword.

					If not specified then camera=1 is assumed.

					The camera number is used as argument to smei_camera to
					obtain the fov structure.
	quaternion=quaternion
				array[4]; type: float
					Coriolis S/C quaternion
 OUTPUTS:
	R			array[3,n]; type: float
					x,y,z coordinates of unit vector in the UCSD camera
					frame
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CV_COORD, CvRotation, InitVar, IsType, SyncDims, ToRadians, boost, smei_cam_quaternion
	smei_camera, smei_frm_property
 PROCEDURE:
 MODIFICATION HISTORY:
	MAR-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Extracted from smei_sky2ccd.


smei_sky2ccd $SSW/smei/ucsd/camera/idl/toolbox/obsolete/smei_cam2ccd.pro
[Previous] [Next]
 NAME:
	smei_sky2ccd
 PURPOSE:
	Convert from positions in the sky to CCD coordinates
 CATEGORY:
	camera/idl
 CALLING SEQUENCE:
	R = smei_sky2ccd( runit, [ camera=camera, /degrees] )
 INPUTS:
	runit			array[3,n]; type: float
						positions in the sky as unit vectors in the UCSD camera
						frames (as output by smei_frm_sky2ccd)
						These are converted to CCD coordinates if inside the FOV
						If no points lie inside the
						field of view then the scalar BadValue(rvec) is returned.
 OPTIONAL INPUT PARAMETERS:
	camera=camera	scalar; type: integer
						camera number (1,2 or 3).
					If not specified then camera=1 is assumed.
					The camera number is used as argument to smei_camera to
					obtain the fov structure.

	/degrees	if set, all in- and output angles are in degrees
					(default: radians). Note that the 'camera' structure
					must be consistent with the setting of /degrees.
	/boolean	if set then the output array 'inside' is a byte array of zeros
					and ones indicating whether the corresponding vectory is
					outside/inside the field of view (instead of a list of 
					indices from the IDL 'where' function identifying vectors
					inside the field of view).
	scalefov=scalefov
				scalar; type: float; default=3.0 (covers essentially the whole
					hemisphere centered on the camera optical axis).
					Only locations closer then fov.size[0]/2 (= 30 degrees) to the
					pole potentially lie inside the fov. The multiplier scalefov
					extends the search to at most 89.5 degrees (essentially the
					whole hemisphere centered on the pole. See PROCEDURE.
	distort=distort
				NOT IMPLEMENTED YET
 OUTPUTS:
	R			array[2,n]; type: float
					x and y pixel coordinates inside the SMEI fov
 OPTIONAL OUTPUT PARAMETERS:
	inside=inside	array; type: long int (/boolean NOT set) or byte (/boolean set).
						if /boolean is not set then 'inside' is a list of indices of
						vectors inside field of view
						if /boolean is set then 'inside' is a byte array with 0 for
						vectors inside or 1  for vectors inside the field of view.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	BadValue, CV_COORD, InitVar, Inside_Wedge, IsType, SMEI_CAM2CCD, SyncDims, ToDegrees
	ToRadians, smei_camera, smei_theta2radial
 PROCEDURE:
	The determination of sky locations inside the field of view is done in
	two cuts. The first cut retains only points within scalefov*30 deg from
	the optical axis. The default scalefov=3.0 so all points within 90 deg
	are retained (actually 89.5 degrees).

	The second cut retains only points strictly inside the field of view as
	defined in the 'camera' structure. Only CCD coordinates for these points are
	returned and are marked in the 'inside' array.
 MODIFICATION HISTORY:
	FEB-2003, Paul Hick (UCSD/CASS)
	FEB-2005, Paul Hick (UCSD/CASS)
	    Added keyword runit
	MAR-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Split smei_sky2ccd into two parts: smei_sky2cam and smei_cam2ccd.


smei_sky_file $SSW/smei/ucsd/camera/idl/sky/smei_sky_file.pro
[Previous] [Next]
 NAME:
	smei_sky_file
 PURPOSE:
	Construct file name for orbital map
 CATEGORY:
	camera/idl/sky
 CALLING SEQUENCE:
	FUNCTION smei_sky_file, source, camera, orbit, mode=mode, digsource=digsource
 INPUTS:
	source		scalar; type: string
					name of directory, or SMEIDB?
					if source='SMEIDB' then the source directory is
					$SMEISKY0/'mode', and /digsource is assumed set
	camera		scalar; type: integer
					camera number (1,2,3)
	orbit		scalar; type: integer or standard time structure
					orbit number or UT time
 OPTIONAL INPUT PARAMETERS:
	mode=mode 	scalar; type: string; default: 'sky'
					skymap mode: 'sky', 'equ'
	/digsource	if set, use camera-specific subdirectories
					c1,c2,c3.
 OUTPUTS:
	file		scalar; type: string
					fully-qualified name of orbital file
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, InitVar, IsTime, TimeString, TimeUnit, smei_coriolis
 CALLED BY:
	smei_sky_read, smei_star_remove, smei_zodiac_remove
 PROCEDURE:
 MODIFICATION HISTORY:
	APR-2005, Paul Hick (UCSD/CASS)
	JUN-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Changed setting of source directory when source='SMEIDB?' is input


smei_sky_get $SSW/smei/ucsd/camera/idl/sky/smei_sky_get.pro
[Previous] [Next]
 NAME:
	smei_sky_get
 PURPOSE:
	Select skymap
 CATEGORY:
	camera/idl/sky
 CALLING SEQUENCE:
	FUNCTION smei_sky_get, wanted_map, source=source, 	$
		given_map=given_map, given_path=given_path,		$
		silent=silent	;, digsource=digsource
 INPUTS:
	wanted_map		array[n]; type: string, time structure or integer
						The default is a single string: *.fts.gz

					If input is of type integer:
						(this includes the special case where integer are passed
						as a string array with numerical chars only)
						Orbit number. This is converted to a time structure using
						smei_coriolis, and is treated the same as if the
						input itself was a time structure (see below).

					If input is of type time structure:
						(this includes the special case where a string array
						of valid time strings is specified)
						only return keyword given_path is set, either to
						the input value of 'source' or to the default 'SMEIDB?'
						The path is usually further processed by the caller by
						passing it to smei_sky_file.
						Keyword given_map will be undefined

					If input is a single string containing a wildcard:
						This is a specification for a skymap file.
						The wildcard is used as file filter for the
						IDL dialog_pickfile widget. The path for the
						the widget is set using keyword source (with the
						default of $SMEISKY0/sky).
						Only files for one camera and mode are returned

					If input is of type string:
						These are either orbit numbers, or valid time strings
						or the names of skymap files.

						If these are orbit numbers or valid time strings, they
						are converted to time structures, and are treated the
						same as if the input itself was time structure array (see above).

						If these are valid file names for skymaps they are returned as
						is in given_map.
						Only files for one camera and mode are returned
						given_path will be undefined.	
					
 OPTIONAL INPUT PARAMETERS:
	source=source	scalar; type: string
						source directory for sky maps

						If wanted_map contains a wildcard (and
						dialog_pickfile is used to select a file then
						the default source is $SMEISKY0/sky.

						If wanted_map is a time structure then the default
						source is 'SMEIDB?'.

						'source' is ignored if the input 'wanted_map' contains valid
						file names
 OUTPUTS:
	smei_sky_get		array; type: time structure or integer -1
						-1 : no valid time for a skymap was found
						time structure: valid time for skymap
							in addition either given_path, or given_map will be set.
						 
 OPTIONAL OUTPUT PARAMETERS:
	given_path=given_path
						scalar; type: string
						name of existing directory to be used for constructing
						file names with smei_sky_file
						(given_map will be undefined)

	given_map=given_map
						scalar or array; type: string
						fully-qualified file name of a skymap
						(if defined given_path is NOT defined)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, InitVar, IsTime, IsType, TimeSplit, destroyvar, flt_string, smei_coriolis
	smei_frm_name
 CALLED BY:
	smei_star_remove, smei_zodiac_remove
 SEE ALSO:
 PROCEDURE:
 MODIFICATION HISTORY:
	AUG-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_sky_hdr__define $SSW/smei/ucsd/camera/idl/sky/smei_sky_hdr__define.pro
[Previous] [Next]
 NAME:
	smei_sky_hdr__define
 PURPOSE:
	Defines hdr structure or skymaps
 CATEGORY:
	camera/idl/sky
 CALLING SEQUENCE:
	PRO smei_sky_hdr__define
 INPUTS:
	(none)
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 PROCEDURE:
 MODIFICATION HISTORY:
	AUG-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Extracted from smei_sky_read


smei_sky_read $SSW/smei/ucsd/camera/idl/sky/smei_sky_read.pro
[Previous] [Next]
 NAME:
	smei_sky_read
 PURPOSE:
	Reads orbital skymaps
 CATEGORY:
	camera/idl/sky
 CALLING SEQUENCE:
	FUNCTION smei_sky_read, wanted_map,	$
		camera		= camera	, $
		compose 	= compose	, $
		source		= source	, $
		mode		= mode	 	, $

		equatraw	= equatraw 	, $
		northraw	= northraw	, $
		southraw	= southraw	, $

		equatcnt	= equatcnt 	, $
		northcnt	= northcnt	, $
		southcnt	= southcnt	, $

		equatstars	= equatstars, $
		northstars	= northstars, $
		southstars	= southstars, $

		dirtysky	= dirtysky	, $	; HTM__LO_SKY  = 1
		orbtime 	= orbtime	, $	; HTM__LO_TIME = 2
		orbsecs		= orbsecs	, $	; HTM__LO_SECS = 9
		psfn		= psfn		, $	; HTM__LO_PSFN = 3
		psfe		= psfe		, $	; HTM__LO_PSFE = 4
		badsky		= badsky	, $	; HTM__LO_CUT  = 5
		badhtm		= badhtm	, $	; HTM__LO_FRAC = 6
		cosx		= cosx		, $	; HTM__LO_FOVX = 10 Added in version 5.1
		thetax		= thetax	, $	; HTM__LO_ROTX = 7
		thetay		= thetay	, $	; HTM__LO_ROTY = 8
		hit			= hit		, $	; HTM__LO_HIT  = 11 Added in version 6.0
		badpixels	= badpixels , $

		nbin		= nbin		, $
		silent		= silent	, $

		xgrid		= xgrid 	, $
		ygrid		= ygrid 	, $
		xedge		= xedge 	, $
		yedge		= yedge 	, $

		digsource	= digsource , $
		degrees 	= degrees	, $

		_extra		= _extra	, $

		hdrs		= hdrs
 INPUTS:
	wanted_map 	scalar, array[1]; type: integer, time structure, or string
						indicates the orbit(s) to be processed

						time structure: UT time is converted and rounded
							to nearest orbit.
						string: file name of orbital file
						any numerical: rounded to nearest integer
						undefined: file is selected using dialog_pickfile.

						The input argument is not modified.
						Note that the number of the actual orbits used
						is returned in keyword orbit.
 OPTIONAL INPUT PARAMETERS:
	source=source	scalar; type: string; default: $SMEISKY
						location of orbital files
						Not used if the input arguments is undefined
						(dialog_pickfile sets the directory) or if
						wanted_map already contains a directory.
	camera=camera	scalar, or array[n]; type:integer; default: 2
						camera numbers
	/compose		if set, same as camera=[1,2,3]
						cameras are merged into a single map in the
						order specified.
	mode=mode	 	scalar; type: string
						identifies type of skymap: 'sid','sky','equ','ecl'
						Used only if the type cannot be determined from wanted_map

	/equatraw
	/northraw
	/southraw
	/equatcnt
	/northcnt
	/southcnt
	/equatstars
	/northstars
	/southstars
	/dirtysky
	/orbtime
	/orbsecs
	/psfn
	/psfe
	/badsky
	/badhtm
	/fovx
	/thetax
	/thetay
	/hit
	/badpixels
					if none of these map types is selected then the hires maps
					(equatorial,south and north pole) are put together into a
					single equatorial map covering [-90,+90] degrees declination.
					Note that this option also handles skymaps that contains
					a single equatorial map covering the full latitude range.

	nbin			scalar; type: integer; default: 5
						rebinning factor applied to equatorial grid.
						A rebinning with factor 5 results in maps
						with 5 deg bins in RA and Dec.
 OUTPUTS:
	xgrid			horizontal grid (bin centers)
	ygrid			vertical grid (bin centers)
	xedge			horizontal grid (bin edges)
	yedge			vertical grid (bin edges)
 OPTIONAL OUTPUT PARAMETERS:
	orbit			scalar; type: integer
						actual orbit number used

 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	BadValue, FILEPATH, FXADDPAR [1], FXADDPAR [2], FXPAR [1], FXPAR [2], FindAllFiles
	HEADFITS [1], HEADFITS [2], HEADFITS [3], InitVar, IsTime, IsType, MEAN, READFITS [1]
	READFITS [2], READFITS [3], TimeSplit, ToDegrees, ToRadians, boost, destroyvar
	flt_string, gridgen, hide_env, smei_coriolis, smei_frm_name, smei_sky_file
	where_common
 CALLED BY:
	smei_frm_get, smei_getfile, smei_sky
 PROCEDURE:
	Way too complicated.
 MODIFICATION HISTORY:
	DEC-2004, Paul Hick (UCSD/CASS)
	JUL-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added /fovx to extract Fits extension containing direction cosine
		angle in long dimension. If the extension is not present then an
		array with value of 15 degree everywhere is returned.


smei_star__define $SSW/smei/ucsd/camera/idl/star/smei_star__define.pro
[Previous] [Next]
 NAME:
	smei_star__define
 PURPOSE:
	Defines structure to store fit parameters for stars
 CATEGORY:
	camera/idl/star
 CALLING SEQUENCE:
	PRO smei_star__define
 INPUTS:
	(none)
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 PROCEDURE:
	If this structure is modified then the format statements in
	smei_star_formatpnt need to be updated accordingly.
 MODIFICATION HISTORY:
	AUG-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Extracted from smei_star_fit


smei_star_alias $SSW/smei/ucsd/camera/idl/star/smei_star_alias.pro
[Previous] [Next]
 NAME:
	smei_star_alias
 PURPOSE:
	Translates aliases for star names to catalogue names
 CATEGORY:
	camera/idl/star
 CALLING SEQUENCE:
	FUNCTION smei_star_alias, alias
 INPUTS:
	alias				scalar or array; type: string
							star alias
 OUTPUTS:
	smei_star_alias 	same dimensions as 'alias'; type: string
							name from SMEI catalogue
							if the alias is not known the input
							value is left unchanged.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	where_common
 CALLED BY:
	big_eph, smei_star_fitone, smei_star_list
 EXAMPLE:
		name = smei_star_alias('Sirius')
	returns
		name = 'HD 48915'
 PROCEDURE:
	List of aliases and real names are hardcoded
 MODIFICATION HISTORY:
	AUG-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_star_fit $SSW/smei/ucsd/camera/idl/star/smei_star_fit.pro
[Previous] [Next]
 NAME:
	smei_star_fit
 PURPOSE:
	Fit bright stars in sky map
 CATEGORY:
	ucsd/camera/idl/stars
 CALLING SEQUENCE:
	PRO smei_star_fit, file			, $

		hdr 		= hdr 			, $
		sky 		= sky			, $

		camera		= camera		, $
		origin		= origin		, $
		scale		= scale 		, $
		southpole	= southpole 	, $
		northpole	= northpole 	, $

		psf_map		= psf_map		, $
		psf_origin	= psf_origin	, $
		psf_scale	= psf_scale 	, $

		fovx_map	= fovx_map		, $
		fovx_origin	= fovx_origin	, $
		fovx_scale	= fovx_scale 	, $

		nofovx		= nofovx 		, $

		time_map	= time_map		, $
		time_origin	= time_origin	, $
		time_scale	= time_scale 	, $

		stime		= stime 		, $
		etime		= etime 		, $

		final_sky	= final_sky 	, $
		stars_sky	= stars_sky		, $
		stars_fit	= stars_fit 	, $
		stars_info	= stars_info	, $

		count		= count 		, $

		upto_mags	= upto_mags		, $
		bkgnd_radius= bkgnd_radius	, $
		bkgnd_origin= bkgnd_origin	, $
		bkgnd_count = bkgnd_count	, $

		stars_list	= stars_list 	, $
		catalogues	= catalogues 	, $
		degrees 	= degrees		, $

		kill_crowd	= kill_crowd	, $
		fix_centroid= fix_centroid	, $
		noplane		= noplane 		, $
		zero_intercept=zero_intercept,$
		use_filled_psf=use_filled_psf,$

		skip_dist	= skip_dist 	, $
		incl_dist	= incl_dist 	, $
		max_stars	= max_stars 	, $

		badfit		= badfit		, $
		show		= show			, $
		silent		= silent		, $

		sigma		= sigma
 INPUTS:
	file					scalar; type; string
								fully-qualified file name of sky map
 OPTIONAL INPUT PARAMETERS:
	/degrees				if set then all angles are in degrees (default: radians)

	hdr=hdr 				array[1]; type: structure
								sky map header
	sky=sky 				array[n,m]; type: float
								2D sky map

	camera=camera
	origin=origin
	scale=scale

	/southpole				if set, then fit stars in north polar map
	/northpole				if set, then fit stars in south polar map
								By default stars are fit in the equatorial map

	stars_list=stars_list	array; type: SMEI_STAR_LIST structure
								list of stars to be fitted
								These can be extracted from the SMEI
								star catalogues with smei_star_list.
							array: type: string
								alternatively a list of star names are specified
								A call to smei_star_list is made to convert
								the list to a SMEI_STAR_LIST structure
	catalogues=catalogues	scalar or array; type: string;
								list of star catalogues to be used
								Passed to  smei_star_list.
								NOT used if keyword stars_list is set.
	upto_mags=upto_mags 	scalar; type: float; default: 6.0
								maximum SMEI magnitude; only stars
								brigther than this are removed.

	bkgnd_radius=bkgnd_radius
							scalar or array[2]; type: float
								eventually processed by smei_star_standard.
	bkgnd_origin=bkgnd_origin
							array[2]; type: float
								eventually processed by smei_star_standard.
	bkgnd_count=bkgnd_count
							scalar; type: float (<= 1.0) or integer (> 1)
								passsed to smei_star_lsqbins.

	/fix_centroid			if set, then the star centroid is included in the fit
								(this slows down the star fitting considerably).
	/noplane				if set, suppress fit of planar background, and fit a
							   constant background instead (default: fit
							   planar background).
	/zero_intercept 		passed to smei_star_lsqfit
	/use_filled_psf 		passed to smei_star_standard

	/kill_crowd
	skip_dist=skip_dist 	scalar; type: float; default: 0.25 degrees
								nearby fainter stars at angular distances less
								then 'skip_dist' away are not fit
	incl_dist=incl_dist 	scalar; type: float; default: 0.75 degrees
								nearby fainter stars at angular distances
								less than 0.75 degrees (and more than /skip_dist)
								are included when fitting a star.
	max_stars=max_stars		scalar; type: integer; default: 2
								maximum number of stars fitted together.
								If more than 'max_stars' stars pass the
								'incl_dist' criterion, than only the
								brightest 'max_stars' are included in the fit
								(for a fit of 1+max_stars stars).
	sigma=sigma 			scalar; type: float
								?
	show=show				scalar; type: star
								name of star for which results are displayed
								This should be one of the names from the
								SMEI star catalogue.
								Set show='*' to display results for all stars
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
	final_sky=final_sky
	stars_sky=stars_sky
	stars_fit=stars_fit
	count=count 			scalar; type: integer
								number of stars fitted and subtracted
								count=0 if the skymap was not found or if
								no stars with valid intensity or psf angle
								were found. If count=0 then stars_fit will not
								exist.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	AngleRange, AngleUnits, BadValue, CORRELATE, Elongation, InitVar, IsTime, IsType
	LocalExtrema, MEAN, MagnifyArray, STDDEV, TimeLimits, TimeOp, TimeSet, TimeString
	TimeUnit, ToDegrees, ToRadians, View, WhatIs, destroyvar, gridgen, hide_env, jpl_body
	jpl_eph, jpl_mag, smei_coriolis, smei_sky, smei_star_formatpnt, smei_star_info
	smei_star_list, smei_star_lsqbins, smei_star_lsqfit, smei_star_standard
	smei_star_stdmaps, twin
 EXTERNAL:
	smei_star_fit__define
 CALLED BY:
	smei_star_fitone, smei_star_remove
 PROCEDURE:
	The information needed for the star removal is:

	sky 			2D-sky map
	map type		type of sky map (south pole, north pole, equatorial map)
	origin			array indices for RA=dec=0 (eq map) or indices of pole (polar map)
	resolution		number of degrees/radians per bin
	camera			SMEI camera (each camera has its own standard star map)

	psf_map 		equatorial 2D-sky map with rotation angles for the stars
	psf_origin		array indices for RA=dec=0
	psf_resolution	number of degrees/radians per bin in the psf map

	time_map 		equatorial 2D-sky map with times (secs since start of orbit)
	time_origin		array indices for RA=dec=0
	time_resolution	number of degrees/radians per bin in the psf map
					(note that the time_map and psf_map always have the same
					structure, i.e. the same origin and resolution).

	This information can be supplied in a number of different ways:

	1. Set 'file' to the fully-qualified file name of a sky map
		All information is extracted from the file by smei_sky.
		Information in other keywords is ignored.
		Note that by default the equatorial map is processed, unless
		/southpole or /northpole is set.

	2. Set keyword 'hdr' to the header of a sky map previously read by
		smei_sky. 'hdr' provides all the information needed,
		include the map type (equatorial, south- or northpole).
		The skymap itself can be supplied in keyword 'sky' (it probably
		is available from the same smei_sky call that set 'hdr'. If absent
		then the original skymap is read (the file name is in 'hdr').
		All other keywords are ignored. The psf and time maps are always
		read from file by smei_sky.

	3. Explicitly provide all information in the appropriate keywords.
		Defaults are set to the values currently used for the sky maps
		produced by smei_htm.


	Stars are fitted and subtracted starting with the brightest stars
	and working down to the fainter stars down to the cutoff magnitude
	'upto_mags'.

	If a star is being fitted its immediated is searched for other
	fainter stars (that have not been processed yet). Fainter stars within
	an angular distance of 'skip_dist' are immediately marked as 'done'
	and will not be fitted on the assumption that its psf is
	indistinguishable from the psf of the brighter star.

	If there are additional fainter stars with angular distance between
	'skip_dist' and 'incl_dist' than these stars are included in the fit
	for the bright stars. Upto 'max_stars' additional are fitted. The
	results of the fit are used only to get the best possible fit for
	the bright star. The fainter stars will be fitted again separately
	(after the bright star has been removed).

	By default a planar (sloped) background is fitted. If keyword
	/noplane is set then a constant background is fitted.

	By default the star locations in the SMEI star catalogue are used
	as fixed centroids. If keyword /fix_centroid is set then a brute
	force iteration scheme is used to improve the fit by fitting the
	centroid location also. This is mainly useful for detecting 'bad
	quaternion' episodes in the SMEI data. Setting /fix_centroids
	slows the program down considerably.

	Fitting of the plane background and the star brightnesses is done
	using linear least squares fits. lsqLinearFit implements fits
	upto four dimension as analytic expressions, allowing for fitting
	of two stars with a planar background of three stars with a constant
	background. For fits in more dimension a matrix inversion is used.

	The planets Mercury,Venus,Mars,Jupiter,Saturn and Uranus are
	subtracted using their apparent visual magnitudes to control
	the order of subtraction.

 MODIFICATION HISTORY:
	NOV-2005, Paul Hick (UCSD/CASS)
	FEB-2006, Paul Hick (UCSD/CASS)
		Replaced keyword /plane by keyword /noplane. By default
		a sloped background is fitted unless suppressed by /noplane.
	AUG-2006, Paul Hick (UCSD/CASS)
		Keyword star_list can now also be a list of star names from
		the SMEI catalogues.
		If no stars are left to be fitted the procedure will now always
		return with count=0 and final_sky and stars_sky existing.
		(it used to abort in some situations).
	SEP-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added /use_filled_psf keyword
		Added stars_info keyword


smei_star_fitone $SSW/smei/ucsd/camera/idl/star/smei_star_fitone.pro
[Previous] [Next]
 NAME:
	smei_star_fitone
 PURPOSE:
	Fit specified star for all skymaps in specified
	time range, and write results to file
 CATEGORY:
	sat/idl/star
 CALLING SEQUENCE:
	PRO smei_star_fitone, tt, name, camera=camera,	$
		use_filled_psf=use_filled_psf,				$
		filename=filename, _extra=_extra
 INPUTS:
	tt		array[2]; type: time structure
				time range
	name	scalar; type: string; default: Sirius
				name of star
 OPTIONAL INPUT PARAMETERS:
	camera=camera
			scalar; type: integer
				camera number (1,2,3)
	filename=filename
			scalar; type: string; default: $TEMP/<name>.txt
				name of output file
	/use_filled_psf
			passed to smei_star_fit.
				selects the PSF to be used
	_extra=_extra
			additional keywords for smei_star_fit
 OUTPUTS:
	(to file)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
	smei_star_fit__define
 CALLS: ***
	FILEPATH, InitVar, smei_getfile, smei_star_alias, smei_star_fit, smei_star_list
	smei_star_writepnt
 PROCEDURE:
 MODIFICATION HISTORY:
	SEP-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_star_formatpnt $SSW/smei/ucsd/camera/idl/star/smei_star_formatpnt.pro
[Previous] [Next]
 NAME:
	smei_star_formatpnt
 PURPOSE:
	Controls formatting of time series files
 CATEGORY:
	camera/idl/star
 CALLING SEQUENCE:
	FUNCTION smei_star_formatpnt, get_titles=get_titles, get_format=get_format, get_timefmt=get_timefmt
 OUTPUTS:
	/get_titles 		if set then return string of column titles that preceeds the numbers
							in the time series files
	/get_format 		if set then return the format string used to write the smei_star_fit
							structures produced by smei_star_fit
	/get_timefmt		if set then return the format used to write the time of observation
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar
 CALLED BY:
	smei_star_fit, smei_star_readpnt, smei_star_writepnt
 PROCEDURE:
 MODIFICATION HISTORY:
	AUG-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_star_info $SSW/smei/ucsd/camera/idl/star/smei_star_info.pro
[Previous] [Next]
 NAME:
	smei_star_info
 PURPOSE:
	Retrieves info about stars from the SMEI star catalogue
 CATEGORY:
 CALLING SEQUENCE:
	FUNCTION smei_star_info, star, degrees=degrees, count=count,	$
		get_ra_dec=get_ra_dec, rectangular=rectangular, get_struct=get_struct,	$
		get_number=get_number, get_name=get_name,				$
		get_obafg=get_obafg, get_magv=get_magv, get_magb=get_magb,	$
		get_mags=get_mags, _extra=_extra
 INPUTS:
	star				array; type: structure
							smei_star_list structure returned by smei_star_list.
 OPTIONAL INPUT PARAMETERS:
	/get_number 		get number from smei catalogue
	/get_ra_dec 		get RA and declination (this is also the default)
	/get_name 			get ascii name for star
	/get_obafg			get spectral class
	/get_magv			get visual magnitude
	/get_magb			get blue magnitude
	/get_mags			get SMEI magnitude

	If 'star' does not exist on input, or is not specified then smei_star_list
	is called to read the star catalogues. All keywords to smei_star_list can be
	used to control which star catalogues are read.
 OUTPUTS:
	result				array[2,*] or array[*]; type: depends on keywords
							if none of the /get* keywords is set then the
							equatorial location of the stars are returned in
							radians or degrees
							(depending on setting of /degrees keyword).
							array[0,*] is the right ascension
							array[1,*] is the declination

							Otherwise the quantity indicated by the get* keyword
							is returned.
 OPTIONAL OUTPUT PARAMETERS:
	star				if 'star' does not exist on input then the result from a
						call to smei_star_list is returned
	count=count 		# stars in 'star' structure
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	AngleUnits, CV_COORD, InitVar, IsType, smei_star_list
 CALLED BY:
	big_eph, qEphem_State, smei_frm_where, smei_star_fit, smei_star_list
 PROCEDURE:
	Returns fields from the 'star' structure
 MODIFICATION HISTORY:
	FEB-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_star_list $SSW/smei/ucsd/camera/idl/star/smei_star_list.pro
[Previous] [Next]
 NAME:
	smei_star_list
 PURPOSE:
	Reads content of star catalogues used for star subtraction in SMEI frames
 CATEGORY:
	camera
 CALLING SEQUENCE:
	FUNCTION smei_star_list, root=root, silent=silent, count=count,	$
		name=name, catalogues=catalogues, pos=pos
 OPTIONAL INPUT PARAMETERS:
	root=root		scalar; type: string 
						directory where star catalogue files are located.
						By default, this is a subdirectory 'list' in the
						directory where this file is located.
	name=name		array; type: string
						list of star names; only the data for the
						specified stars are returned.
	catalogues		scalar or array; type: string;
						default: ['brightstars','variables_4th','big_variables']
						list of catalogues to be used. Must be one or more of
						the entries on the defaults list (lowercase! and NO typos!).
	/silent			suppresses informational messages
 OUTPUTS:
	star			array; type: structure
						'smei_star_list' structure array for all stars in the
						selected fields
 OPTIONAL OUTPUT PARAMETERS:
	count=count		scalar; type: integer
						# stars in return array 'star'
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	FILEPATH, InitVar, IsType, UNIQ [1], UNIQ [2], UNIQ [3], smei_star_alias
	smei_star_info, txt_read, where_common, who_am_i
 CALLED BY:
	qEphem_State, smei_star_fit, smei_star_fitone, smei_star_info
 RESTRICTIONS:
	Small declinations (-1<lat<0) need special attention: the minus sign
	needs to be put in front of the first non-zero component (i.e. minutes
	or arcseconds)
 PROCEDURE:
 MODIFICATION HISTORY:
	JAN-2003, Paul Hick (UCSD/CASS)
	MAR-2003, Paul Hick (UCSD/CASS)
		Rewrite to deal with single bright star catalogue
	JAN-2004, Paul Hick (UCSD/CASS)
		Added big_variables.txt and variables_4th.txt
	NOV-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Removed duplicate entries from list of stars (this should take
		care of the overlap between 'brightstars' and 'big_variables'
		catalogues.


smei_star_lsqbins $SSW/smei/ucsd/camera/idl/star/smei_star_lsqbins.pro
[Previous] [Next]
 NAME:
	smei_star_lsqbins
 PURPOSE:
	Refine PSF and background area definition based on
	properties of the original star.
 CATEGORY:
 CALLING SEQUENCE:
	PRO smei_star_lsqbins, original_star, rr, rr0, in_psf, in_bkgnd, bkgnd_count=bkgnd_count
 INPUTS:
	original_star	array[nx,ny]; type: float
						area from original skymap around the star to be subtracted
						(current a 50x50 box i.e 5x5 degrees)
	rr				array[2,nx*ny]; type: integer??
						column and row indices into original skymap for all bins
						in original_star
	rr0 			array[2,nx*ny]; type: float
						x,y locations relative to the centroid of the star
						(in the same units as rr, i.e. bin spacings)
	in_psf			array[nx,ny]; type: byte
						1: bin is inside the PSF
						0: bin is outside the PSF
	in_bkgnd		array[nx,ny]; type: byte
						1: bin is included in background area
						0: bin is not included in background area
 OPTIONAL INPUT PARAMETERS:
	bkgnd_count=bkgnd_count
					scalar; type: float (<=1.0) or integer (n > 1)
						sets the maximum number of pixels to be retained for
						the background area (in the in_bkgnd array).
						bkgnd_count >  1  : maximum number of bins to be retained
						bkgnd_count <= 1.0: maximum fraction of current number of
											background bins to be retained
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	IsType
 CALLED BY:
	smei_star_fit
 PROCEDURE:
	The first filter on in_psf and in_bkgnd is that only bins with finite
	values in original star are left non-zero.

	If bkgnd_count is defined than the background array in_bkgnd is modified
	so that at most bkgnd_count bins are left non-zero. These will be the bins
	in the background with the lowest value in original_star.
	Note that in_bkgnd is NOT modified if there are already less than
	bkgnd_count bins in it.
 MODIFICATION HISTORY:
	AUG-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_star_lsqfit $SSW/smei/ucsd/camera/idl/star/smei_star_lsqfit.pro
[Previous] [Next]
 NAME:
	smei_star_lsqfit
 PURPOSE:
	Performs multi-dimensional least-squares fit between observed star
	and standard star
 CATEGORY:
	camera/idl/star
 CALLING SEQUENCE:
	FUNCTION smei_star_lsqfit, rr, standard_stars, original_star, in_psf, in_bckgnd,	$
		back, bright, sigma=sigma, only=only, noplane=noplane,	$
		bkgnd_model=bkgnd_model, one_star_model=one_star_model, zero_intercept=zero_intercept
 INPUTS:
	rr					array[2,n]; type: float
							position vectors for all bins in the box around
							the star, relative to the star centroid
							(in units of the bin size of the skymap from
							which the star was extracted).
	standard_stars		array[n,m]; type: float
							intensities in equivalent locations in standard
							star for all bins around star
							The 2nd dimension indicates the m stars fitted
							simultaneously (absent if m=1)
	original_star		array[nx,ny] (with nx*ny=n); type: float
							intensities in box around star as extracted
							from the original skymap.
	in_psf				array; type: long
							list of array indices into rr, standard_stars and
							original_star that should be included in the fit
							for the star PSF
	in_bckgnd			array; type: long
							list of array indices to be used to fit the background.
							If this is a valid list of indices (i.e. if
							in_bckgnd[0] NE -1 then these pixels are used to fit
							a background separately from the fit to the PSF.
							The fit is to a plane or, if /noplane, is SET the
							mean of the background pixels is used.
 OPTIONAL INPUTS:
	sigma=sigma 		scalar; type: float
							if set then a second fit is made after discarding
							bins that are more than 'sigma' standard deviations
							in the residual after the first fit.
	only=only			array; type: integer
							set of indices into the 'ifit' array
							Only the subset of bins in 'only' are used in the fit
	/noplane			if set, then fit constant background (i.e. do
						not fit a sloped background
	/zero_intercept 	passed to lsqLinearFit for fitting of PSF only if
						background and PSF are fitted separately (i.e. if
						in_bckgnd contains a valid list of background bins)
 OUTPUTS:
	smei_star_lsqfit	array[nx,ny]; type: float
							the resulting lsq fit to the PSFs of all stars fitted
							simultaneously.
							star_model[nx,ny] = (Sum(m))bright[m]*standard_stars[n,m]
	back				array[3]; type: float
							constants for fit of background
							back[0] intensity at the centroid of the star
								(i.e. at the origin of the rr position vectors)
							back[1:2] horizontal and vertical slope of the background
	bright				array[m]; type: float
							brightness fit for all stars
 OPTIONAL OUTPUTS:
	bkgnd_model=bkgnd_model
				 		array[nx,ny]; type: float
							the resulting lsq fit for the planar background
	one_star_model=one_star_model
						array[nx,ny,n]; type: float
							the resulting lsq fit to the brightest of the stars
							one_star_model[nx,ny,i] = bright[i]*standard_stars[n,i]
							This is equal to the return value if only one star is fitted
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, IsType, MEAN, STDDEV, lsqLinearFit
 CALLED BY:
	smei_star_fit
 PROCEDURE:
 MODIFICATION HISTORY:
	DEC-2006, Paul Hick (UCSD/CASS)
	AUG-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added in_bckgnd argument to be able to fit background and star separately


smei_star_readpnt $SSW/smei/ucsd/camera/idl/star/smei_star_readpnt.pro
[Previous] [Next]
 NAME:
	smei_star_readpnt
 PURPOSE:
	Reads time series files into smei_star_fit structure
 CATEGORY:
	camera/idl/star
 CALLING SEQUENCE:
	FUNCTION smei_star_readpnt, filename, hdr=hdr
 INPUTS:
	filename		scalar; type: string
						fully-qualified filename
 OUTPUTS:
	smei_star_readpnt
 OPTIONAL OUTPUT PARAMETERS:
	hdr=hdr 		array; type: string
						header (lines at beginning of file starting
						with semi-colon)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	boost, destroyvar, smei_star_formatpnt
 EXTERNAL:
	smei_star_fit__define
 PROCEDURE:
 MODIFICATION HISTORY:
	AUG-2006, Paul Hick (UCSD/CASS)
	SEP-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added hdr keyword


smei_star_remove $SSW/smei/ucsd/camera/idl/star/smei_star_remove.pro
[Previous] [Next]
 NAME:
	smei_star_remove
 PURPOSE:
	Removes bright stars from SMEI orbital sky maps
 CATEGORY:
	ucsd/camera/idl/star
 CALLING SEQUENCE:
	PRO smei_star_remove, wanted_map , $
		camera		= camera		, $
		source		= source		, $
		digsource	= digsource 	, $
		destination = destination	, $
		overwrite	= overwrite 	, $
		silent		= silent		, $
		keepbkgnd	= keepbkgnd 	, $
		from_mode	= from_mode 	, $
		to_mode 	= to_mode		, $
		use_filled_psf=use_filled_psf,$
		_extra		= _extra
 INPUTS:
	wanted_map		array[n]; type: string, time structure or integer
						passed to smei_sky_get+
						Selects skymap files to be processed
	destination 	scalar; type: string; default: $TEMP
						destination directory of subtracted skymap
						and star time series file
 OPTIONAL INPUT PARAMETERS:
	source=source	scalar; type: string
						passed to smei_sky_get
						source directory for sky maps

	The following two keywords are passed to smei_sky_file only if the input
	'wanted_map' is a time structure:

	/digsource
	camera=camera	scalar, or array[n]; type: integer; default: 1
						one or more cameras. If more than one camera is specified
						all files for the specified 'wanted_map' time are processed.

	/silent 		if set, suppresses informational messages
	upto_mags=upto_mags
		 			scalar; type: float; default: 6.0
						maximum SMEI magnitude; only stars brighter than this are removed.
						(passed to smei_star_fit)
	/keepbkgnd	if set, the sidereal background (Milky Way, faint stars, etc.) is not
						subtracted from the skymaps after the bright stars are subtracted.
						
	/use_filled_psf passed to all smei_star_standard calls

	_extra=_extra	The _extra keyword is passed to smei_star_fit, so check
					that procedure for additional input keywords.
 OUTPUTS:
	Files in destination directory
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CheckDir, FILEPATH, FXADDPAR [1], FXADDPAR [2], FXPAR [1], FXPAR [2], GetFileSpec
	HEADFITS [1], HEADFITS [2], HEADFITS [3], InitVar, IsTime, IsType, MKHDR [1]
	MKHDR [2], READFITS [1], READFITS [2], READFITS [3], TimeSplit, WRITEFITS [1]
	WRITEFITS [2], gzip_file, hide_env, smei_camera_gain, smei_frm_name, smei_sky_file
	smei_sky_get, smei_star_fit, smei_star_writepnt
 EXAMPLE:
	smei_star_remove, 1500
		Subtract stars for orbit 1500 (specified as integer) for camera 1
	smei_star_remove, smei_coriolis([1500,1501]), camera=[1,2,3]
		Subtract stars for orbits 1500 and 1501 (specified as time structure) for all three cameras
	smei_star_remove, '2003/04/16 18:25:57'
		Subtract stars for orbit 1500 specified as time string
	smei_star_remove, '*.fts.gz'
		Use dialog_pickfile to select single skymap
	smei_star_remove, 'c1sky_2006_045_021031.fts.gz'
		Subtract stars for specified map
 PROCEDURE:
	For each skymap a new skymap (Fits file) with the star-subtracted maps is
	created, and an ASCII file with information about the fitted stars.
	Both files are created in the destination directory.
 MODIFICATION HISTORY:
	NOV-2005, Paul Hick (UCSD/CASS)
	JUN-2006, Paul Hick (UCSD/CASS)
		Modified to accept arrays as input in wanted_map argument.
	JUN-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added Fits keyword VERSION to sky map
		Added NAME, CREATED and VERSION keywords to time series file
		Added keyword /overwrite
	JUL-2006, Jordan Vaughan, Paul Hick (UCSD/CASS; pphick@ucsd.edu)	V2.0
		Added subtraction of sidereal background map (can be disabled
		by keyword /keepbkgnd)

		Added two extensions to output Fits file copied from original skymap:
		-extension 6: fraction of orbit (extension 7 from original skymap)
		-extension 7: time in sec since first frame used (extension 8 from original skymap)

		Keyword VERSION is now called BSTARVER (to distinguish it from
		keyword BKGNDVER (the version of the sidereal background map)
		Keyword MILKYWAY is now called BKGND
		If the sidereal backgound is subtracted keyword BKGND is set to 1, and two
		more keywords are added:
		BKGNDVER is the version of the sidereal background map
		BKGAIN   is the gain correction (multiplicative factor) applied to the
		sidereal background map before subtracting it.

		Fixed problem with header for extension 4 (map of removed stars in
		equatorial map.
	AUG-2006, Paul Hick (UCSD/CASS)	V3.0
		Modifications related to separate fitting of background and PSF.
		Added couple of entries to smei_star_fit structure.
		Time series file is now written by procedure smei_star_writepnt
	AUG-2006, Paul Hick (UCSD/CASS)	V3.0
		Padded records in time series file with 5 spaces to make them
		exactly the same length as the titles record.
	SEP-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu) V3.1
		Added /use_filled_psf keyword
		Added stars_info keyword to smei_star_fit and smei_star_writepnt


smei_star_standard $SSW/smei/ucsd/camera/idl/star/smei_star_standard.pro
[Previous] [Next]
 NAME:
	smei_star_standard
 PURPOSE:
	Read in the standard star map
 CATEGORY:
	camera/idl/star
 CALLING SEQUENCE:
	FUNCTION smei_star_standard, camera 		, $
		bkgnd_radius							, $
		fovxangle								, $
		bkgnd_origin		= bkgnd_origin		, $
		degrees 			= degrees			, $
		get_origin			= get_origin		, $
		get_ndim			= get_ndim			, $
		get_fov 			= get_fov			, $
		get_scale			= get_scale 		, $
		get_adus			= get_adus			, $
		get_nomansland_id	= get_nomansland_id , $
		get_background_id	= get_background_id , $
		get_wayoutside_id	= get_wayoutside_id , $
		use_filled_psf		= use_filled_psf	, $
		show				= show
 INPUTS:
	camera			scalar; type: integer; default: 2
						camera number (1,2,3)
	bkgnd_radius	scalar or array[2]; type: float; default: none
						Radius of circle around centroid of standard star
						used to define the background area around the PSF
						If two radii are specified than the ring in between
						the two circles is used to define the background area
	fovxangle		scalar; type: float: default: 0.0
						Only used  if bkgnd_radius is set to non-zero value
						Setting fovxangle to a non-zero angle will turn the
						background area into an ellipse with a semi-major
						axis of bkgnd_radius/cos(fovxangle)
 OPTIONAL INPUT PARAMETERS:
	bkgnd_origin=bkgnd_origin
					array[2]; type: float; default: [0,0]
						only used if bkgnd_radius is set.
						Shifts the origin of the ellipsoidal background area
						The units are the same as bkgnd_radius (i.e. radians or
						degrees, depending on setting of /degrees).
	/get_origin 	if set return origin (array indices for RA=0, dec=0) of
						standard star map
	/get_ndim		if set return dimensions of standard star map
	/get_fov		if set return width of standard map in angular units
						This is the product of the return values for the /get_ndim
						and /get_scale keywords.
	/get_scale		if set return scale (angular units per bin) of standard
						star map
	/get_adus		if set return average adus in PSF
	/show			if set display standard star map
 OUTPUTS:
	See /get_origin, /get_scale, /get_ndim or /get_adus for return value if
	one of these keywords is set. If no keyword is set:

	std_map			array[n,n]; type: float
						2D standard star map of 200x200 bins
						map >  0 inside PSF (brightness of standard star)
						map = -1 inside inner radius, but outside PSF
								(not present if bkgnd_radius is a scalar (outer radius only)
						map = -2 inside outer radius, but outside PSF and outside
								inner radius (if specified)
						map = -3 outside outer radius, and outside PSF
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLED BY:
	smei_star_fit, smei_star_stdmaps, smei_star_writepnt
 COMMON BLOCKS:
	common smei_star_standard_save, std_psf, std_cam, std_origin, std_scale, std_adus, std_map
 CALLS: ***
	FILEPATH, FXPAR [1], FXPAR [2], InitVar, IsType, MEAN, READFITS [1], READFITS [2]
	READFITS [3], ToDegrees, ToRadians, View, destroyvar, gridgen, who_am_i
 PROCEDURE:
	The standard star is store in Fits file standard_star.fts.gz
	in the same directory as this procedure.
	The standard map is a 200x200 array covering a 5x5 deg area (0.025 deg/bin).
	for each camera. It contains positive-definite values defining the PSF
	and zero everywhere else.

	Only outer radius specified:
	The input values bkgnd_radius and fovx are used to define an ellipsoidal
	area around the center of the map. Bins outside the ellipse are set to -3.
	Bins inside the ellipse (but not in the PSF) are set to -2.
	The output map contains -3, -2, and positive-definite values.

	Both inner and outer radius specified:
	The input values bkgnd_radius and fovx are used to define an ellipsoidal
	ring around the center of the map. 
	Bins outside the outer ellipse are set to -3.
	Bins inside the ring between inner and outer ellipse (but not in the PSF) are set to -2.
	Bins inside the inner ellipse (but not in the PSF) are set to -1
	The output map contains -3, -2, -1, and positive-definite values

	The bins with value -2 in the output map can be used to define a background
	area around the PSF.
 MODIFICATION HISTORY:
	AUG-2006, Paul Hick (UCSD/CASS)
	AUG-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added /use_filled_psf keyword to work with alternative PSF map


smei_star_stdmaps $SSW/smei/ucsd/camera/idl/star/smei_star_stdmaps.pro
[Previous] [Next]
 NAME:
	smei_star_stdmaps
 PURPOSE:
	Get brightness in standard star at indicated locations
 CATEGORY:
	camera/idl/star
 CALLING SEQUENCE:
	FUNCTION smei_star_stdmaps, camera, $
		maptype 		, $
		rr				, $
		origin			, $
		scale			, $	
		radec			, $
		psfangle		, $
		fovxangle		, $
		degrees 	 = degrees 		, $
		bkgnd_radius = bkgnd_radius	, $
		bkgnd_origin = bkgnd_origin , $
		in_psf		 = in_psf		, $
		in_bkgnd	 = in_bkgnd 	, $
		std_rr		 = std_rr		, $
		use_filled_psf=use_filled_psf
 INPUTS:
	camera			scalar; type: integer
						camera id (1,2,3)
	maptype 		scalar; type: integer
						-1: map of south pole
						 0: equatorial map
						+1: map of north pole
	rr				array[2,n]; type: integer
						column and row indices into original skymap
						for all bins in box around star
	origin			array[2]; type: float
						array indices of RA=0, dec=0 (equatorial map)
						or position of pole (polar maps)
	scale			scalar; type: float
						map resolution (radians/degrees per bin)
	radec			array[2,m]; type: float
						RA and dec of star centroids
	psfangle		array[m]; type: float
						orientations of PSF relative to equatorial north
	fovxangle		array[m]; type: float
						cosine of direction cosine angle along long
						dimension of field of view
 OPTIONAL INPUTS:
	/degrees		all angles in degrees (default: radians)
	bkgnd_radius=bkgnd_radius
					scalar or array[2]; type: float
						passed to smei_star_standard.
	bkgnd_origin=bkgnd_origin
					array[2]; type: float
						passed to smei_star_standard
	/use_filled_psf if set, use the alternative PSF map
 OUTPUTS:
	smei_star_stdmaps
					array[n,m]; type: float
						brightness in standard star map at
						the equivalent location of rr in the standard star.
	in_psf=in_psf
					array[n]; type: byte
						1B identifies locations inside PSF
	in_bkgnd=in_bkgnd
					array[n]; type: byte
						1B identifies locations in background area
	std_rr=std_rr	array[2,n,m]; type: float
						equivalent RA,dec in standard star
						with abs(RA) < 180 degrees
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	AngleRange, BILINEAR, EulerRotate, ToDegrees, ToRadians, smei_star_standard
 CALLED BY:
	smei_star_fit
 PROCEDURE:
	See Section 6 in http://supercat.ucsd.edu/reports/smei.pdf
 MODIFICATION HISTORY:
	JUN-2006, Paul Hick (UCSD/CASS)
	JUL-2006, Jordan Vaughan (jtvaugha@ucsd.edu)
		Added costhetax argument
	JUL-2006, Paul Hick (UCSD/CASS)
		Modified the linear interpolation on the standard map.
		The 'missing data' value now is -1.0 instead of 0.0.
		The value 0.0 is now used to indicate bins used to sample
		the background.
	JUL-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added /use_filled_psf keyword


smei_star_writepnt $SSW/smei/ucsd/camera/idl/star/smei_star_writepnt.pro
[Previous] [Next]
 NAME:
	smei_star_writepnt
 PURPOSE:
	Write fit informations for bright star to file
 CATEGORY:
	camera/idl/star
 CALLING SEQUENCE:
	PRO smei_star_writepnt, filename, stars_fit, version=version,	$
		dec_cutoff=dec_cutoff, camera=camera, append=append,		$
		use_filled_psf=use_filled_psf, stars_info=stars_info
 INPUTS:
	filename			scalar; type: string
						Fully-qualified filename
	stars_fit			array; type: structure
						Structure with information from fits of bright star
						(from output keyword stars_fit in smei_star_fit.
						If stars_fit is NOT defined and /append is NOT set then
						just the header is written.
 OPTIONAL INPUT PARAMETERS:
	append=append		if set, the append to existing file
						if NOT set, a new file is created. The file 
						starts with a header.
	camera=camera		scalar; type: integer; default: none
						camera ID (1,2 or 3)
						If present, a line is added to the header with the
						mean intensity (in adus) in the standard star
	dec_cutoff			scalar; type: float; default: none
						If present, stars are written to file only if:
						abs(dec(star) LE dec_cutoff in equatorial map
						dec_star GT dec_cutoff in north polar map
						dec_star LT -dec_cutoff in south polar maps
						If NOT present, all stars are written to file
						Note that the units of dec_cutoff (degrees or radians)
						must be consistent with the units for RA,dec stored
						in the 'stars_fit' structure.
	/use_filled_psf 	passed to smei_star_standard
	stars_info=stars_info
						array; type: string
						string array containg fit parameters used by smei_star_fit.
						This is added to the header (if /append NOT set).
 OUTPUTS:
	(to ASCII file)
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	GetFileSpec, InitVar, IsType, TimeString, TimeSystem, TimeUnit, boost, hide_env
	smei_star_formatpnt, smei_star_standard
 CALLED BY:
	smei_star_fitone, smei_star_remove
 PROCEDURE:
 MODIFICATION HISTORY:
	AUG-2006, Paul Hick (UCSD/CASS)
	SEP-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added /use_filled_psf keyword


SMEI_SUBTRACT_MODEL $SSW/smei/bham/idl/cli/smei_subtract_model.pro
[Previous] [Next]
 NAME:
	SMEI_SUBTRACT_MODEL


 PURPOSE:
	Subtract a background model from a SMEI sequence.


 CATEGORY:
	CLI


 CALLING SEQUENCE:
	smei_subtract_model, seqref, model


 INPUTS:
	seqref	object	The smei_sequence object on which to operate.
	model	string	The model identifier for the model to subtract.

 KEYWORD PARAMETERS:
	/restore	If set, then restore the original processed
			image.


 CALLS: ***
	self_help, smei_msg
 SIDE EFFECTS:
	The processed image is updated.


 RESTRICTIONS:
	Cannot be used on compacted images.


 MODIFICATION HISTORY:
	Original: 25/5/04; SJT
	Add restore key: 23/9/04; SJT


smei_theta2radial $SSW/smei/ucsd/camera/idl/toolbox/smei_theta2radial.pro
[Previous] [Next]
 NAME:
	smei_theta2radial
 PURPOSE:
	Converts from angle thetay in the sky to radial offset
	Rccd-R0 on the CCD
 CATEGORY:
	camera
 CALLING SEQUENCE:
	R = smei_theta2radial(thetay [, thetax])
 INPUTS:
	thetay		array[*]; type: any
					thetay argument for Eq. 3
 OPTIONAL INPUT PARAMETERS:
	thetax		array[*] or array[2,*]; type: same as thetay
					if thetax is absent then Equation 2 from the memo is
					used (= Eq. 3 with thetax=0)

					CASE 1: array[*]: if thetax is an array with the same structure
						as thetay then the radial offset from Eq. 3 is returned
					CASE 2: array[2,*]: this is used by smei_radial2theta to determine the
						zero for Eq 3 for given thetax and radial offset.
						thetax[0,*]: stores the thetax values
						thetax[1,*]: stores the radial offset values
 OUTPUTS:
	R			array[*]; type: same type as thetax
					CASE 1: radial offset from Eq 3 in pixels
					CASE 2: radial offset from Eq 3, minus radial offset specified in
						thetax[1,*] (the value of thetay that makes this difference zero is
						the value that smei_radial2theta is after).
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL BY:
	smei_radial2theta
 CALLS: ***
	IsType, SubArray
 CALLED BY:
	smei_cv, smei_sky2ccd
 PROCEDURE:
	See Andy's memo "Defining the field of view for the SMEI cameras" (11-July-2001)
	This function implements Equation 3. All angles are in degrees.
 MODIFICATION HISTORY:
	FEB-2003, Paul Hick (UCSD/CASS)
	JAN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Modification to intercept large thetay values


smei_time $SSW/smei/ucsd/camera/idl/toolbox/smei_time.pro
[Previous] [Next]
 NAME:
	smei_time
 PURPOSE:
	Extract time range and duration from name of SMEI-related file
 CATEGORY:
	camera/idl/buf
 CALLING SEQUENCE:
	ut = smei_time( name, duration=duration )
 INPUTS:
	name			scalar; type: string
						file name
 OUTPUTS:
	ut				array[n] or array[n,2]: type: time structure
						start and stop time
 OPTIONAL OUTPUT PARAMETERS:
	duration=duration
					array[1]; type: time difference structure
						duration (= time between start and stop time)
	/range
	/noduration 	if set, do not check for duration
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	GetFileSpec, InitVar, SetFileSpec, TimeOp, TimeSplit, flt_string, smei_coriolis
 CALLED BY:
	smei_buf_splitfile, smei_coriolis, smei_frm_get, smei_frm_name, smei_frm_path
	smei_frm_property, smei_frm_read, smei_getfile, smei_hdr_update
	smei_orbits_stat, smeidb_mounted
 PROCEDURE:
	Files that can be processed include:

	L1A files  : L1A_YYYY_DDD_hhmmss_hhmmss (4 underscores)
	SMEI frames: c1frm_YYYY_DOY_hhmmss (3 underscores)
	CVID files : COR_SVAL3_2004_163_12_06_V (6 underscores)
				     FBKS_2004_163_12_06_V (5 underscores)

	The number of underscores are used to dissect the name.
 MODIFICATION HISTORY:
	JUL-2003, Paul Hick (UCSD/CASS)
	JUN-2004, Paul Hick (UCSD/CASS)
		CVID files without the COR_ prefix started to appear.
		Modified to handle the new situation: if 6 underscores
		are present in a VCID file (/xband set) then the first
		one is skipped (it used to skip the first underscore
		unconditionally)
	OCT-2004, Paul Hick (UCSD/CASS)
		Fixed bug in calculation of duration of L1A file.
	APR-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added option to get time from string 'orbit_12345' in
		file name


smei_TimePosn $SSW/smei/ucsd/camera/idl/toolbox/smei_timeposn.pro
[Previous] [Next]
 NAME:
	smei_TimePosn
 PURPOSE:
	Dissect name of SMEI-related file
 CATEGORY:
	camera/idl/toolbox
 CALLING SEQUENCE:
	pos = smei_TimePosn(names, camera=camera, id=id, time=time, format=format)
 INPUTS:
	names			array; type: string
						list of file names (name only, NO directories)
 OUTPUTS:
	pos 			array: type: integer
						start position of time in 'names'; -1 if no time is found
 OPTIONAL OUTPUT PARAMETERS:
	camera=camera	array; type; integer
						camera number
	id = id 		array; type: string
						string id of SMEI file type, e.g. 'm0','m1','m2','sky',etc.
	time=time		array; type: time structure
						time extracted from file name
	format=format	array; type: string
						format used to extract time
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	SyncArgs, TimePosn, strposn
 CALLED BY:
	img_read, qImage_cw_Property
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_zodiac_fit $SSW/smei/ucsd/camera/idl/zld/smei_zodiac_fit.pro
[Previous] [Next]
 NAME:
	smei_zodiac_fit
 PURPOSE:
	Fit bright stars in sky map
 CATEGORY:
	ucsd/camera/idl/stars
 CALLING SEQUENCE:
	PRO smei_zodiac_fit, file		, $

		tt			= tt			, $
		sky_eq		= sky_eq		, $
		sky_np		= sky_np		, $
		sky_sp		= sky_sp		, $

		camera		= camera		, $

		origin_eq	= origin_eq		, $
		scale_eq	= scale_eq 		, $

		origin_np	= origin_np		, $
		scale_np	= scale_np 		, $

		origin_sp	= origin_sp		, $
		scale_sp	= scale_sp 		, $

		stime		= stime 		, $
		etime		= etime 		, $

		final_sky	= final_sky 	, $

		degrees 	= degrees		, $

		badfit		= badfit		, $
		show		= show			, $
		silent		= silent
 INPUTS:
	file					scalar; type; string
								fully-qualified file name of sky map
 OPTIONAL INPUT PARAMETERS:
	/degrees				if set then all angles are in degrees (default: radians)

	sky_eq=sky_eq 			array; type: float
								equatorial map
	sky_np=sky_np 			array; type: float
								map of north pole
	sky_sp=sky_sp 			array; type: float
								map of south pole

	camera=camera

	origin_eq=origin_eq
	scale_eq=scale_eq
	origin_np=origin_np
	scale_np=scale_np
	origin_sp=origin_sp
	scale_sp=scale_sp
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
	final_sky=final_sky
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS:
	CvSky, InitVar, IsType, TimeLimit, TimeSystem, TimeUnit, ToDegrees, ToRadians, gridgen
	hide_env, smei_coriolis, smei_sky
 CALLED BY:
	smei_zodiac_remove
 PROCEDURE:
 MODIFICATION HISTORY:
	SEP-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


smei_zodiac_model $SSW/smei/ucsd/camera/idl/zld/smei_zodiac_model.pro
[Previous] [Next]
 NAME:
	smei_zodiac_model
 PURPOSE:
	Implements the current analytic fit to the zodiacal dust cloud for the
	SMEI observations
 CATEGORY:
	camera/idl/dust
 CALLING SEQUENCE:
	FUNCTION smei_zodiac_model, tt, rr, degrees=degrees, ecliptic=ecliptic, equatorial=equatorial
 INPUTS:
	tt			array[1]; type: time structure
					UT time at which zodiacal dust cloud brightness is required
	rr			array[2,*]; type: float or double
					angles defining the lines of sight for which brightness is required

					rr[0,*] is ecliptic longitude of los relative to Sun
					rr[1,*] is ecliptic latitude of los

					if /ecliptic is SET:
					rr[0,*] is ecliptic longitude of los
					rr[1,*] is ecliptic latitude of los

					if /equatorial is SET:
					rr[0,*] is right ascension of los
					rr[1,*] is declination of los

					The units of the angles are set by keyword /degrees
					NOTE: it is allowed to specify rr as an array[3,*] with the
					3rd element in the first dimension the line of sight distance
					(only the angles are used)
 OPTIONAL INPUT PARAMETERS:
	/degrees	if SET the angles in argument 'rr' are in degrees; default is radians
	/equatorial if SET then 'rr' is specified in equatorial coordinates
	/ecliptic	if SET then 'rr' is specified in ecliptic coordinates
					if neither /equatorial nor /ecliptic is set then 'rr' is
					assumed to be in sun-centered ecliptic coordinates
 OUTPUTS:
	result		array[*]; type: double
					the model brightness of the zodiacal dust cloud
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	AngleRange, AngleUnits, CvSky, InitVar, big_eph, jpl_body
 EXAMPLE:
	To get the zodiacal dust cloud brightness on an equatorial grid with a resolution
	of one degree at the current time:

	tt = TimeSystem()
	rr = gridgen([360,180],/open,range=[[0,360],[-90,90]],/multid)
	zz = smei_zodiac_model(tt,rr,/degrees,/equatorial)

	returns an double precision array zz[360,180].
 PROCEDURE:
	Purely empirical fit

	The brightness scale corresponds to camera 2 at nominal gain 1.
	To subtract this model from a skymap the map needs to multiplied by the
	time- and camera-dependent gain factor returned by smei_camera_gain.
 MODIFICATION HISTORY:
	AUG-2006,  Jordan Vaughan (jtvaugha@ucsd.edu), Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Based on Andys zodiac_model.for, but substantially rewritten for IDL.


smei_zodiac_remove $SSW/smei/ucsd/camera/idl/zld/smei_zodiac_remove.pro
[Previous] [Next]
 NAME:
	smei_zodiac_remove
 PURPOSE:
	Removes zodiacal dust cloud from SMEI orbital sky maps
 CATEGORY:
	ucsd/camera/idl/zld
 CALLING SEQUENCE:
	PRO smei_zodiac_remove, wanted_map , $
		camera		= camera		, $
		source		= source		, $
		digsource	= digsource 	, $
		destination = destination	, $
		overwrite	= overwrite 	, $
		silent		= silent		, $
		from_mode	= from_mode 	, $
		to_mode 	= to_mode		, $
		_extra		= _extra
 INPUTS:
	wanted_map		array[n]; type: string, time structure or integer
						passed to smei_sky_get+
						Selects skymap files to be processed
	destination 	scalar; type: string; default: $TEMP
						destination directory of subtracted skymap
						and star time series file
 OPTIONAL INPUT PARAMETERS:
	source=source	scalar; type: string
						passed to smei_sky_get
						source directory for sky maps

	The following two keywords are passed to smei_sky_file only if the input
	'wanted_map' is a time structure:

	/digsource
	camera=camera	scalar, or array[n]; type: integer; default: 1
						one or more cameras. If more than one camera is specified
						all files for the specified 'wanted_map' time are processed.

	/silent 		if set, suppresses informational messages

 OUTPUTS:
	Files in destination directory
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	CheckDir, FILEPATH, FXADDPAR [1], FXADDPAR [2], FXPAR [1], FXPAR [2], GetFileSpec
	HEADFITS [1], HEADFITS [2], HEADFITS [3], InitVar, IsTime, IsType, MKHDR [1]
	MKHDR [2], READFITS [1], READFITS [2], READFITS [3], WRITEFITS [1], WRITEFITS [2]
	gzip_file, hide_env, smei_frm_name, smei_sky_file, smei_sky_get, smei_zodiac_fit
 EXAMPLE:
 PROCEDURE:
 MODIFICATION HISTORY:
	SEP-2005, Paul Hick (UCSD/CASS)


SMEI_ZOOM $SSW/smei/bham/idl/cli/smei_zoom.pro
[Previous] [Next]
 NAME:
	SMEI_ZOOM


 PURPOSE:
	To set zoom factors for SMEI display


 CATEGORY:
	CLI (sequence)


 CALLING SEQUENCE:
	smei_zoom, seqref, factor[, /inverse, smooth=smooth]


 INPUTS:
	seqref	objref	Object reference of a SMEI sequence
	factor	int	Factor by which to zoom the display. (For
			reductions, use the /inverse key)


 KEYWORD PARAMETERS:
	/inverse	If set, then the zoom factor is 1/factor
	smooth	int	1 to smooth expanded image, 0 to use blocky expansion.


 CALLS: ***
	self_help, smei_msg
 MODIFICATION HISTORY:


smeidb_mounted $SSW/smei/ucsd/camera/idl/frm/smeidb_mounted.pro
[Previous] [Next]
 NAME:
	smeidb_mounted
 PURPOSE:
	Check whether SMEI data base is accessible
 CATEGORY:
	camera/idl/misc
 CALLING SEQUENCE:
	ff = smeidb_mounted( tf, drive=drive )
 INPUTS:
	tf			scalar, or array[1]
						either a time (in the form of a standard
						time structure), or the name of a SMEI frame
						(e.g. 'c2frm_2003_123_456789')
 OPTIONAL INPUT PARAMETERS:
	The SMEI frames are stored in directories of the form
	$SMEIDB#/yyyy_doy/c#.
 OUTPUTS:
	sts	scalar; type: string
			directory where frame(s) for specified time are located
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLED BY:
	smei_orbits_stat
 COMMON BLOCKS:
	common smei_frm_path_save, checkdrives, sdat
 CALLS: ***
	CheckDir, FILEPATH, InitVar, IsTime, IsType, TimeGet, TimeSet, destroyvar, flt_read
	flt_string, smei_frm_path, smei_time, who_am_i
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


SMEIremoteDisplay__define $SSW/smei/ucsd/sat/idl/remoteview/smeiremote/smeiremotedisplay__define.pro
[Previous] [Next]
 NAME:
	SMEIremoteDisplay__define
 PURPOSE:
	Defines SMEIremoteDisplay class structure	
 CATEGORY:
	SMEIremote
 CALLING SEQUENCE:
	display = obj_new('SMEIremoteDisplay')
 INPUTS:
 INCLUDE:
	@compile_opt.pro			; On error, return to caller
 PROCEDURE:
 MODIFICATION HISTORY:
	AUG-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


SMEIremoteFOV__define $SSW/smei/ucsd/sat/idl/remoteview/smeiremote/smeiremotefov__define.pro
[Previous] [Next]
 NAME:
	SMEIremoteFOV__define
 PURPOSE:
	Defines SMEIremoteFOV class structure
 CATEGORY:
	SMEIremote
 CALLING SEQUENCE:
	fov = obj_new('SMEIremoteFOV')
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
 CALLS:
 SEE ALSO:
 SIDE EFFECTS:
 RESTRICTIONS:
 EXAMPLE:
 PROCEDURE:
 MODIFICATION HISTORY:
	AUG-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


SMEIremoteMatrix__define $SSW/smei/ucsd/sat/idl/remoteview/smeiremote/smeiremotematrix__define.pro
[Previous] [Next]
 NAME:
	SMEIremoteMatrix__define
 PURPOSE:
	Defines SMEIremoteMatrix class structure
 CATEGORY:
	SMEIremote
 CALLING SEQUENCE:
	fov = obj_new('SMEIremoteMatrix')
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
 CALLS:
 SEE ALSO:
 SIDE EFFECTS:
 RESTRICTIONS:
 EXAMPLE:
 PROCEDURE:
 MODIFICATION HISTORY:
	AUG-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


SMEIremoteView__define $SSW/smei/ucsd/sat/idl/remoteview/smeiremote/smeiremoteview__define.pro
[Previous] [Next]
 NAME:
	SMEIremoteView__define
 PURPOSE:
	Defines SMEIremoteView class structure
 CATEGORY:
	SMEIremote
 CALLING SEQUENCE:
	fov = obj_new('SMEIremoteView')
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 EXTERNAL:
 CALLS:
 SEE ALSO:
 SIDE EFFECTS:
 RESTRICTIONS:
 EXAMPLE:
 PROCEDURE:
 MODIFICATION HISTORY:
	AUG-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


statpos $SSW/smei/ucsd/sat/idl/toolbox/tricks/statpos.pro
[Previous] [Next]
 NAME:
	statpos
 PURPOSE:
	Calculate position of average, median and maximum of array
 CATEGORY:
	Statistics
 CALLING SEQUENCE:
	result = statpos(A)
 INPUTS:	(read-only)
	A	array		array for which median value is requested
						A should already represent a histogram
						If it isn't use one of the histogram
						keywords
 OPTIONAL INPUT PARAMETERS:
	min=min
	max=max
	binsize=binsize
					if any one of these keywords is set then
					array Y is fed to the IDL histogram function
					with these keywords.
 OUTPUTS:
	STATPOS		3 element float array
		StatPos[0]	position of average ('center of mass')
		StatPos[1]	position of median
		StatPos[2]	position of maximum
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, IsType
 CALLED BY:
	bargraph
 PROCEDURE:
	The values returned by StatPos are based on the array index, i.e.
	0 <= StatPos[i] <= n_elements(A)-1  (i=0,1,2)

	Note that the average calculated here from the histogram depends
	on the bin size. Use the mean function if that's a problem.
 MODIFICATION HISTORY:
	MAY-1993, Paul Hick (UCSD/CASS)


stopwatch $SSW/smei/ucsd/sat/idl/toolbox/tricks/stopwatch.pro
[Previous] [Next]
 NAME:
	stopwatch
 PURPOSE:
 CATEGORY:
	Totally unnecessary
 CALLING SEQUENCE:
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, IsType, TimeOp, TimeString, TimeSystem, TimeUnit
 CALLED BY:
	flt_read
 COMMON:
	common	stopwatch_start_time, save_start
 MODIFICATION HISTORY:
	JUL-2003, Paul Hick (UCSD/CASS)


strposn $SSW/smei/ucsd/gen/idl/toolbox/strposn.pro
[Previous] [Next]
 NAME:
	strposn
 PURPOSE:
	Locates a substring in an array of strings and returns
	string arrays for preceding and trailing parts. By default, the
	substring is removed, but can be retained using keywords
	TrailingFront or LeadingBack
 CATEGORY:
	string manipulation
 CALLING SEQUENCE:
	Index = strposn(Strings, Substr, Front, Back)
 INPUTS:
	Strings		string array or scalar  (read-only)
	Substr		string scalar (read-only)
			If not specified the scalar Substr=',' (comma) is used
 OPTIONAL INPUT PARAMETERS:
	/last		if set, search is for the last occurence of Substr
			(similar to rstrpos; default is to search for the
			first occurence, similar to strpos)
	/frontdefault	if set, strings which do not contain Substr
			are returned in the Front array
			(by default these strings will be returned in Back)
	/trailingfront	if set, and Substr is found it will be attached to
			the end of the Front array (i.e. SubStr is used as a
			terminator).
	/leadingback	if set, and Substr is found it will be attached to the
			front of the Back array (i.e. Substr is used as a prefix)
 OUTPUTS:
	Index		long integer array of same structure as Strings
			Contains the starting positions of SubStr (set to -1
			for strings not containing SubStr) i.e. same as for
			strpos and rstrpos
	Front		string variable of same structure as Strings.
			Contains the sections of the strings preceding SubStr
			- includes Substr if Trailingfront is set
			- includes strings not containing SubStr if
			  Frontdefault is set
	Back		string variable of same structure as Strings.
			Contains the sections of the strings following SubStr
			- includes Substr if Leadingback is set
			- includes strings not containing SubStr unless
			  Frontdefault is set
 OPTIONAL OUTPUT PARAMETERS:
	(None)
 CALLS: ***
	InitVar, REVERSE, SyncDims, UNIQ [1], UNIQ [2], UNIQ [3]
 CALLED BY:
	GetFileSpec, PutFileSpec, SetFileSpec, TimePosn, TimePosn_test, smei_TimePosn
	www_help_crosslinks, www_help_make, www_help_names, www_help_tree
 SIDE EFFECTS:
 	TrailingFront and LeadingBack are mutually exclusive. If both are
	present TrailingFront takes precedence.
 RESTRICTIONS:
	None
 PROCEDURE:
 MODIFICATION HISTORY:
	DEC-1997, Paul Hick (UCSD/CASS)
	MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Improved efficiency. Removed one of the two remaining explicit DO-loops,
		made the second more compact.


STRUCT_CONTAINS $SSW/smei/bham/idl/utils/struct_contains.pro
[Previous] [Next]
 NAME:
	STRUCT_CONTAINS


 PURPOSE:
	Utility function to see if structure contains a particular tag
	name


 CATEGORY:
	Utils


 CALLING SEQUENCE:
	ok = struct_contains(struct, tag)


 INPUTS:
	struct	The structure to search.
	tag	The tag to be searched for.


 OUTPUTS:
	ok	byte	1 if the structure contains the tag, 0 otherwise



 CALLED BY:
	FF_SUMMARY
 MODIFICATION HISTORY:
	Original: 7/3/03; SJT


SubArray $SSW/smei/ucsd/gen/idl/toolbox/subarray.pro
[Previous] [Next]
 NAME:
	SubArray
 PURPOSE:
	Extract/add/multiply subarrays in a multi-dimensional array
 CATEGORY:
	Array strangling
 CALLING SEQUENCE:
	R = SubArray(L)			Extract subarray with dimension=0, element=0
	R = SubArray(L,add=1)	Add 1 to subarray with dimension=0, element=0
 INPUTS:
	L			any multi-dimensional array
 OPTIONAL INPUT PARAMETERS:
	dimension=dimension scalar; type: integer
							identifies one of the dimensions, 0,..,(size(L))[0]-1
	/lastdimension		selects the trailing dimension of L, i.e.
							equivalent to dimension=(size(L))[0]-1
							(/lastdimension takes precedence over the dimension keyword)

	If neither 'dimension' nor 'lastdimension' are used, then dimension=0 is assumed

	element=element 	scalar; type: integer
							identifies one of the elements in the selected dimension,
							0,..,(size(L))[Dimension+1]-1
	/lastelement			selects the last element of the selected dimension, i.e.
							equivalent to element=(size(L))[Dimension+1]-1.

	If neither 'element' nor 'lastelement' are used, then element=0 is assumed

	add=add				scalar or array with same # elements as the subarray identified
							by (dimension, element). 'Add' will be added to the subarray.
	multiply=multiply	scalar or array with same # elements as the subarray identified
							by (dimension, element). 'multiply' will be multiplied to
							the subarray.'multiply' is executed prior to 'add'
	replace=Replace		replaces elements
							Takes precedence over 'add' and 'multiply'
	/clear				sets elements to zero (numerical input) or null-string (string input)
							Take precedence over 'multiply'

	type=type			makes a subarray of the appropriate type (filled with zeroes)

	If neither of 'type','add','multiply','replace' and 'clear'  is used, then
	the selected subarray will be extracted.
 OUTPUTS:
	If 'add' or 'multipy' or 'replace', or 'clear' are used:
		Input array with the selected subarray modified.
	If 'type is set then a subarray of the selected type is returned
	Otherwise:
		Array with one dimension less than the input array, corresponding
		to the selected subarray.
 INCLUDE:
	@compile_opt.pro		; On error, return to caller
 CALLS: ***
	InitVar, IsType
 CALLED BY:
	AngleUnits, CenterOfMass, CvMag, CvSky_Equatorial, CvSky_GSE, CvSky_GSEQ, CvSky_GSM
	CvSky_Geographic, CvSky_Heliographic, CvSky_Precess, CvSky_RTN, Distance2Line
	Elongation, EulerRotate, GeographicInfo, Inside_Wedge, RotationMeasure, ScEarth
	TMO_skymotion, ThomsonBrightness, ThomsonLOSDensity, TimeArray, TimeGet, img_read
	jpl_phase, lsqCircleFit, qImage_cw_BoxCosine, quadraticfit, smei_ccd2sky, smei_cv
	smei_radial2theta, smei_theta2radial, vu_atlocation, vu_cvgrid, vu_fnc
	vu_type_insitu
 EXAMPLES:
		L = indgen(2,3,4)
		R = SubArray( L,  dimension=1, element=2)
			returns L[*,2,*] as an 2x4 array.
		R = SubArray( L,  dimension=1, element=2, add=1)
			returns L with one added to L[*,2,*].
 PROCEDURE:
	Trivial
 MODIFICATION HISTORY:
	MAR-1998, Paul Hick (UCSD/CASS)
	OCT-2004, Paul Hick (UCSD/CASS)
		Modifications to allow string input for /clear and /replace
	MAR-200r, Paul Hick (UCSD/CASS, pphick@ucsd.edu)
		Added type=type keyword.


SuperArray $SSW/smei/ucsd/gen/idl/toolbox/superarray.pro
[Previous] [Next]
 NAME:
	SuperArray
 PURPOSE:
	Add a dimension to an array
 CATEGORY:
	Array strangling
 CALLING SEQUENCE:
	R = SuperArray(L, N)
 INPUTS:
	L		numerical scalar or array
	N		int scalar
				# elements in the extra dimension
 OPTIONAL INPUT PARAMETERS:
	!!! dimensions are counted 1,..,size(L)

	/lead	new dimension is first dimension
	/trail	new dimension is last dimension
	after=After
			insert new dimension after dimension After
	before=Before
			insert new dimension before dimension Before
 OUTPUTS:
	Array with one dimension of N elements more than input variable
 CALLS: ***
	IsType
 CALLED BY:
	AngleUnits, ColorPolarBox, ColorSkybox, CvMag, CvSky, CvSky_Equatorial, CvSky_GSEQ
	CvSky_GSM, CvSky_Geographic, CvSky_Heliographic, CvSky_Precess, Distance2Line
	Distance2Sun, EarthSky3DLoc, EarthTransit3DLoc, Elongation, EulerRotate
	FrameMoments, Get_Page, HOSOrbit, IPS_hlevel_w, MagnifyArray, RGBO_DepthCue
	RGBO_Project, RemoteView, RemoteView_Display2D, RemoteView_Display3D
	RemoteView_FOV, RemoteView_Init_Matrix, RemoteView_Init_View
	RemoteView_StereoStates, SyncArgs, SyncArgsSub, TMO_skymotion, TMO_tracksky
	ThomsonLOSDensity, TimeArray, TimeGet, big_eph, even_light, even_light_corrections
	even_light_info, img_read, jpl_mag, jpl_phase, lsqLinearFit, mpc_eph, plot3darc
	qImage_cw_BoxCosine, qImage_cw_ZEllipse, qView_FileFilter, qView_ModifyData
	qView_PickFiles, qView_PlotSeries, qView_SubtractBase, sgp4_eph, sgp4_tlm
	smei_frm_flatfield, smei_frm_where, smei_radial2theta, smei_sky, unitvectors
	vu_RemoteView, vu_atlocation, vu_check, vu_earthskymap, vu_mean, vu_read
	vu_synopticmap, vu_timeseries, wedge_content
 EXAMPLE:
		R = SuperArray( indgen(3,4,5), 10, after=2)
		creates an array R[3,4,10,5)
 PROCEDURE:
	The basic building block is the expression replicate(1,N)#L
	Reform and transpose are used to control the array structure.
 MODIFICATION HISTORY:
	MAR-1998, Paul Hick (UCSD/CASS)
	FEB-2000, Paul Hick (UCSD/CASS)
		added handling of string arrays.
	JUN-2003, Paul Hick (UCSD/CASS, pphick@ucsd.edu)
		Fixed bug adding to array with trailing dummy dimension.	


SyncArgs $SSW/smei/ucsd/gen/idl/toolbox/syncargs.pro
[Previous] [Next]
 NAME:
   SyncArgs
 PURPOSE:
	Change a list of arguments (usually a combination of scalars and
	arrays) to a list of arrays of equal size.
 CALLING SEQUENCE:
	SyncArgs, A0,A1 [,A2,A3,A4,A5,A6,A7,A8,A9]
 INPUTS:
	A0,...,A9	any type of argument
 OUTPUTS:
	A0,...,A9	arguments of same size
 CALLS:
	SuperArray
 CALLED BY:
	CombineRotations, EarthSky3DLoc, Elongation, GeographicInfo, HOSOrbit
	ThomsonLOSDensity, ThomsonLOSFar, ThomsonLOSRomb, ThomsonMidpointFar
	ThomsonPDistance, ThomsonPDistanceFar, TimeMonth, TimePosn, TimePosn_test, TimeSet
	TimeYDate, eclipsed_area, lsqCircleFit, nrZBrent, nrZbrac, quadraticfit
	scalarproduct, sgp4_orbit_period, smei_TimePosn, vectorproduct
 RESTRICTIONS:
	A maximum of 10 arguments is permitted
 PROCEDURE:
 >	Arguments that don't exist on input, will be created as type byte
	(unless none of the arguments exist)
 >	If no arrays are present a list of scalars is returned
 >	Arguments are changed to arrays with the same structure as the largest
	array in the list of arguments.
 >	If there is more than one such array, the first one in the list used
	as target. The others are reformed to match the target type
 >	Scalars and arrays with one element will always be changed to match
	the largest array.
 >	Arrays with size smaller than the target array are boosted to match
	the target array only if the dimensions are the same as the leading
	dimensions are the same as for the target array.
 MODIFICATION HISTORY:
	MAR-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


SyncArgsSub $SSW/smei/ucsd/gen/idl/toolbox/syncargssub.pro
[Previous] [Next]
 NAME:
	SyncArgsSub
 PURPUSE:
	Intenal use by SyncArgs only
 CALLS: ***
	SuperArray
 MODIFICATION HISTORY:
	MAR-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


SyncDims $SSW/smei/ucsd/gen/idl/toolbox/syncdims.pro
[Previous] [Next]
 NAME:
	SyncDims
 PURPOSE:
	Reforms A to have the same size (scalar or array) as specified in Size
 CATEGORY:
	Toolbox
 CALLING SEQUENCE:
	SyncDims, A, sizeinfo = size(SomeVariable)
	SyncDims, A, extendinfo = size(SomeVariable)
	SyncDims, A, replicateinfo = [size(Array1), size(Array2),...]
 INPUTS:
	A		scalar or array of any type
 OPTIONAL INPUTS:
	sizeinfo	'size and type' vector as returned by the IDL
			 	'size' function (only the size information is used)
 OUTPUTS:
	sizeinfo:
		A		input array with structure modified to match SizeInfo
				(note: array content is not tampered with)
	extendinfo:
		A
	replicateinfo:
		A		'size and type' vector, obtained by concatenating the
				information from the input 'size and type' vectors.
 CALLED BY:
	BZero, CenterOfMass, CvPointOnLos, Distance2Line, Elongation, EulerRotate, FishEye
	GetFileSpec, HammerAitoff, MercatorProj, NewcombSun, RemoteView_FOV_loc
	SetFileSpec, TMO_skymotion, TimeInterpol, TimeSplit, TimeString, coord3to2, nrZbrak
	qImage_cw_Transform, scalarproduct, smei_ccd2sky, smei_cv, smei_sky2cam
	smei_sky2ccd, strposn, vectorproduct, vu_atlocation
 RESTRICTIONS:
	No check is made that Size actually represents a valid size vector.
 PROCEDURE:
	Used usually before exiting a procedure to make sure that
	input and output array have exactly the same structure.
 MODIFICATION HISTORY:
	DEC-1997, Paul Hick (UCSD/CASS; pphick@ucsd.edu)