;+ ; NAME: ; oc_printstar_buierefnet ; PURPOSE: (one line) ; Print a star in Buie's refnet format ; DESCRIPTION: ; Print a star in Buie's refnet format ; CATEGORY: ; occultation ; CALLING SEQUENCE: ; lines = oc_printstar_buieast(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: ; USAGE ; stars = oc_getstar_ucac2_2006(/all) ; dir = '~/reference/stellar_cat/UCAC2_2006/' ; fn = dir + 'cpos_07.p.refnet' ; foo = oc_printstar_buierefnet(stars, file=fn, /si, /nor) ; MODIFICATION HISTORY: ; June 5, 2007 Leslie Young SwRI ;- function oc_printstar_buierefnet, stars, filename=filename,silent=silent,$ noreturn=noreturn, magindex=magindex 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 nmag = n_elements(stars[0].mag) if keyword_set(magindex) then begin m = (magindes < (nmag-1) ) endif else begin if nmag eq 1 then m = [0,0] else m = [0,1] endelse ;'060207.020 2453774.03383 17:46:06.8794 -15:46:10.145 13.0' ;' for istar = 0L, nstar-1 do begin star = stars[istar] rastr,star.ra,4,rastr, sepc=' ' decstr,star.dec,3,decstr, sepc=' ' magstr1 = string(star.mag[m[0]], form='(F4.1)') magstr2 = string(star.mag[m[1]], form='(F4.1)') s = rastr+' '+decstr+' '+magstr1 + ' ' + magstr2 + ' 0 0' 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