;+ ; NAME: ; single_eph.Pro ; ; PURPOSE: ; Returns a structure with the following information: ; {et, ra, dec, radot, decdot, ephinfo} where ephinfo ; contains the observer range and observer range rate. ; ; DESCRIPTION: ; Calculates the ra, dec, radot, decdot, observer range ; and range rate using the NAIF ICY routines. ; ; CALLING SEQUENCE: ; eph = single_eph( target, et, neph, observer=observer, ; testing=testing) ; ; INPUTS: ; et - the ET at which you want to know the ; coordinates ; KEYWORDS ; observer - the keyword argument that indicates the ; observer location, default to Earth. ; verbose - a keyword argument. If set, it ; will print out error messages. ; OUTPUTS: ; eph - a structure with the following elements ; eph.ra - the Pluto RA in radians ; eph.dec - the Pluto Dec in radians ; eph.radot - the RA rate in radians/s ; (d(ra)*cos(dec)/dt) ; eph.decdot -- the Dec rate in radians/s ; eph.ephinfo.delta - the observer range (in km) ; eph.ephinfo.deltadot - the observer range rate (in km/s) ; eph.ephinfo.target - the target ; eph.ephinfo.observer - the observer name ; ; ; REVISON HISTORY: ; 17-January-2005 CBO SwRI ; 2005 Mar 3 Moved to $idl/layoung/naif LAY ; Also put long lines onto 2 lines ; 2005 Apr 26 Return 1 for neph under usual circumstances ; Bypass bodn2c if target or observer are integers ; Change verbose = 0 for quiet, 1 for verbose, ; and removed testing ;- function single_eph, target, et, neph, observer=observer, $ verbose = verbose ;check to see if optional arguments are set by the user. If not assign values. IF not keyword_set(observer) THEN observer = "Earth" IF not keyword_set(verbose) THEN verbose = 0 ; Load naif kernels. If they are already loaded, naifinit will not ; reload them. naifinit ; Look up the naif id's for the observer and target case datatype(observer) of 'STR': begin CSPICE_BODN2C, observer, obscode, found IF found EQ 0 THEN BEGIN neph = 0 eph = -1 IF keyord_set(verbose) THEN $ PRINT, "Observer not understood by CSPICE_BOD2N" RETURN, eph ENDIF end 'INT': obscode = observer 'LON': obscode = observer else: begin neph = 0 eph = -1 IF keyword_set(verbose) THEN $ PRINT, "Observer must be a string or an integer" RETURN, eph end endcase case datatype(target) of 'STR': begin CSPICE_BODN2C, target, targetcode, found IF found EQ 0 THEN BEGIN neph = 0 eph = -1 IF verbose NE "False" THEN $ PRINT, "Target not understood by CSPICE_BOD2N" RETURN, eph ENDIF end 'INT': targetcode = target 'LON': targetcode = target else: begin neph = 0 eph = -1 IF verbose NE "False" THEN $ PRINT, "Target must be a string or an integer" RETURN, eph end endcase ; Get the RA and Dec of the target abcorr = 'LT' ;only correcting for light time frame='J2000' CSPICE_SPKEZ, targetcode, et, frame, abcorr, obscode, $ stateTarget, ltime ; Convert X, Y, Z to RA, Dec and distance radTarget = rec6rad6(stateTarget) delta = radTarget[0] ra = radTarget[1] dec = radTarget[2] deltadot = radTarget[3] radot = radTarget[4] decdot = radTarget[5] ephinfo = $ {delta:delta, deltadot:deltadot, target:target, observer:observer} eph = {et:et, ra:ra, dec:dec, radot:radot, decdot:decdot, $ ephinfo:ephinfo, state:stateTarget} neph = 1 RETURN, eph END ;+