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:
	PRO set_page,	$
	    eps 	= eps	    , $
	    gif 	= gif	    , $
	    bmp 	= bmp	    , $
	    png 	= png	    , $
	    xysize	= xysize    , $
	    aspect	= aspect    , $
	    fullsize	= fullsize  , $
	    winaspect	= winaspect , $
	    landscape	= landscape , $
	    portrait	= portrait  , $
	    silent	= silent    , $
	    setup_only	= setup_only, $
	    file	= file	    , $
	    zbuffer	= zbuffer   , $
	    printer	= printer   , $
	    display	= display   , $
	    ctable	= ctable    , $
	    old_device	= old_device, $
	    new 	= new	    , $
	    bigsize	= bigsize   , $
	    xoff	= xoff	    , $
	    yoff	= yoff	    , $
	    smallsize	= smallsize , $
	    notwin	= notwin    , $
	    font	= font	    , $
	    flip_bw	= flip_bw   , $
	    flip_ct	= flip_ct
 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, destroyvar, do_file, flip_colors, twin
 CALLED BY:
	even_light_corrections, even_light_photometry, even_light_registration
	qset_page_submit, smei_frm_summary, smei_hdr_plot, smei_sky, smei_star_show
	smei_zldsky, vu_coronagraph, vu_earthskymap, vu_elotime, vu_insitu
	vu_insitu_persist, vu_planarcut, vu_solardisk, vu_spherecut, 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)
	    added /png keyword
	AUG-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    added /color to device call for EPS


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)


skycolors $SSW_SMEI_UCSD/sat/idl/shared/skycolors.pro
[Previous] [Next]
 NAME:
	skycolors


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)


sphere_distance $SSW_SMEI_UCSD/sat/idl/toolbox/math/sphere_distance.pro
[Previous] [Next]
 NAME:
	sphere_distance
 PURPOSE:
	Get angle between two vectors
 CATEGORY:
	sat/idl/toolbox/math
 CALLING SEQUENCE:
	FUNCTION sphere_distance, Los1, Los2, Los3, Los4, Los5, Los6, $
	    degrees	= degrees	, $
	    rectangular = rectangular	, $
	    eps 	= eps
 INPUTS:
	Los1, Los2	any arrays with 1st dimension of 2 or 3 elements
			containing vector coordinates in spherical
			(longitude, latitude, distance) or rectangular (x,y,z)
			coordinates.
 OPTIONAL INPUT PARAMETERS:
	/degrees	if set, all angles are in degrees (default: radians)
	/rectangular	if set, Los1 and Los2 are in rectangular (x,y,z) coordinates
 OUTPUTS:
	E		distances in range [0,180] degrees.
			The array size is the same as for the input array with
			the 1st dimension removed.
 OPTIONAL OUTPUT PARAMETERS:
	eps=eps 	position angle of Los2 relative to north at Los2
			(only works if /rectangular is NOT set)
 INCLUDE:
	@compile_opt.pro	    ; On error, return to caller
 CALLS: ***
	InitVar, IsType, SubArray, SuperArray, SyncArgs, SyncDims, ToRadians
 CALLED BY:
	PlotCoronagraph, PlotEarthSkymap, PlotEloTimeMap, RemoteView_FOV_Cube
	RemoteView_Init_FOV, ThomsonLOSRomb, ThomsonLOSStep, big_elongation, cv
	eclipsed_area, qnagoya_plot, smei_findpnt, smei_frm_summary, smei_hdr_plot
	smei_sgp4_orbits, smei_star_fit, smei_star_test, smei_zld_weekly
	sphere_great_arc, sphere_smooth, vu_point_source
 EXAMPLE:
	Specify vectors in spherical coordinates (all in the equatorial plane).
	Every vector in los2 is combined with the vector in los1. All angles are in degrees.

	los1 = [0,0,1]
	los2 = [[0,0,1], [45,0,1], [90,0,1], [135,0,1], [180,0,1]]
	e = sphere_distance(los1, los2, /degrees)
	print, e
	    0.000000	  45.0000      90.0000	    135.000	 180.000
	help, los1, los2, e
	    LOS1	    INT       = Array[3]
	    LOS2	    INT       = Array[3, 5]
	    E		    FLOAT     = Array[5]
 PROCEDURE:
	Apply the following to the longitude and latitude angles:
	L = acos( sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lng1-lng2) )
 MODIFICATION HISTORY:
	AUG-2000, Paul Hick (UCSD/CASS)
	DEC-2000, Paul Hick (UCSD/CASS)
	    Modified to accept vector arrays of any number of dimensions
	JUL-2006, Paul Hick (UCSD/CASS)
	    Added option to provide components of vectors seperately
	    (using 4 or 6 arguments).
	JUL-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Added keyword 'eps'. Renamed from 'elongation' to
	    'sphere_distance'


sphere_great_arc $SSW_SMEI_UCSD/sat/idl/toolbox/math/sphere_great_arc.pro
[Previous] [Next]
 NAME:
	sphere_great_arc
 PURPOSE:
	Returns array of points along great circle
	connecting two points on sphere
 CATEGORY:
	sat/widget/qimage_cw
 CALLING SEQUENCE:
	FUNCTION sphere_great_arc, los1, los2, $
	    npoints = npoints	, $
	    degrees = degrees
 INPUTS:
	los1
	los2
 OPTIONAL INPUT PARAMETERS:
	npoints = npoints
	/degrees
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	InitVar, SyncArgs, ToRadians, gridgen, sphere_distance
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


