;+ ; NAME: ; rdybsc4 ; PURPOSE: ; Read the Yale Bright Star Catalogue, 4th ed. ; CATEGORY: ; Image orientation. ; CALLING SEQUENCE: ; PRO rdybsc4,n,desig,rtasc,dec,mag, thresh=thresh, path=path ; INPUTS: ; None. ; OPTIONAL INPUTS: ; None. ; KEYWORD PARAMETERS: ; thresh: Specifies the magnitude of the faintest stars desired. ; path: Specifies the fully qualified path of the star catalogue ; file, in case it's not in the default location. ; OUTPUTS: ; n: The number of stars returned. ; desig: Array of standard designations for all stars returned. ; rtasc: Array of right ascensions (deg) " " " " . ; dec: " " declinations (deg) " " " " . ; mag: " " magnitudes " " " " . ; OPTIONAL OUTPUTS: ; None. ; COMMON BLOCKS: ; None. ; SIDE EFFECTS: ; The star catalog file is read. ; RESTRICTIONS: ; The star catalog must exist at the specified location. ; PROCEDURE: ; Straightforward. ; EXAMPLE: ; ; SEE ALSO: ; ; MODIFICATION HISTORY: ; Written by: D. van der Schee, May 1993. ;- PRO rdybsc4,n,desig,rtasc,dec,mag, thresh=thresh, path=path ;program to read in the designation, right ascension, 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 IF N_Elements(path) EQ 0 THEN path='' IF StrLen(path) GT 0 $ THEN OpenR, unit, path, /Get_Lun $ ELSE 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