;+ ; NAME: ; usno_read ; PURPOSE: ; Reads a record from an ephemeris file ; CATEGORY: ; smei/gen/idl/ephem; USNO Asteroid Ephemeris ; CALLING SEQUENCE: PRO usno_read, ast ; INPUTS: ; ast scalar; type: integer ; indicates the position of the asteroid in the pointer ; array USNO_PNTR ; OUTPUTS: ; Sets several members of the asteroid structure for asteroid 'ast': ; OPTIONAL OUTPUT PARAMETERS: ; INCLUDE: @compile_opt.pro ; On error, return to caller ; COMMON BLOCKS: common USNO_INFO, USNO_PNTR ; SIDE EFFECTS: ; RESTRICTIONS: ; The file pointer must be put at the proper position ; before calling usno_read. This is done by usno_eph. ; (*(USNO_PNTR[ast])).curjd start Julian day for record ; (*(USNO_PNTR[ast])).curspan period covered by record (days) ; (*(USNO_PNTR[ast])).curorder order of Chebyshev polynomial ; (*(USNO_PNTR[ast])).coef Chebyshev coefficients ; PROCEDURE: ; Unformatted read ; MODIFICATION HISTORY: ; SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- iU = (*(USNO_PNTR[ast])).iU curjd = double(0) tmp1 = fix(0) tmp2 = fix(0) readu, iU, curjd,tmp1,tmp2 (*(USNO_PNTR[ast])).curjd = curjd (*(USNO_PNTR[ast])).curspan = double(tmp1) (*(USNO_PNTR[ast])).curorder = long(tmp2) IF tmp2 LT 0 OR tmp2 GT 13 THEN BEGIN print, 'ast=',ast,' iu=',iu,' jd=',curjd,' span=',tmp1,' order=',tmp2 message, 'tmp2 < 0 or tmp2 > 13 should not happen' ENDIF coef = dblarr(tmp2+1,3) readu, iU, coef ; Pad to coeff[14,3] with zeroes IF tmp2 LT 13 THEN $ coef = [ coef, dblarr(14-tmp2-1,3) ] (*(USNO_PNTR[ast])).coef = coef RETURN & END