sphere_smooth $SSW_SMEI_UCSD/sat/idl/toolbox/math/sphere_smooth.pro
[Previous] [Next]
 NAME:
	sphere_smooth
 PURPOSE:
	Smooths data on a sphere
 CATEGORY:
	sat/idl/toolbox/math
 CALLING SEQUENCE:
	FUNCTION sphere_smooth, FF  , $

	    irange	= irange    , $
	    igrid	= igrid     , $     ; Input grid

	    odim	= odim_     , $     ; Output grid
	    orange	= orange    , $
	    ogrid	= ogrid     , $

	    width	= width     , $
	    gauss	= gauss     , $
	    degrees	= degrees   , $

	    weightfnc	= weightfnc , $

	    fillall	= fillall   , $
	    fillbad	= fillbad   , $
	    fillgood	= fillgood  , $

	    min_weight	= min_weight
 INPUTS:
	FF		array[N,M,L]; type: any numerical type
			    N: longitudinal dimension
			    M: latitudinal dimension
			    L: number of arrays to be smoothed
 OPTIONAL INPUT PARAMETERS:
	irange=irange	array[2,2]; type: float; default: [[0,360],[-90,90]]
			Specifies the range of the input grid on which
			F is defined
			    irange[*,0]: longitude range
			    irange[*,1]: latitude range
			The grid specifies a skymap in
			equirectangular projection
	igrid=igrid	array[2,N,M]; type: float
			Instead of giving irange, the grid can be specified
			explicitly:
			    igrid[0,*,*]: longitudes
			    igrid[1,*,*]; latitudes
			Note that the grid must still be equirectangular

	odim=odim	array[2]; type: integer; default: [N,M]
			    dimensions of smoothed output skymap
			    The dimensions must be smaller then/equal to
			    the input dimensions and must be a factor of
			    the input dimensions.
	orange=orange	array[2,2]; type: float; default: irange
			Specifies the range of the output grid on which
			R is defined.
			    orange[*,0]; longitude range
			    orange[*,1]: latitude range
			Again, this is a equirectangular grid.
	ogrid=ogrid	array[2,n,m]; type: float
			Instead of giving odim and orange, the output
			grid can be specified explicitly:
			    grid[0,*,*]: longitudes
			    grid[1,*,*]; latitudes
	width=width	scalare; type: float; default: 1 degree
			width used to select points near each grid point
			to be used for a weighted mean.
	/gauss		forces use of a Gaussian weighting function
			with width specified in keyword 'width'.
	/degrees	if set, all angles are in degrees; default: radians

	weight_fnc=weight_fnc
			name of user-defined function to be used to calculate
			weight (see PROCEDURE).

	min_weight	threshold for the weights. Smoothed values are ignored
			it the total weight of the contributing input bins
			is less then min_weight

	/fillbad	only fill-in 'bad' values (NaN in input array FF)
			with smoothed values. This is only allowed if the
			input dimension (N,M) are the same as the output
			dimension odim.
	/fillgood	only replace good values with smoothed values
	/fillall	fill all values (both good and bath) by smoothed
			values, i.e., same as setting both /fillbad, /fillgood.
			This is also the default if neither /fillbad or
			/fillgood is set.
 OUTPUTS:
	R		array[n,m]; type: same as FF
			    smoothed output skymap
 OPTIONAL OUTPUT PARAMETERS:
	igrid=igrid	if not defined on input, they are returned as calculated
	ogrid=ogrid	.. from the *dim and *range keywords.
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	AngleRange, ArrayLocation, BadValue, InitVar, IsType, SubArray, SuperArray, ToDegrees
	ToRadians, gridgen, sphere_distance
 PROCEDURE:
 >	If neither /gauss, nor weight_fnc is set than all points within
	'width' (angular separation) of a grid point will be averaged with
	the same weight.
 >	If /gauss is set a Gaussian weight is used in the calculation
	of the average (with weight exp(-(elo/width)^2). Contributing points
	will extend to about 3*width away in angular separation.
 >	A user-defined function weight_fnc can be used to calculate the weight.
	The function should have the form
	    W = weight_fnc(elo, width=width, degrees=degrees)
	with 'elo' (in units indicated by keyword 'degrees') the elongation,
	and 'width' the input argument 'width' to this function.
 MODIFICATION HISTORY:
	JAN-2008, Paul Hick (UCSD/CASS)
	APR-2008, Paul Hick (UCSD/CASS)
	    Bugfix. Weighting was done wrong.
	APR-2012, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Fixed problem with /fillbad keyword. Procedure will now abort
	    if /fillbad is set and (some) of the points from the output grid
	    are not present in the input grid (this is necessary to be able
	    to retain good values from input array in the output array.


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:
	FUNCTION statpos, Y	, $
	    min     = min	, $
	    max     = max	, $
	    binsize = binsize	, $
	    hist    = hist	, $
	    fraction= fraction
 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.
	fraction=fraction
			scalar; type: float; default: 0.5
			    sets the fraction used for the median
			    calculation, i.e. finds the position
			    where 'fraction' are lower and 1-fraction
			    are higher.
 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)
	JUL-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Added keyword 'fraction'


stopwatch $SSW_SMEI_UCSD/sat/idl/toolbox/tricks/stopwatch.pro
[Previous] [Next]
 NAME:
	stopwatch
 PURPOSE:
 CATEGORY:
	Totally unnecessary
 CALLING SEQUENCE:
	PRO stopwatch, set=set, start=start, stop=stop
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	InitVar, IsType, TimeGet, TimeOp, TimeSystem, TimeUnit
 CALLED BY:
	flt_read
 COMMON:
	common	stopwatch_start_time, save_start
 MODIFICATION HISTORY:
	JUL-2003, Paul Hick (UCSD/CASS)