;+ ; NAME: ; RemoteView_BodyLoc ; PURPOSE: ; Get position coordinates of Earth in a Cartesian ; heliographic coordinate system (see SkyGrid for ; definition coordinate system). ; CATEGORY: ; CALLING SEQUENCE: FUNCTION RemoteView_BodyLoc, TT, body=body, silent=silent ; INPUTS: ; TT array[1]; type: time structure ; time ; OPTIONAL INPUT PARAMETERS: ; body=body scalar; type: string ; name of body ; /silent if set, suppresses informational messages ; OUTPUTS: ; Earth array[3] X,Y,Z coordinates of Earth (in data units) ; OPTIONAL OUTPUT PARAMETERS: ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; HOSOrbit, KeplerOrbit, CvSky, TimeOp, TimeGet, TimeSet ; InitVar, big_eph, jpl_eph ; RESTRICTIONS: ; PROCEDURE: ; NewcombSun is used to get the geocentric ecliptic coordinates ; of the Sun. The heliocentric ecliptic coordinates of Earth ; are given by the opposite point (add 180 deg to longitude; ; change sign on the latitude. Then Ecliptic_Heliog is used to ; convert to heliographic coordinates. ; MODIFICATION HISTORY: ; FEB-1997, Paul Hick (UCSD/CASS) ; OCT-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ; Replaced call to jpl_eph by call to big_eph. This makes it easier ; to add bodies processed by the USNO asteroid ephemeris and any ; ephemerides downloaded from the Minor Planet Center. ;- InitVar, body , 'Sun' InitVar, silent, 0 ; Get ecliptic longitude, latitude and heliocentric distance ; First intercept everything that should not be handled by big_eph CASE strlowcase(body) OF 'sun': G = [0.0,0.0,0.0] ; USA Fire s/c : a=1.61 , e=0.9928 (perihelion distance: 4 Rsun) ; Russian Fire s/c: a=2.625, e=0.9820 (perihelion distance: 10 Rsun) 'fire': BEGIN G = KeplerOrbit(TT, /degrees, $ elements=[2.61, 0.9928, 180.0, TimeGet(TimeSet('2000/01/01'),/njd)],$ plane = [13.0,90.0]) G = CvSky(TT,from_ecliptic=G, /to_heliographic, /degrees, /silent) END 'smex': BEGIN ; Position Smex spacecraft P1 = jpl_eph( TT ,/location,/to_sphere,/precess,/to_ecliptic,/degrees) P2 = jpl_eph(TimeOp(/add,TT,TimeSet(day=-45)),/location,/to_sphere,/precess,/to_ecliptic,/degrees) G = [P1[0:1],P2[2]] G = CvSky(TT,from_ecliptic=G, /to_heliographic, /degrees, /silent) END ELSE: BEGIN ; This processes all planets, the moon, USNO asteroids, and all ; MPC bodies. It also processes Helios 1, Helios 2, and Ulysses earth = jpl_body(/earth,/string) geocentric = jpl_body(body) EQ jpl_body(/moon) OR (where(body EQ sgp_body()))[0] NE -1 ; For Moon and SGP satellites we calculate the position ; relative to Earth. This is needed to plot bodies accurately close to Earth ; In that case also the position of Earth needs to be picked up. CASE geocentric OF 0: G = big_eph(TT, body=body , /to_sphere, /to_heliographic, /precess, /degrees, /silent) 1: G = [ [big_eph(TT, body=body, center=earth, /to_sphere, /to_heliographic, /precess, /degrees, /silent)], $ [big_eph(TT, body=earth , /to_sphere, /to_heliographic, /precess, /degrees, /silent)] ] ENDCASE END ENDCASE Gl = strmid(body+' ',0,9) IF silent LE 0 THEN $ IF GL NE 'Sun ' THEN $ print, Gl+': Lng=', G[0], ' deg; Lat=', G[1], ' deg; R=', G[2], ' AU', format='(8X,3(A,F6.2),A)' G = cv_coord(from_sphere=reform(G), /to_rect, /degrees) RETURN, G & END