PRO rdybsc4,n,desig,rtasc,dec,mag, thresh=thresh ;program to read in the designation, right ascention, declination, and ;magnitude of stars fron the ybsc4.dat file ; Added THRESH keyword 94/06/20 DPS ; Modified for DOS 96/03/22 DPS @isitdos n = 0 OPENR, unit, ybscdir+dd+'ybsc4s.dat', /GET_LUN READF,unit,n ;n=number of stars - first line of the file p1='' & desig=REPLICATE(p1,n) ;right ascention is in hours,mins,secs p2=0 & rah=REPLICATE(p2,n) p3=0 & ram=REPLICATE(p3,n) p4=0. & ras=REPLICATE(p4,n) ;negative or positive declination p5='' & sign=REPLICATE(p5,n) ;declination in degrees, min, sec p6=0 & dec=REPLICATE(p6,n) p7=0 & decmin=REPLICATE(p7,n) p8=0 & decsec=REPLICATE(p8,n) p9=0. & mag=REPLICATE(p9,n) FOR i=0,n-1 DO BEGIN READF,unit,p1,p2,p3,p4,p5,p6,p7,p8,p9 $ ,FORMAT='(A14,2I3,F5.1,1X,A1,I2,2I3,F6.2)' desig(i)=p1 rah(i)=p2 ram(i)=p3 ras(i)=p3 sign(i)=p5 dec(i)=p6 decmin(i)=p7 decsec(i)=p8 mag(i)=p9 ENDFOR CLOSE,unit ;conversion to decimal degrees rtasc = 15.*(rah + (ram + ras/60.)/60.) dec=dec+(decmin+decsec/60.)/60. ndec=WHERE(sign EQ '-') dec(ndec)=-dec(ndec) FREE_LUN,unit ; Restrict to stars less than a given magnitude IF KEYWORD_SET(thresh) THEN BEGIN sel=WHERE(mag LT thresh,n) desig=desig(sel) rtasc=rtasc(sel) dec=dec(sel) mag=mag(sel) ENDIF RETURN END