makemovie $SSW_SMEI_UCSD/gen/idl/toolbox/graphics/makemovie.pro
[Previous] [Next]
 NAME:
	makemovie
 CALLS: ***
	CW_FIELD, GetFileSpec, MAKEMOVIE_EVENT, READ_GIF, READ_PNG, STRSPLIT, SetFileSpec
	TimeSet, TimeUnit, WRITE_IMAGE, XMANAGER, grd_read


merge_ranges $SSW_SMEI_UCSD/gen/idl/toolbox/math/merge_ranges.pro
[Previous] [Next]
 NAME:
	merge_ranges
 PURPOSE:
	Reduce a collection of ranges to a minimum set
 CATEGORY:
	gen/toolbox/match
 CALLING SEQUENCE:
	FUNCTION merge_ranges, rr, merge=merge
 INPUTS:
	rr  array rr[2,n] or rr[2]; type: numerical
	    set of ranges specified as pairs of
	    start and end points
 OUTPUTS:
	result	scalar; integer
	    number of pairs in the minimum set
 OPTIONAL OUTPUT PARAMETERS:
	merge	array rr[2,m] or rr[2]
	    minimum set of ranges with overlaps removed.
	    The start points rr[0,*] will be sorted;
	    for all range pairs rr[1,i] > rr[0,i]
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	destroyvar
 CALLED BY:
	where_overlap
 PROCEDURE:
	Zero length ranges, rr[0,i]=rr[1,i], are removed
	If rr[1,i] < rr[0,i] the begin and endpoint are interchanged
	(i.e. [7,3] is interpreted as [3,7])
	In the reduced set the start points of the ranges
	are sorted into ascending order.
 MODIFICATION HISTORY:
	APR-2013, Paul Hick (UCSD/CAIDA; pphick@caida.org)


