ulysses_passage $SMEI/user/pphick/idl/drivers/ulysses_passage.pro
[Previous] [Next]
 NAME:
	ulysses_passage
 CALLING SEQUENCE:
	PRO ulysses_passage, module, rot, latitude=latitude, density=density
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	BadValue, FILEPATH, InitVar, InsituTimeSeries, Instrument, MEAN, PlotCurve
	READEARTHFILE, TIMEAXIS, TimeSet, WhatIs, bin_read, bin_write, flt_read


UlyssesOrbit $SMEI/ucsd/gen/idl/ephem/ulyssesorbit.pro
[Previous] [Next]
 NAME:
	UlyssesOrbit
 PURPOSE:
	Calculate position of Ulysses
 CATEGORY:
	smei/gen/idl/ephem
 CALLING SEQUENCE:
	FUNCTION UlyssesOrbit, T, degrees=degrees
 INPUTS:
	T	array[n]; type: time structure
		    times at which s/c positions are needed
 OPTIONAL INPUT PARAMETERS:
	/degrees    if set then angles are output in degrees (default: radians)
 OUTPUTS:
	Result	array[3,*]; type: float
		    J2000 ecliptic longitude (deg/rad), latitude
		    (deg/rad) and distance (AU).
		    The angular units depend on the setting of /degrees
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	BadValue, KeplerOrbit, TimeGet, TimeSet, ToDegrees
 CALLED BY:
	GetColors [3], PlotEarthSkymap [4], big_eph, vu_thomson_hammer
 RESTRICTIONS:
	The results of this routine were compared with J2000 ecliptic
	coordinates from http://cohoweb.gsfc.nasa.gov/helios/heli.html .
	For the most part the agreement is smaller than 0.1 degrees,
	but during the last two perihelion passages the discrepancy
	in longitude and latitude rises to 1-2 degrees.
	Adding more orbital elements where the discrepancies are
	largest does not fix the problem
 PROCEDURE:
	Orbital elements obtained herein are from JPL's HORIZONS System
	(http://ssd.jpl.nasa.gov/?horizons )
	(these are J2000 orbital elements)

	Earth-Jupiter segment (Oct 1990 - Dec 1991)

	2448400.500000000 = A.D. 1991-May-24 00:00:00.0000 (CT)
	 EC= 8.897464400966297E-01 QR= 9.956299449602790E-01 IN= 1.997907686222203E+00
	 OM= 1.336294632570382E+01 W = 7.973512530451710E+00 Tp=  2448177.155379012693
	 N = 3.632002010001063E-02 MA= 8.111881123489832E+00 TA= 1.165108914377567E+02
	 A = 9.030365512305314E+00 AD= 1.706510107965035E+01 PR= 9.911888787745871E+03

	First perihelion (1995/03/12):

	2449788.500000000 = A.D. 1995-Mar-12 00:00:00.0000 (CT)
	 EC= 6.031503055745338E-01 QR= 1.338815122439140E+00 IN= 7.913419307720035E+01
	 OM= 3.381812752049081E+02 W = 3.588812465846812E+02 Tp=  2449788.991885926574
	 N = 1.590604604763074E-01 MA= 3.599217603979999E+02 TA= 3.596037474470892E+02
	 A = 3.373607542718132E+00 AD= 5.408399962997124E+00 PR= 2.263290316914575E+03

	Second perihelion (2001/05/23):

	2452053.500000000 = A.D. 2001-May-24 00:00:00.0000 (CT)
	 EC= 6.031132414101130E-01 QR= 1.338990395270509E+00 IN= 7.912197709000114E+01
	 OM= 3.381356025082639E+02 W = 3.589804732058623E+02 Tp=  2452053.178729594219
	 N = 1.590515097125277E-01 MA= 5.109854306171003E-02 TA= 2.587555018718575E-01
	 A = 3.373734110021353E+00 AD= 5.408477824772197E+00 PR= 2.263417685570354E+03

	Third perihelion (2007/08/18):

	2454330.500000000 = A.D. 2007-Aug-18 00:00:00.0000 (CT)
	 EC= 5.905943668771040E-01 QR= 1.392971326172849E+00 IN= 7.864681204100637E+01
	 OM= 3.380855550555008E+02 W = 3.592550173721452E+02 Tp=  2454330.786102185957
	 N = 1.570440655511920E-01 MA= 3.599550693495362E+02 TA= 3.597836828567464E+02
	 A = 3.402423448713773E+00 AD= 5.411875571254696E+00 PR= 2.292350231360063E+03

    JDCT     Epoch Julian Date, Coordinate Time
      EC     Eccentricity, e
      QR     Periapsis distance, q (AU)
      IN     Inclination w.r.t xy-plane, i (degrees)
      OM     Longitude of Ascending Node, OMEGA, (degrees)
      W      Argument of Perifocus, w (degrees)
      Tp     Time of periapsis (Julian day number)
      N      Mean motion, n (degrees/day)
      MA     Mean anomaly, M (degrees)
      TA     True anomaly, nu (degrees)
      A      Semi-major axis, a (AU)
      AD     Apoapsis distance (AU)
      PR     Orbital period (day)
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS)
	JUL-2007, George Megally (UCSD/CASS; gmegally@ucsd.edu)
	JUL-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Replaced all orbit elements by elements at perihelion
	    from JPL Horizon.


