;+ ; NAME: ; oc_naiffgh.pro ; ; PURPOSE: ; returns a 6-element fgh state vector (or a 6 x n matrix) ; ; DESCRIPTION: ; Calculates the state using the NAIF ICY routines. ; ; CALLING SEQUENCE: ; state = oc_naiffgh(et,targ,radec_star, dradec_star, $ ; obs=obs,abcorr=abcorr,frame=frame,lonlatalt=lonlatalt) ; ; INPUTS: ; et - the ET at which you want to know the coordinates (may be an ; array). Units are seconds of TDB (barycentric dynamical ; time) after J2000. ; targ = target code ; radec_star - vector of; ; A - right ascention in radians ; D - declination in radians ; OPTIONAL INPUT PARAMETERS: ; dradec_star - vector of ; dA = d(A)/dt (NOT cosdec dA/dt) ; dD = dD/dt ; ; KEYWORDS ; obs - the keyword argument that indicates the observer location, ; default to Earth center (399). ; abcorr - aberation correction. Default 'LT' ; frame - frame of state, ra, dec. Default 'J2000' ; lonlatalt - lon, lat, altitude for topocentric ; ephemerides. Default geocentric ; OUTPUTS: ; If et is a double, then return fgh6 = [f,g,h,f',g',h'] in ; km and km/s. ; If et is an array, return fgh6arr = [ [fgh0], [fgh1], ...] ; so single 6-element fgh arrays are accessed by fgh6arr[*,i] ; ; REVISON HISTORY: ; 2006 Jan 02 Leslie Young. Based on single_eph ;- function oc_naiffgh, et,targ, radec_star, dradec_star, $ obs=obs,abcorr=abcorr,frame=frame,lonlatalt=lonlatalt if n_params() lt 4 then dradec_star = [0.d,0.d] n = n_elements(et) fgharr = dblarr(6,n) states = oc_naifstate(et, targ, obs=obs,abcorr=abcorr,$ frame=frame,lonlatalt=lonlatalt) for i = 0, n-1 do begin fgharr[*,i] = rec6fgh6(states[*,i], radec_star, dradec_star) end if n eq 1 then begin if isarray(et) then begin return, reform(fgharr,6,1) endif else begin return, reform(fgharr[*,0], 6) endelse endif else begin return, fgharr endelse end