MessengerOrbit $SSW_SMEI_UCSD/gen/idl/ephem/messengerorbit.pro
[Previous] [Next]
 NAME:
	MessengerOrbit
 PURPOSE:
	Calculate position of Messenger Spacecraft
 CATEGORY:
	smei/gen/idl/ephem
 CALLING SEQUENCE:
	FUNCTION MessengerOrbit, 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:
	big_eph
 RESTRICTIONS:
	The precision is probably about 0.1 degrees in ecliptic longitude,
	provided orbital elements are added as needed (once or twice year?)
 PROCECURE:
	From http://ssd.jpl.nasa.gov/horizons.cgi
	(J2000.0 Orbital Elements)
	Elements cover four periods between 2007/01/01 and 2007/09/30:

	2007/01/01 -> 2007/01/31

	2454115.500000000 = A.D. 2007-Jan-15 00:00:00.0000 (CT)
	 EC= 9.509555173766652E-03 QR= 9.620747268989945E-01 IN= 1.306235954146905E-01
	 OM= 2.380953113698972E+02 W = 3.355229542907300E+02 Tp=  2454210.608155566733
	 N = 1.029594704279364E+00 MA= 2.620771466946642E+02 TA= 2.609996629128498E+02
	 A = 9.713114668842425E-01 AD= 9.805482068694904E-01 PR= 3.496521480770163E+02

	2007/02/01 -> 2007/02/28

	2454147.500000000 = A.D. 2007-Feb-16 00:00:00.0000 (CT)
	 EC= 6.279052167650651E-03 QR= 9.596197332195503E-01 IN= 1.213139724936570E-01
	 OM= 2.169765459780858E+02 W = 5.374894575771112E+01 Tp=  2454265.510775187053
	 N = 1.038608771871410E+00 MA= 2.374329737152352E+02 TA= 2.368291467561132E+02
	 A = 9.656833090947861E-01 AD= 9.717468849700218E-01 PR= 3.466175231231067E+02

	2007/03/01 -> 2007/03/31

	2454175.500000000 = A.D. 2007-Mar-16 00:00:00.0000 (CT)
	 EC= 6.226246274394636E-03 QR= 9.577018334129234E-01 IN= 1.234975641202794E-01
	 OM= 2.149185709343068E+02 W = 7.828787777683904E+01 Tp=  2454286.911843170412
	 N = 1.041813256894421E+00 MA= 2.439296648101152E+02 TA= 2.432909800026552E+02
	 A = 9.637020798975118E-01 AD= 9.697023263821002E-01 PR= 3.455513717238894E+02

	2007/04/01 -> 2007/10/01

	2454253.500000000 = A.D. 2007-Jun-02 00:00:00.0000 (CT)
	 EC= 5.917966070544746E-03 QR= 9.565996862733112E-01 IN= 1.251469150146348E-01
	 OM= 2.143572837656983E+02 W = 9.239562034525594E+01 Tp=  2454299.754766134545
	 N = 1.044099914070154E+00 MA= 3.117054026536591E+02 TA= 3.111966164343318E+02
	 A = 9.622945125484443E-01 AD= 9.679893388235775E-01 PR= 3.447945882847869E+02

	2007/10/01 -> now

	2454466.500000000 = A.D. 2008-Jan-01 00:00:00.0000 (CT)
	 EC= 5.655394382946006E-03 QR= 9.564978161375505E-01 IN= 1.253836830038676E-01
	 OM= 2.142571411361414E+02 W = 9.225614784090398E+01 Tp=  2454299.536585085094
	 N = 1.044680486714094E+00 MA= 1.744234215566499E+02 TA= 1.744859573944121E+02
	 A = 9.619379546429810E-01 AD= 9.673780931484115E-01 PR= 3.446029715098184E+02

	2011/01/21 -> 2012/01/21

	2455583.500000000 = A.D. 2011-Jan-22 00:00:00.0000 (CT)
	 EC= 5.649610774525156E-03 QR= 9.563712745374616E-01 IN= 1.256261457055498E-01
	 OM= 2.140504362161804E+02 W = 9.348075068567380E+01 Tp=  2455678.680902264081
	 N = 1.044896949233696E+00 MA= 2.605457655988884E+02 TA= 2.599079145507906E+02
	 A = 9.618050989876956E-01 AD= 9.672389234379295E-01 PR= 3.445315830082727E+02

	2012/01/21 -> now

	2455948.500000000 = A.D. 2012-Jan-22 00:00:00.0000 (CT)
	 EC= 5.705938568515530E-03 QR= 9.563266675804051E-01 IN= 1.257640058659871E-01
	 OM= 2.139833070619798E+02 W = 9.406913424182217E+01 Tp=  2456023.716625969391
	 N = 1.044881265762684E+00 MA= 2.814075566505216E+02 TA= 2.807657290779928E+02
	 A = 9.618147233058820E-01 AD= 9.673027790313589E-01 PR= 3.445367543624463E+02


    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:
	AUG-2007, George Megally (UCSD/CASS; gmegally@ucsd.edu)
	AUG-2007, John Clover (UCSD/CASS; jclover@ucsd.edu)
	JUL-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Split up into seperate routines for A and B.
	    Updated orbital elements from Horizon (almost, but not quite the
	    same as the original ones).
	JUN-2009, John Clover (UCSD/CASS; jclover@ucsd.edu)
	    Fixed time structure to cover the whole of the end of the day between
	    elements.


mpc_body $SSW_SMEI_UCSD/gen/idl/ephem/mpc_body.pro
[Previous] [Next]
 NAME:
	mpc_body
 PURPOSE:
	Get list of bodies for which MPC ephemerides are available
 CATEGORY:
	smei/gen/idl/ephem
 CALLING SEQUENCE:
	FUNCTION mpc_body, body, file=file, number=number, index=index, count=count, total_count=total_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:
	Result		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:
	big_body, big_eph, big_orbit, mpc_eph, smei_frm_where
 PROCEDURE:
 >	Currently only 9P/Tempel (comet Tempel 1 around 'deep impact' time) is available
 >	The MPC files are searched for in the subdirectory 'mpc' of the directory
	where this procedure is located.
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Based on usno_body()


mpc_comets $SSW_SMEI_UCSD/gen/idl/ephem/mpc_comets.pro
[Previous] [Next]
 NAME:
	mpc_comets
 PURPOSE:
	Get list of comits for which MPC orbital elements are available
 CATEGORY:
	smei/gen/idl/ephem
 CALLING SEQUENCE:
	FUNCTION mpc_comets, body   , $
	    number	= number    , $
	    index	= index     , $
	    orbit	= orbit     , $
	    degrees	= degrees   , $
	    count	= count     , $
	    source	= source    , $
	    total_count = total_count
 OPTIONAL INPUT PARAMETERS:
	body		scalar or array; type: integer or string
			    integer: list of comet numbers
			    string : list of comet names
				only valid entries on this list are processed
				If not specified then all comets are processed;
	source=source	scalar; type: string
			    MPC file with orbital elements
 OUTPUTS:
	Result		array[count]; type: string
			    list of comet names for which orbital elements
			    are available; if none exist (count=0) then names=''
 OPTIONAL OUTPUT PARAMETERS:
	count=count	scalar; type: integer
			    # requested comets for which orbital elements are present
			    i.e. # elements in input 'body' with invalid entries removed
	number=number	array[count]; type: integer
			    comet 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 # comets for which orbital elements are present
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	FILEPATH, InitVar, IsType, TimeGet, TimeSet, ToDegrees, boost, txt_read, where_common
	who_am_i
 CALLED BY:
	big_eph, mpc_orbit_eph
 PROCEDURE:
 MODIFICATION HISTORY:
	MAY-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


