function EarthOrbit, TT, sun=Sun, AU=AU ;+ ; NAME: ; EarthOrbit ; PURPOSE: ; Get coordinate arrays describing Earth's orbit in a ; Cartesian heliographic coordinate system. ; CATEGORY: ; Graphics ; CALLING SEQUENCE: ; Earth = EarthOrbit(TT, sun=Sun, AU=AU) ; INPUTS: ; TT scalar; type: standard time structure ; OPTIONAL INPUT PARAMETERS: ; sun=Sun scalar,array[3] type: float; 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 type: float; default: 1 ; # data units per AU ; OUTPUTS: ; Earth array[3,*] type: float ; X,Y,Z coordinate arrays for Earth's orbit ; (in data units). X(*) = Earth(0,*), ; Y(*) = Earth(1,*), Z(*) = Earth(2,*); ; (first and last point are identical) ; OPTIONAL OUTPUT PARAMETERS: ; CALLS: ; NewcombSun, CvSky ; COMMON BLOCKS: ; SIDE EFFECTS: ; RESTRICTIONS: ; PROCEDURE: ; > First set up the orbit shape in ecliptic coordinates. ; Then Ecliptic_heliog is used to transform heliographic coordinates. ; > Currently the shape is a circle with the Sun-Earth distance at TT ; as radius. This can be done more accurately by using an ellipse with ; proper orientation and ellipticity. ; MODIFICATION HISTORY: ; FEB-1997, Paul Hick (UCSD, pphick@ucsd.edu) ;- on_error, 2 if n_elements(Sun) eq 0 then Sun = 0. if n_elements(AU ) eq 0 then AU = 1. Step = 5 nOrb = (360/Step+1) Orbit = fltarr(3,nOrb) ; Earth's orbit in ecliptic coordinates: Orbit(0,*) = Step*findgen(nOrb) ; .. longitudes Orbit(1,*) = 0. ; .. latitudes Orbit(2,*) = NewcombSun(TT,/distance)/AU ; .. heliocentric distances Orbit(0:1,*) = CvSky(TT,fromecliptic=Orbit(0:1,*),/toheliographic,/degrees) ; Convert from ecliptic to heliographic coordinates ;--------- ;Orbit(2,*) = Orbit(2,*)/2. ;Orbit = EulerRotate([0.,97.,30.],Orbit, /degrees) ;-------- ; Convert to rectangular coordinates Orbit = Sun+cv_coord (from_sphere=Orbit, /to_rect, /degrees) return, Orbit end