;+ ; NAME: ; oc_printstar_buieast ; PURPOSE: (one line) ; Print a star in Buie's ast format w/ errors ; DESCRIPTION: ; Print a star in Buie's ast format w/ errors ; CATEGORY: ; occultation ; CALLING SEQUENCE: ; lines = oc_printstar_buieasterr(stars,filename=filename,silent=silent,$ ; noreturn=noreturn) ; INPUTS: ; stars = list of stars ; OPTIONAL INPUT PARAMETERS: ; none ; KEYWORD INPUT PARAMETERS: ; filename: optional file to write lines to ; silent: if set, don't print to screen ; noreturn: if set, return -1 rather than the lines ; KEYWORD OUTPUT PARAMETERS: ; OUTPUTS: ; the formatted lines ; COMMON BLOCKS: ; None ; SIDE EFFECTS: ; RESTRICTIONS: ; None ; PROCEDURE: ; MODIFICATION HISTORY: ; Mar 10, 2006 Leslie Young SwRI ; Apr 26 2006. Loop index to long. ;- function oc_printstar_buieasterr, stars, filename=filename,silent=silent,$ noreturn=noreturn if not isarray(stars) then begin return, -1 end nstar = n_elements(stars) returnq = not keyword_set(noreturn) printq = not keyword_set(silent) fileq = keyword_set(filename) if returnq then begin lines = strarr(nstar) endif else begin lines = -1 endelse if fileq then begin openw, lun, filename, /get_lun end mas = !dpi/(180.d * 3600e3) ;'060207.020 2453774.03383 17:46:06.8794 -15:46:10.145 13.0' for istar = 0L, nstar-1 do begin star = stars[istar] idstr = star.idcat + "." + string(long(star.id),fo='(I3.3)') cspice_et2utc,star.et,'J',5,jdstr jdstr = (strsplit(jdstr,/ex))[1] rastr = rastrf(star.ra) decstr = decstrf(star.dec) magstr = string(star.mag[0], form='(F5.2)') raerrstr = string(round(star.raerr/mas),form='(I5)') decerrstr = string(round(star.decerr/mas),form='(I5)') s = idstr+' '+jdstr+' '+rastr+' '+decstr+' '+magstr+' '$ +raerrstr+' '+decerrstr if returnq then lines[istar] = s if printq then print, s if fileq then printf, lun, s end if fileq then begin close, lun free_lun, lun end return, lines end