m24dif $SMEI/user/bjackson/c3_differencer/m24dif.pro
[Previous] [Next]
 NAME:
	m24dif
 CALLING SEQUENCE:
	pro m24dif,imn,imset,img=img
 INCLUDE:
	@compile_opt.pro


m2adif $SMEI/user/bjackson/c3_differencer/m2adif.pro
[Previous] [Next]
 NAME:
	m2adif
 CALLING SEQUENCE:
	pro m2adif,imn=imn,imset=imset,img=img
 CALLS: ***
	WRITEFITS


m2b0ddif $SMEI/user/bjackson/c3_differencer/m2b0ddif.pro
[Previous] [Next]
 NAME:
	m2b0ddif
 CALLING SEQUENCE:
	pro m2b0ddif,imn=imn,imset=imset,img=img
 CALLS: ***
	WRITEFITS


m2b0dif $SMEI/user/bjackson/c3_differencer/m2b0dif.pro
[Previous] [Next]
 NAME:
	m2b0dif
 CALLING SEQUENCE:
	pro m2b0dif,imn=imn,imset=imset,img=img
 CALLS: ***
	WRITEFITS


m2sum_dif $SMEI/user/bjackson/c3_differencer/m2sum_dif.pro
[Previous] [Next]
 NAME:
	m2sum_dif
 CALLING SEQUENCE:
	pro m2sum_dif,imn=imn,imset=imset,img=img
 CALLS: ***
	WRITEFITS


m9adif $SMEI/user/bjackson/c3_differencer/m9adif.pro
[Previous] [Next]
 NAME:
	m9adif
 CALLING SEQUENCE:
	pro m9adif,imn=imn,imset=imset,img=img
 CALLS: ***
	WRITEFITS


m9b0dif $SMEI/user/bjackson/c3_differencer/m9b0dif.pro
[Previous] [Next]
 NAME:
	m9b0dif
 CALLING SEQUENCE:
	pro m9b0dif,imn=imn,imset=imset,img=img
 CALLS: ***
	WRITEFITS


m9mindif $SMEI/user/bjackson/c3_differencer/m9mindif.pro
[Previous] [Next]
 NAME:
	m9mindif
 CALLING SEQUENCE:
	pro m9mindif,imn=imn,imset=imset,img=img
 CALLS: ***
	WRITEFITS


m9mindifs $SMEI/user/bjackson/c3_differencer/m9mindifs.pro
[Previous] [Next]
 NAME:
	m9mindifs
 CALLING SEQUENCE:
	pro m9mindifs,imn=imn,imset=imset,img=img


MagnifyArray $SMEI/ucsd/sat/idl/toolbox/magnifyarray.pro
[Previous] [Next]
 NAME:
	MagnifyArray
 PURPOSE:
	Rebin an image to a integer multiple of its original size by
	copying pixel values
 CATEGORY:
	Tricks
 CALLING SEQUENCE:
	result = MagnifyArray(array [, mag, /undo])
 INPUTS:
	array	    array[n,m]; type: any
			any 2-dimensional array
 OPTIONAL INPUT PARAMETERS:
	mag	    scalar; type: integer; default: 2
			magnification factor; must be an integer
	/undo	    undoes a previous magnification operation (the magnification
		    factor must be the same to retrieve the original array)
 OUTPUTS:
	result	    array[n*magnification,m*magnification]
			the resulting array enlarged by the magnification factor.
			array element array[i,j] from the input image is replicated
			in array elements
			result[i*magnification..i*magnification+magnification-1,
			       j*magnification..j*magnification+magnification-1]
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	InitVar, IsType, SuperArray
 CALLED BY:
	PRO test_magnify, img_read, qImage_cw_Blowup, qImage_cw_BoxZoom, qImage_cw_Where
	qView_Movie, qView_Save2File, qView_Wall, qvu_draw, smei_frm_flatfield
	smei_frm_rebin, smei_setup_roi, smei_star_fit, smei_star_fitone
	smei_star_lsqfit, stardistance
 RESTRICTIONS:
 PROCEDURE:
	Both IDL rebinning functions (REBIN and CONGRID) use interpolation
	procedures, and hence in general will produce pixel values not present
	in the original array.
	MagnifyArray replicates pixel values in blocks of magnification
	x magnification pixels.
 MODIFICATION HISTORY:
	FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