mpc_eph $SSW_SMEI_UCSD/gen/idl/ephem/mpc_eph.pro
[Previous] [Next]
 NAME:
	mpc_eph
 PURPOSE:
	Get position from MPC ephemerides
 CATEGORY:
	smei/gen/idl/ephem
 CALLING SEQUENCE:
	FUNCTION mpc_eph, UT, body, $
	    center	= center    , $
	    location	= location  , $
	    speed	= speed     , $
	    to_sphere	= to_sphere , $
	    degrees	= degrees   , $
	    precess	= precess   , $
	    to_ecliptic = to_ecliptic,$
	    source	= source    , $
	    get 	= get	    , $
	    _extra	= _extra    , $
	    silent	= silent
 INPUTS:
	UT	scalar; type: double
			Julian date when ephemerides are needed
	body	scalar; type: string or integer; default: 'tempel_1'
			body name or body number (see: mpc_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)
	source=source
		scalar; type: string; default: who_am_i(/dir)/mpc
			By default MPC ephemeris files are looked for in subdirectory
			mpc of the directory where this source code is located
			Use this keyword to point to another directory.
 OUTPUTS:
	Result	array[6] or array[6,*]; type: double
			array[0:2,*] = position in AU
			array[3:5,*] = velocity in AU/day
			If the MPC ephemeris could not be determined
			(because the ephemeris file could not be located or because
			the time is outside the range of the ephemeris)
			then all 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, AngleUnits, BadValue, CV_COORD, CvPrecess, CvSky, FILEPATH, InitVar, IsTime
	IsType, SuperArray, TimeGet, TimeInterpol, TimeLimits, TimeOp, TimeSet, TimeUnit
	flt_read, jpl_body, jpl_eph, mpc_body, who_am_i
 CALLED BY:
	big_eph, smei_frm_where
 PROCEDURE:
	Ephemeris files can be retrieved from
	    http://cfa-www.harvard.edu/iau/MPEph/MPEph.html
	Fill out the form asking for geocentric coordinates and specify
	    - name of minor planet or comet
	    - ephemeris start date
	    - number of dates to output
	Other fields should not matter. Save the html file produced on the
	website and put in the subdirectory mpc of the directory where this
	source code file is located.

	The ephemeris record should look like this:
	Date	   UT	   R.A. (J2000) Decl.	 Delta	   r	 El.	Ph.   m1     Sky Motion
		    h m s							     "/min    P.A.
	2005 04 01 000000 13 21 22.5 +12 55 12	 0.800	 1.772	160.0  11.1  11.2    0.45    286.7
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


mpc_minor_planets $SSW_SMEI_UCSD/gen/idl/ephem/mpc_minor_planets.pro
[Previous] [Next]
 NAME:
	mpc_minor_planets
 PURPOSE:
	Get list of minor planets for which MPC orbital elements are available
 CATEGORY:
	smei/gen/idl/ephem
 CALLING SEQUENCE:
	FUNCTION mpc_minor_planets, body    , $
	    number	= number    , $
	    index	= index     , $
	    orbit	= orbit     , $
	    degrees	= degrees   , $
	    count	= count     , $
	    source	= source    , $
	    total_count = total_count
 OPTIONAL INPUT PARAMETERS:
	body		scalar or array; type: integer or string
			    integer: list of minor planet numbers
			    string : list of minor planet names
				only valid entries on this list are processed
				If not specified then all minor plantes are processed;
	source=source	scalar; type: string
			    MPC file with orbital elements
 OUTPUTS:
	Result		array[count]; type: string
			    list of minor planet names for which orbital elements
			    are available; if none exist (count=0) then names=''
 OPTIONAL OUTPUT PARAMETERS:
	count=count	scalar; type: integer
			    # requested minor planets for which orbital elements are present
			    i.e. # elements in input 'body' with invalid entries removed
	number=number	array[count]; type: integer
			    minor planet 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 # minor planets for which orbital elements are present
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	FILEPATH, InitVar, IsType, TimeGet, ToDegrees, WhatIs, mpc_packed_date, txt_read
	where_common, who_am_i
 CALLED BY:
	big_eph, mpc_orbit_eph
 PROCEDURE:
 MODIFICATION HISTORY:
	MAY-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


