;+ ; NAME: ; nh_alt.Pro ; ; PURPOSE: ; Returns the altiude and azimuth of the New Horizons spacecraft as seen from a given location. ; ; ; DESCRIPTION: ; Load the meta kernel file into naif. Get the RA and Dec of New Horizons, the latitude and longitude of ; the specified station (currently the 70-m antennas at Goldstone and Canberra are supported), then ; calculate the altitude and azimuth of the spacecraft at the specified JD. ; ; CALLING SEQUENCE: ; nh_alt, dsnName, jd, alt, az ; ; INPUTS: ; dsnName - a string for the DSN station: either "Goldstone" or "Canberra" ; jd - the JD at which you want to know the altitude. ; ; OUTPUTS: ; alt - the altitude of the New Horizons spacecraft over the dsn station in dsnName ; az - the azimuth of the New Horizons spacecraft over the dsn station in dsnName ; ; REVISON HISTORY: ; 09-December-2004 CBO SwRI ;- pro nh_alt, dsnName, jd, alt, az, load_kernels=lk ;check to see if optional arguments are set by the user. If not assign values. IF not keyword_set(load_kernels) THEN load_kernels = "FALSE" ; Load kernels if requested if load_kernels EQ "TRUE" THEN naif ; Convert time from JD to et jdstring = "JD " + string(jd) cspice_str2et, jdstring, et ; Get DSN station information IF (dsnName EQ "Goldstone") OR (dsnName EQ "goldstone") THEN dsn = "DSS-14" $ ELSE IF (dsnName EQ "Canberra") OR (dsnName EQ "canberra") THEN dsn = "DSS-43" $ ELSE PRINT, "Station: ", dsnName, "not supported at this time." ; PRINT, "DSN Station ", dsn ; DSS-14 is the 70-m antenna at Goldstone http://www331.jpl.nasa.gov/group8/index.html ; DSS-43 is the 70-meter at Canberra http://www.cdscc.nasa.gov/Pages/pg02_antennas.html CSPICE_BODN2C, dsn, dsncode, found ; PRINT, "DSN Station Code ", dsncode IF found ne 1.0 THEN PRINT, "Error finding code for dsn station: ", dsn frame='J2000' CSPICE_BODN2C, "Earth", earth, found CSPICE_SPKEZ, dsncode, et, frame, 'LT', earth, stateDSN, ltime print, earth CSPICE_BODVAR, earth, 'RADII', radii_vec ; calculate the flatness coef flat = (radii_vec[0] - radii_vec[2])/radii_vec[0] CSPICE_RECGEO, stateDSN[0:2], radii_vec[0], flat, longitudeDSN, latitudeDSN, altitudeDSN print, longitudeDSN*180./!pi print, latitudeDSN*180./!pi ; Get the RA and Dec of New Horizons ; abcorr = 'LT+S' ;aberration correction for light time plus stellar ab abcorr = 'LT' ;only correcting for light time, the eq2hor function performs aberration correction nhsc = -98 CSPICE_SPKEZ, nhsc, et, frame, abcorr, earth, stateNH, ltime CSPICE_RECRAD, stateNH[0:2], distNH, raNH, decNH ; print, decNH*180./!pi ; print, raNH*180./!pi ; Calculate the altitude and azimuth using an astron function. I haven't found ; a cspice function yet. This function expects RA, DEC, lat and longitude in degrees. factor = 180./!pi EQ2HOR, raNH*factor, decNH*factor, jd, alt, az, lat = latitudeDSN*factor, longitude=longitudeDSN*factor, $ altitude = altitudeDSN ; ON Friday, left it that there is a problem with getting cspice_recgeo to work. Need radii and flatness from a ; kernel file. end ;+ ;+ ; NAME: ; nh_alt1d.Pro ; ; PURPOSE: ; Returns the altiude and azimuth of the New Horizons spacecraft as seen from a given location ; for a day beginning at jd. ; ; ; DESCRIPTION: ; Load the meta kernel file into naif. Get the RA and Dec of New Horizons, the latitude and longitude of ; the specified station (currently the 70-m antennas at Goldstone and Canberra are supported), then ; calculate the altitude and azimuth of the spacecraft at the specified JD. ; ; CALLING SEQUENCE: ; alt = nh_alt1d(dsnName, jd) ; ; INPUTS: ; dsnName - a string for the DSN station: either "Goldstone" or "Canberra" ; jd - the JD at which you want to know the altitude. ; ; OUTPUTS: ; alt - the altitude of the New Horizons spacecraft over the dsn station in dsnName ; ; REVISON HISTORY: ; 09-December-2004 CBO SwRI ;- function nh_alt1d, dsnName, jd ; a ten minute increment: jdfrac = 10./(24.*60.) n = 6.*24. altarr = fltarr(n) FOR i=0, n-1 DO BEGIN nh_alt, dsnName, jd + i*jdfrac, alt, az altarr[i] = alt ENDFOR return, altarr END