make_r2_density $SMEI/user/pphick/idl/make_r2_density.pro
[Previous] [Next]
 NAME:
	make_r2_density
 PURPOSE:
 CALLING SEQUENCE:
	PRO make_r2_density, hdr, ff
 INCLUDE:
	@compile_opt.pro
 CALLS: ***
	WhatIs, vu_get, vu_getdata


makediff $SMEI/user/jclover/from_ztemp/makediff.pro
[Previous] [Next]
 NAME:
	makediff
 CALLING SEQUENCE:
	PRO makediff
 CALLS: ***
	BadValue, FILEPATH, GetFileSpec, SetFileSpec, array_smooth, bin_read, bin_write


makemovie [1] $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


makemovie [2] $SMEI/user/jclover/from_ztemp/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


max_pos $SMEI/ucsd/sat/idl/toolbox/max_pos.pro
[Previous] [Next]
 NAME:
	max_pos
 PURPOSE:
	Finds the position of maximum in a 2D array
 CALLING SEQUENCE:
	max = max_pos(f)
 INPUTS:
	f   array
 OUTPUTS:
	max fltarr(2)	2D array containing the position of the maximum
		    max(0) = x-coordinate of maximum
		    max(1) = y-coordinate of maximum
		    (values based on array index)
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
CALLS
ArrayLocation
 CALLS: ***
	ArrayLocation
 CALLED BY:
	xyoff
 PROCEDURE:
	The indices of the element with the max. value are obtained from
	a call to `max'.
	If the element has a neighbour on either side (in horizontal or
	vertical direction) the x and y positions of the maximum are refined
	by fitting a quadratic polynomial through the maximum array element
	and its two neighbours.
 MODIFICATION HISTORY:
	H. Cohl, 20 Nov, 1990 --- Initial implementation.


maygeometry $SMEI/user/pphick/idl/maygeometry.pro
[Previous] [Next]
 NAME:
	maygeometry
 PURPOSE:
 CALLING SEQUENCE:
	PRO maygeometry, bcam=bcam, ecam=ecam
 INCLUDE:
	@compile_opt.pro ;
 CALLS: ***
	BadValue, FILEPATH, InitVar, IsType, TimeGet, TimeSet, TimeUnit, ToRadians, boost
	destroyvar, jpl_body, smei_frm_where, smei_getfile, smei_property, sphere_distance
 MODIFICATION HISTORY:


MercatorProj $SMEI/ucsd/sat/idl/toolbox/math/mercatorproj.pro
[Previous] [Next]
 NAME:
	MercatorProj
 PURPOSE:
	Transforms latitude and longitude to X and Y coordinates in the
	Mercator map projection.
 CALLING SEQUENCE:
	Pos = MercatorProj(Pos)
 INPUTS:
	Pos	    array[2,n]; type: float
			n locations in the sky
			Pos[0,n]    longitudes
			Pos[1,n]    latitudes in [-90.,90.]
 OPTIONAL INPUT PARAMETERS:
	/degrees    if set then all angles are in degrees (default: radians)

	dabg	    array[3]; type: float: default: none
			Euler angles for a rotation to be applied to
			'Pos' prior to the Mercator projection.
			(see FishEye)
	zero_phase  scalar; type: float; default: none
			Additional offset applied to phase angle
			(see FishEye)
 OUTPUTS:
	Pos	    array[2,n]; type: float
			X,Y Cartesian coordinates (same structure as input array)
			(in radians or degrees)
			The longitude is scaled to [-180,+180].
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	AngleRange, EulerRotate, IsType, SyncDims
 CALLED BY:
	GetColors [2], GetColors [3], PlotEarthSkymap [1], PlotEarthSkymap [2]
	PlotEarthSkymap [3], PlotEarthSkymap [4], PlotEloTimeMap, PlotPolarSkymap
	vu_thomson_antifish, vu_thomson_hammer
 PROCEDURE:
 MODIFICATION HISTORY:
	FEB-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


merge_ranges $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:
	ark_duty_cycle, fileset_sizes, telescope_sizes, 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 $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.


miscfig $SMEI/user/pphick/idl/figures/miscfig.pro
[Previous] [Next]
 NAME:
	miscfig
 CALLING SEQUENCE:
	PRO miscfig, figure
 INCLUDE:
	@compile_opt.pro
 CALLS: ***
	ARROW, CV_COORD, FILEPATH, IPS_WeightFnc, InitVar, LOADCT, MEAN, PlotCurve, READ_GIF
	SPLINE, WRITE_GIF, WhatIs, coord3to2, flip_colors, get_page, gridgen, plot3darc
	plot3dline, set_page, setup3d, twin, unitvectors, vectorproduct, view


mk_celias $SMEI/ucsd/sat/idl/util/mk_celias.pro
[Previous] [Next]
 NAME:
	mk_celias
 PURPOSE:
	Update celias hourly averages
 CATEGORY:
 CALLING SEQUENCE:
	PRO mk_celias, update=update, nowget=nowget, silent=silent
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
	/update     only update the current yearly file
	/nowget     skip wget to download new data
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	Carrington, FILEPATH, InitVar, IsType, TimeGet, TimeSet, TimeSystem, TimeUnit, UNIQ, boost
	txt_read
 PROCEDURE:
 MODIFICATION HISTORY:
	OCT-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


mk_flick $SMEI/ucsd/sat/idl/util/mk_flick.pro
[Previous] [Next]
 NAME:
	mk_flick
 PURPOSE:
	Make movie from group of image files
 CATEGORY:
	sat/idl/util
 CALLING SEQUENCE:
	PRO mk_flick, movie, filter,	$
	    delay   = delay	, $
	    loop    = loop	, $
	    mpeg    = mpeg	, $
	    png     = png	, $
	    gif     = gif	, $
	    first   = first	, $
	    last    = last	, $
	    fps     = fps	, $
	    bits    = bits	, $
	    timestamp=timestamp , $
	    frames  = frames	, $
	    cleanup = cleanup	, $
	    silent  = silent	, $
	    step    = step
 INPUTS:
	movie		    scalar; type: string
				name of movie file; if no directory is specified the
				movie file is created in the current directory
	filter		    scalar or array; type: string
				a scalar identifying a group of image files. This
				could be a directory (all files) or a filter containing
				a wild card. An array should be a list of file names.
 OPTIONAL INPUT PARAMETERS:
	first=first	    scalar; type: integer
	last =last	    scalar; type: integer
				number of images used to make movies
				use only first or last group of files (after sorting
				file names) to make a movie
	/png		    makes an mng movie (this is the default)
	/mpeg		    makes an mpeg movie
	/gif		    makes an animated gif movie using gifsicle
	step=step	    scalar; type: integer
				Use only one frame of every 'step' frames

	Keywords for mng and gif movies (tested with convert and gifsicle):

	delay=delay	    sets the delay between images in units of 0.01 seconds
	/loop		    created an animation with an infinite loop

	ffmpeg keywords:

	fps=fps 	    frames per second
	bits=bits	    bits per second
 OUTPUTS:
	(creates movie file)
 INCLUDE:
	@compile_opt.pro			    ; On error, return to caller
 CALLS: ***
	CheckDir, FILEPATH, FindAllSubDirs, GetFileSpec, InitVar, IsType, SetFileSpec, UNIQ
	do_file, hide_env, qFramestamp, say
 CALLED BY:
	projfig, qView_Save2File, smei_star_fitone, vu_movie, vu_quick_movie
 RESTRICTIONS:
	Runs only on Linux so far.
 PROCEDURE:
	PNG animation (mng movie):

	Uses 'convert'. This is part of ImageMagick, and is usually located
	in /usr/X11R6/bin or /usr/bin. It is called with keywords -loop 0
	(if /loop is set) and -delay <delay> (if delay=delay is specified).

	GIF animation (gif movie):
	Uses 'gifsicle'. It is called with keywords --loop (if /loop
	is set) and --delay=<delay> (if delay=delay is specified).

	MPG animation (mpeg movie)
	Uses 'ffmpeg'. It is called with keywords fps and bits (if provided
	as keywords).

	The executable is located by spawning a 'which' command, i.e. the
	movie maker program must be in the path.
 MODIFICATION HISTORY:
	APR-2001, Paul Hick (UCSD/CASS)
	SEP-2001, Paul Hick (UCSD/CASS)
	    Merged Kevin's mk_mpeg with this procedure.
	MAY-2003, Paul Hick (UCSD/CASS)
	    Added PNG animation. This is now the default.
	OCT-2006, John Clover, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    MPEG support is now done with ffmpeg


mkhdr_frm $SMEI/ucsd/camera/idl/frm/mkhdr_frm.pro
[Previous] [Next]
 NAME:
	mkhdr_frm
 PURPOSE:
	Adds parameters to the fits header
 CATEGORY:
	camera/idl/frm
 CALLING SEQUENCE:
	new_hdr = mkhdr_frm(hdr)
 INPUTS:
   newhdr		    the hdr that is having parameters added
					       to it

   hdr					   hdr information to add on
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
       newhdr=newhdr		     array[1]; type: structure
					       frame header
 INCLUDE:
	@compile_opt.pro
 CALLS: ***
	FXADDPAR
 SEE ALSO:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
       JUL-2003, Austin Duncan (UCSD/CASS; a5duncan@yahoo.com)


mpc_body $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,$
	    silent  = silent
 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, InitVar, IsType, hide_env, where_common, who_am_i
 CALLED BY:
	PlotPlanarCut, 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 $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 $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:
       - make sure "Return ephemerides" is set
	    - insert name of minor planet or comet
	    - insert ephemeris start date
	    - set number of dates to output
       - set the ephemeris interval to 1 (= 1 day; units default to days)
	Other fields should not matter. Click on "Get ephemeris'; then save the
	resulting html file and put in the subdirectory 'mpc' of the directory
	where this source code file is located (or, altenatively, into the directory
	you intend to specify in the 'source' keyword to this routine.

	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

	The ephemeris for a specified time is obtained by linear interpolation
	on this list.
 MODIFICATION HISTORY:
	JUL-2005, Paul Hick (UCSD/CASS)
	JUL-2014, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Updated documentation


mpc_eph_range $SMEI/ucsd/gen/idl/ephem/mpc_eph_range.pro
[Previous] [Next]
 NAME:
	mpc_eph_range
 PURPOSE:
	Get time range for MPC object
 CATEGORY:
	smei/gen/idl/ephem
 CALLING SEQUENCE:
	FUNCTION mpc_eph_range, body, $
	    source	= source    , $
	    silent	= silent
 INPUTS:
	body	scalar; type: string or integer; default: 'tempel_1'
			body name or body number
 OPTIONAL INPUT PARAMETERS:
	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[2]; type: time structure
			Earliest and latest time for which
			ephemerides are available
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	FILEPATH, InitVar, IsTime, TimeSet, TimeUnit, flt_read, who_am_i
 CALLED BY:
	big_orbit
 SEE ALSO:
	mpc_body, mpc_eph
 PROCEDURE:
	Ephemeris files are retrieved from
	    http://cfa-www.harvard.edu/iau/MPEph/MPEph.html
 MODIFICATION HISTORY:
	JUL-2014, Paul Hick (UCSD/CASS)


mpc_minor_planets $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 $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 $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)