mpc_orbit_eph $SSW_SMEI_UCSD/gen/idl/ephem/mpc_orbit_eph.pro
[Previous] [Next]
 NAME:
	mpc_orbit_eph
 PURPOSE:
	Get position for MPC comets and minor planets from orbital elements
 CATEGORY:
	smei/gen/idl/ephem
 CALLING SEQUENCE:
	FUNCTION mpc_orbit_eph, UT, body, $
	    comet	= comet     , $
	    center	= center    , $
	    location	= location  , $
	    speed	= speed     , $
	    to_sphere	= to_sphere , $
	    degrees	= degrees   , $
	    precess	= precess   , $
	    to_ecliptic = to_ecliptic,$
	    get 	= get	    , $
	    _extra	= _extra    , $
	    silent	= silent
 INPUTS:
	UT	scalar; type: double
			Julian date when ephemerides are needed
	body	scalar; type: string or integer; default: 'C/2004 Q2 (Machholz)'
			body name or body number
			(see: mpc_comets and mpc_minor_planets)
 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 MPC ephemeris could not be determined
			then all 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, KeplerOrbit
	SuperArray, TimeGet, TimeSet, jpl_body, jpl_eph, mpc_comets, mpc_minor_planets
 CALLED BY:
	big_eph
 PROCEDURE:
	The main input file is the list of orbital elements from
	the Minor Planet Center
	    http://www.cfa.harvard.edu/iau/Ephemerides/Comets/Soft00Cmt.txt
 MODIFICATION HISTORY:
	MAY-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


mpc_packed_date $SSW_SMEI_UCSD/gen/idl/ephem/mpc_packed_date.pro
[Previous] [Next]
 NAME:
	mpc_packed_date
 PURPOSE:
	Convert MPC packed data to time structure
 CATEGORY:
	gen/idl/ephem
 CALLING SEQUENCE:
	FUNCTION mpc_packed_date, time
 INPUTS:
	time	    array; type: string
		    MPC packed data
 OUTPUTS:
	Result	    array: type: time structure
		    times
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	TimeSet, where_common
 CALLED BY:
	mpc_minor_planets
 PROCEDURE:
	From: http://www.cfa.harvard.edu/iau/info/PackedDates.html
	Dates of the form YYYYMMDD may be packed into five characters to conserve space.

	The first two digits of the year are packed into a single character in column 1
	(I = 18, J = 19, K = 20). Columns 2-3 contain the last two digits of the year.
	Column 4 contains the month and column 5 contains the day, coded as detailed below:

	   Month     Day      Character 	Day	 Character
			     in Col 4 or 5		in Col 4 or 5
	   Jan.       1 	  1		17	     H
	   Feb.       2 	  2		18	     I
	   Mar.       3 	  3		19	     J
	   Apr.       4 	  4		20	     K
	   May	      5 	  5		21	     L
	   June       6 	  6		22	     M
	   July       7 	  7		23	     N
	   Aug.       8 	  8		24	     O
	   Sept.      9 	  9		25	     P
	   Oct.      10 	  A		26	     Q
	   Nov.      11 	  B		27	     R
	   Dec.      12 	  C		28	     S
		     13 	  D		29	     T
		     14 	  E		30	     U
		     15 	  F		31	     V
		     16 	  G

	Examples:

	   1996 Jan. 1	  = J9611
	   1996 Jan. 10   = J961A
	   1996 Sept.30   = J969U
	   1996 Oct. 1	  = J96A1
	   2001 Oct. 22   = K01AM

	This system can be extended to dates with non-integral days. The decimal
	fraction of the day is simply appended to the five characters defined above.

	Examples:

	   1998 Jan. 18.73     = J981I73
	   2001 Oct. 22.138303 = K01AM138303
 MODIFICATION HISTORY:
	MAY-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)