unexpected_event $SMEI/ucsd/sat/idl/widget/unexpected_event.pro
[Previous] [Next]
 NAME:
	unexpected_event
 PURPOSE:
       Used to process unexpected events in widgets (i.e. events which are
	ignored by the event handler).
 CATEGORY:
 CALLING SEQUENCE:
	unexpected_event, event [,/destroy]
 INPUTS:
	event	    array[1]; type: structure
		    the event structure passed to the event handler
 OPTIONAL INPUT PARAMETERS:
	/destroy    if set, the event structure is destroyed (i.e. the scalar
		value 0L is returned in the input argument 'event'
 OUTPUTS:
	event	    if /destroy is set then event=0L is returned;
		if /destroy NOT set the input event structure is not modified
 CALLSE;
	InitVar
 CALLS: ***
	InitVar
 CALLED BY:
	qEphem, qImage, qImage_cw, qLoadCT, qRemoteView, qShow, qTool, qView, qslider_cw
	qsmei_sky, qvox, qvu
 PROCEDURE:
	The name of the structure is displayed, with a list of all structure fields
 MODIFICATION HISTORY:
       JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


unhide_env $SMEI/ucsd/gen/idl/toolbox/files/unhide_env.pro
[Previous] [Next]
 NAME:
	unhide_env
 PURPOSE:

 CATEGORY:
	gen/idl/toolbox
 CALLING SEQUENCE:
	spec = unhide_env(env_spec [,/directory]
 INPUTS:
	hidden_spec	scalar; type: string
			    file or directory specification
			    Usually starts with a $-sign
 OPTIONAL INPUTS:
	/directory	if set and hidden_spec='', then the
			    current directory is used
 OUTPUTS:
	spec		scalar; type: string
			    hidden_spec with the env var translated.
			    If something goes wrong (the env var
			    doesn't exist or points to a non-existent
			    directory, then spec = '' is returned
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	CheckDir, FILEPATH, GetFileSpec, InitVar, os_separator
 CALLED BY:
	qImage_Pick, qView_FileFilter, qView_PickFiles, qsmei_sky_pick
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


unique_only $SMEI/ucsd/gen/idl/toolbox/unique_only.pro
[Previous] [Next]
 NAME:
	unique_only
 PURPOSE:
	Return unique elements in array
 CATEGORY:
	gen/pro/toolbox
 CALLING SEQUENCE:
	FUNCTION unique_only, tmp
 INPUTS:
	tmp	array; type: any
 OUTPUTS:
	R	indices of unique elements in
		the same order as in the input
		array.
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	UNIQ
 CALLED BY:
	FindAllFiles, qsmei_sky_pick, smei_getfile
 PROCEDURE:
	The difference with the IDL uniq function is that
	the order of the elements in the original array
	is retained:
	IDL> a = [2,1]
	IDL> print, a[uniq(a,sort(a))]
       1       2
	print, a[unique_only(a)]
       2       1
 MODIFICATION HISTORY:
	FEB-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


unitvectors $SMEI/ucsd/gen/idl/toolbox/math/unitvectors.pro
[Previous] [Next]
 NAME:
	unitvectors
 PURPOSE:
	Find two orthogonal unit vectors perpendicular to vector r.
 CATEGORY:
	gen/idl/toolbox/math
 CALLING SEQUENCE:
	axes = unitvectors(r)
 INPUTS:
	r	array[3]; type: float
 OPTIONAL INPUT PARAMETERS:
	/sphere, /cylin, /rect
		    indicates the coordinate system used: spherical, cylindrical
		    or rectangular; default: rectangular
	/degrees    if spherical or cylindrical coordinates are used, setting this
		    keyword indicates that the angles are in degrees; default: radians
	/ascending  See PROCEDURE.
 OUTPUTS:
	axes	array[3,3]; type:float
		    x,y,z coordinates of three perpendicular unit vectors
		    axes[*,2] is a unit vector parallel to the input vectors r
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro	    ; On error, return to caller
 CALLS: ***
	CV_COORD, InitVar, SuperArray, T3D, WhatIs, vectorproduct
 CALLED BY:
	arrow3d, coriolis_map, miscfig, qvu_draw
 RESTRICTIONS:
	The input vector must have a non-zero length
 PROCEDURE:
 >	The unit vectors are returned so that axes[*,0], axes[*,1], axes[*,2] form
	a right-handed coordinate system with z-axis (axes[*,2]) along the input
	vector r, the x-axis (axes[*,0]) in the original x-y plane (i.e. pointing to
	either the ascending or descending node)
 > If /ascending is NOT set then the y-axis (axes[*,1]) will always have a positive
	z-component
 > If /ascending is SET then the x-axis is always pointing to the ascending
	node. The z-component of the y-axis will have the same sign as the z-component
	of the input vector.
 MODIFICATION HISTORY:
	AUG-1999, Paul Hick (UCSD/CASS)
	SEP-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Treat special case where input vector is along z-axis separately.


usno_body $SMEI/ucsd/gen/idl/ephem/usno_body.pro
[Previous] [Next]
 NAME:
	usno_body
 PURPOSE:
	Get list of asteroids for which ephemerides are available
 CATEGORY:
	smei/gen/idl/ephem; USNO Asteroid Ephemeris
 CALLING SEQUENCE:
	FUNCTION usno_body, asteroid,	$
	    file    = file  , $
	    silent  = silent, $
	    number  = number, $
	    index   = index , $
	    count   = count , $
	    total_count=total_count
 OPTIONAL INPUT PARAMETERS:
	asteroid	scalar or array; type: integer or string
			    integer: list of asteroid numbers
			    string : list of asteroid names
				only valid entries on this list are processed
				If not specified then all asteroids are processed
 OUTPUTS:
	Result		array[count]; type: string
			    list of asteroid names for which ephemeris files
			    are available; if none exist (count=0) then names=''
 OPTIONAL OUTPUT PARAMETERS:
	count=count	scalar; type: integer
			    # requested asteroids for which ephemeris files are present
			    i.e. # elements in input 'asteroid' 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
			    asteroid 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 # asteroids for which ephemeris files are present
	/silent 	if set, informational messages are suppressed
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	FILEPATH, GetFileSpec, InitVar, IsType, SetFileSpec, where_common, who_am_i
 CALLED BY:
	PlotPlanarCut, big_body, big_eph, big_orbit, smei_frm_where, smei_star_fit
	smei_star_test, usno_eph, usno_init
 PROCEDURE:
 >	The following 15 asteroids are available from the USNO AE98 ephemeris:
	    'Ceres','Pallas','Juno','Vesta','Hebe','Iris','Flora','Metis','Hygiea',
	    'Eunomia','Psyche','Europa','Cybele','Davida','Interamnia'
	The corresponding asteroid numbers are
	    1,2,3,4,6,7,8,9,10,15,16,52,65,511,704.
	The returned list of asteroid names are take from this list.
 >	The asteroid files are searched for in the subdirectory 'usno' of the
	directory where this procedure is located.
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


usno_close $SMEI/ucsd/gen/idl/ephem/usno_close.pro
[Previous] [Next]
 NAME:
	usno_close
 PURPOSE:
	Closes asteroid ephemeris files and frees heap memory used by ephemeris
 CATEGORY:
	smei/gen/idl/ephem; USNO Asteroid Ephemeris
 CALLING SEQUENCE:
	PRO usno_close
 INPUTS:
	(none)
 OUTPUTS:
	(none
 CALLED BY:
	big_eph, smei_frm_where, usno_test
 SEE ALSO:
	usno_init
 CALLS:
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 COMMON BLOCKS:
	common USNO_INFO, USNO_PNTR
 SIDE EFFECTS:
	Opens an ephemeris file and defines a heap variable.
 RESTRICTIONS:
	usno_close must be called separately to close all open asteroid
	files and free the memory used by the heap variables.
 PROCEDURE:
 >	Common block USNO_INFO contains the pointer array USNO_PNTR.

 >	If a pointer in the array is a valid heap pointer, then the associated asteroid
	has been initialized (file is open; heap variable exists).
	After usno_close is finished all asteroid files should be close
	and all heap memory released.
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Modified from USNO AE98 C-software


usno_eph $SMEI/ucsd/gen/idl/ephem/usno_eph.pro
[Previous] [Next]
 NAME:
	usno_eph
 PURPOSE:
	Get position and velocity of asteroid from USNO AE98 ephemerides
 CATEGORY:
	smei/gen/idl/ephem; USNO Asteroid Ephemeris
 CALLING SEQUENCE:
	FUNCTION usno_eph, UT, body, center=center, $
	    location	= location  , $
	    speed	= speed     , $
	    to_sphere	= to_sphere , $
	    degrees	= degrees   , $
	    precess	= precess   , $
	    to_ecliptic = to_ecliptic,$
	    get 	= get	    , $
	    silent	= silent
 INPUTS:
	UT	scalar; type: double
			Julian date when ephemerides are needed
	body	scalar; type: string or integer; default: 'ceres'
			asteroid name or asteroid number (see: usno_body)
 OPTIONAL INPUT PARAMETERS:
	center=center
		scalar; type: integer; default: jpl_body(/sun)
			by default, heliocentric coordinates are returned.
			if center is set to a non-zero value between 1 and 9
			then the coordinates are centered on the corresponding
			planet (e.g. center=3 returns geocentric coordinates)
 OUTPUTS:
	Result	array[6] or array[6,*]; type: double
			array[0:2,*] = position in AU
			array[3:5,*] = velocity in AU/day
			If the asteroid ephemeris could not be determined
			(because the ephemeris file could not be located or because
			the Julian day JD is outside the range of the ephemeris)
			then all six components are set to the double precision NaN
			value !values.d_nan.
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	AngleRange, BadValue, CV_COORD, CvPrecess, CvSky, InitVar, IsTime, IsType, TimeGet
	TimeSet, jpl_eph, usno_body, usno_init, usno_maket, usno_read
 CALLED BY:
	big_eph, smei_frm_where, smei_star_fit, usno_test
 COMMON BLOCKS:
	common USNO_INFO, USNO_PNTR
 RESTRICTIONS:
	If the center keyword is used then the jpl ephemeris is
	initialized. Close the ephemeris using jpl_close.
 PROCEDURE:
 >	If the asteroid keyword is not specified than usno_eph calls itself
	recursively to loop over all available asteroids.
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Modified from USNO AE98 C-software


usno_init $SMEI/ucsd/gen/idl/ephem/usno_init.pro
[Previous] [Next]
 NAME:
	usno_init
 PURPOSE:
	Initialize and close USNO AE98 asteroid file
 CATEGORY:
	smei/gen/idl/ephem; USNO Asteroid Ephemeris
 CALLING SEQUENCE:
	FUNCTION usno_init, asteroid, silent=silent
 INPUTS:
	asteroid    scalar; type: string or integer
			asteroid name or asteroid number (see: usno_body)
 OUTPUTS:
	ast_index   scalar; type: integer
			index of asteroid in pointer array USNO_PNTR
			ast=-1 if the initialized failed (probably because the
			asteroid files couldn't be located (see usno_body).
 CALLED BY:
	usno_eph
 SEE ALSO:
	usno_body, usno_close
 CALLS: ***
	InitVar, IsType, usno_body, usno_read
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 COMMON BLOCKS:
	common USNO_INFO, USNO_PNTR
 SIDE EFFECTS:
	Opens an ephemeris file and defines a heap variable.
 RESTRICTIONS:
	usno_close must be called separately to close all open asteroid
	files and free the memory used by the heap variables.
 PROCEDURE:
 >	Common block USNO_INFO contains the pointer array USNO_PNTR.

 >	An asteroid is initialized by opening the asteroid file, reading the
	header and first record of Chebyshev coefficients, and setting up
	a structure in heap memory pointed to by one of the pointers
	in USNO_PNTR.
 >	Fhe structure is set up as follows:
	USNO_PNTR[ast] = ptr_new( {USNO_STRUCT, $
	    iU	    : iU,		$	logical unit of asteroid file
	    name    : ast_name, 	$	name of asteroid (see usno_body)
	    number  : ast_number,	$	number of asteroid (see usno_body)
	    jdi     : jdi,		$	start JD of ephemeris file
	    jdf     : jdf,		$	end JD of ephemeris file
	    jd	    : ptr_new(jd)   ,	$	start JDs for each record in file
	    span    : ptr_new(span) ,	$	periods covered by each record (days)
	    order   : ptr_new(order),	$	order of Chebyshev polynomial for each record
	    currec  : long(0),		$	current record
	    curjd   : double(-1),	$	start JD of current record
	    curspan : double(-1),	$	period covered by current record
	    curorder: long(-1), 	$	order of Chebeshyv polynomial for current record
	    coef    : dblarr(14,3)})		Chebyshev coefficients (only coef[0:order;*] is used)
 >	The pointer USNO_PNTR[ast] is first checked for validity. If it is a valid heap
	pointer then the asteroid has been initialized already, and usno_init quietly returns.
	USNO_PNTR is an array of heap pointers (one for each asteroid).

 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Modified from USNO AE98 C-software


usno_maket $SMEI/ucsd/gen/idl/ephem/usno_maket.pro
[Previous] [Next]
 NAME:
	usno_maket
 PURPOSE:
	Calculates the Chebyshev polynomials for the USNO asteroid ephemeris
 CATEGORY:
	smei/gen/idl/ephem; USNO Asteroid Ephemeris; Chebyshev interpolation
 CALLING SEQUENCE:
	PRO usno_maket, time, t, tdot
 INPUTS:
	time	scalar; type: double
		    Chebyshev time (-1<=time<1)
 OUTPUTS:
	t	scalar; type: double
		    Chebyshev polynomial at 'time'
	tdot	scalar; type: double
		    derivative of Chebyshev polynomial at 'time'
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLED BY:
	usno_eph
 PROCEDURE:
	Compute the values for the Chebyshev polynomial and their derivatives
	to thirteenth order for a given time
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Converted from USNO AE C-software


usno_read $SMEI/ucsd/gen/idl/ephem/usno_read.pro
[Previous] [Next]
 NAME:
	usno_read
 PURPOSE:
	Reads a record from an ephemeris file
 CATEGORY:
	smei/gen/idl/ephem; USNO Asteroid Ephemeris
 CALLING SEQUENCE:
	PRO usno_read, ast
 INPUTS:
	ast	scalar; type: integer
		    indicates the position of the asteroid in the pointer
		    array USNO_PNTR
 OUTPUTS:
	Sets several members of the asteroid structure for asteroid 'ast':
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLED BY:
	usno_eph, usno_init
 COMMON BLOCKS:
	common USNO_INFO, USNO_PNTR
 SIDE EFFECTS:
 RESTRICTIONS:
	The file pointer must be put at the proper position
	before calling usno_read. This is done by usno_eph.
	(*(USNO_PNTR[ast])).curjd	start Julian day for record
	(*(USNO_PNTR[ast])).curspan	period covered by record (days)
	(*(USNO_PNTR[ast])).curorder	order of Chebyshev polynomial
	(*(USNO_PNTR[ast])).coef	Chebyshev coefficients
 PROCEDURE:
	Unformatted read
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


usno_test $SMEI/ucsd/gen/idl/ephem/usno_test.pro
[Previous] [Next]
 NAME:
	usno_test
 PURPOSE:
	Test program for USNO asteroid ephemerides
 CATEGORY:
	smei/gen/idl/ephem; USNO Asteroid Ephemeris; Test program
 CALLING SEQUENCE:
	PRO usno_test, asteroid
 INPUTS:
	asteroid	scalar; type: string
			    one of the following:
		 ['Ceres','Pallas','Juno','Vesta','Hebe','Iris','Flora',    $
		'Metis','Hygiea','Eunomia','Psyche','Europa','Cybele','Davida','Interamn']
 OUTPUTS:
	(none)
 INCLUDE:
	@compile_opt.pro	    ; On error, return to caller
 CALLS: ***
	FILEPATH, InitVar, REVERSE, usno_close, usno_eph, who_am_i
 COMMON BLOCKS:
	common USNO_INFO, USNO_PNTR
 PROCEDURE:
	Compares ephemeris calculation with test numbers for the asteroid used
	(stored in subdirectory 'usno').
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)