function GlobePosition, TT, sun=Sun, AU=AU, $ tPerihelion=tPerihelion, globe=globe, degrees=Degrees ;+ ; NAME: ; GlobePosition ; PURPOSE: ; Get position coordinates of Earth in a Cartesian ; heliographic coordinate system (see SkyGrid for ; definition coordinate system). ; CATEGORY: ; CALLING SEQUENCE: ; Earth = GlobePosition(TT, sun=Sun, AU=AU, globe=Globe) ; INPUTS: ; TT scalar; type: time structure ; time ; OPTIONAL INPUT PARAMETERS: ; sun=Sun scalar/array[3] (default: 0) ; position Sun (in data units) ; (a scalar Sun is interpreted as Sun*[1,1,1], ; i.e. identical x,y,z components) ; AU=AU scalar (default: 1) ; # AU per data unit ; ; OUTPUTS: ; Earth array[3] X,Y,Z coordinates of Earth (in data units) ; OPTIONAL OUTPUT PARAMETERS: ; CALLS: ; NewcombSun, CvSky, TimeSet, TimeOp, HOSOrbit ; COMMON BLOCKS: ; SIDE EFFECTS: ; 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) ;- on_error, 2 if n_elements(Sun) eq 0 then Sun = 0. if n_elements(AU ) eq 0 then AU = 1. if n_elements(globe) eq 0 then globe = 0 ; Get ecliptic longitude, latitude and heliocentric distance case Globe of 0: begin G = [0.,0.,0.] Gl = 'Sun ' end 1: begin ; Earth G = NewcombSun(TT, /heliocentric, /degrees) Gl = 'Earth ' end 2: begin ; Position Helios 1 spacecraft G = HosOrbit(TT, /degrees, hos=1, /quick) Gl = 'Helios 1' end 3: begin ; Position Helios 2 spacecraft G = HosOrbit(TT, /degrees, hos=2, /quick) Gl = 'Helios 2' end 4: begin ; Position Fire USA spacecraft ; 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) G = KeplerOrbit(TT, /degrees, $ elements=[2.61, 0.9928, 180., TimeGet(tPerihelion,/njd)], $ plane = [13.,90.]) Gl = 'Fire ' end 5: begin ; Position Smex spacecraft G = NewcombSun(TT, /degrees); Eclip. long, latitude and distance G1 = G[2] G = NewcombSun(TimeOp(/add,TT,TimeSet(/diff,day=-45)),/heliocentric, /degrees) G[2] = G1 Gl = 'Smex ' end 6: begin ; Position STEREO spacecraft east of Earth G = NewcombSun(TT, /degrees); Eclip. long, latitude and distance G1 = G[2] G = NewcombSun(TimeOp(/add,TT,TimeSet(/diff,day=-27)),/heliocentric, /degrees) G[2] = 1.03*G1 ; Radial distance slightly outside Earth orbit Gl = 'Stereo-E' end 7: begin ; Position STEREO spacecraft west of Earth G = NewcombSun(TT, /degrees) ; Eclip. long, latitude and distance G1 = G[2] G = NewcombSun(TimeOp(/add,TT,TimeSet(/diff,day=+18)),/heliocentric, /degrees) G[2] = 0.97*G1 ; Radial distance slightly inside Earth orbit Gl = 'Stereo-W' end endcase message, /info, Gl+' ' $ +string(G[0],format='(F8.3)') $ +string(G[1],format='(F8.3)') $ +string(G[2],format='(F8.3)') ; Convert to heliographic coordinates G[2] = G[2]/AU ; Heliocentric distance in data units G = CvSky(TT,fromecliptic=G, /toheliographic,/degrees) G = Sun+cv_coord(from_sphere=G,/to_rect,/degrees) return, G & end