;+ ; NAME: ; smei_cv_catalogue ; PURPOSE: ; Modifies formatting in bright star catalogue ; CATEGORY: ; camera/idl ; CALLING SEQUENCE: PRO smei_cv_catalogue ; INPUTS: ; Text file brightstars.txt in same directory as this routine. ; OUTPUTS: ; updata catalogue (overwrites old one) ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; txt_read, who_am_i ; PROCEDURE: ; Fixes format problem with small negative latitudes. The minus sign ; in front of zero degrees is moved to the minute (or even the seconds ; field) e.g. entry -0 20 20 is changed to 0 -20 20 ; MODIFICATION HISTORY: ; MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- message, 'nope' root = filepath(root=who_am_i(/dir), 'list') onestar = {smei_star_list, nr:0, name:'', obafg:'', ra:fltarr(3), dec:fltarr(3), magb:0.0, magv:0.0, mags:0.0} dumstar = {smei_dum_list , nr:0, name:'', obafg:'', ra:fltarr(3), cdec:'',dec:fltarr(2), magb:0.0, magv:0.0, mags:0.0} formata = '(I4,5X,A13,A13,2I3,F6.2,2X,A3,2I3,1X,3F5.2)' formatr = '(I4,5X,A13,A13,2I3,F6.2,2X,I3,2I3,1X,3F5.2)' file = filepath(root=root, 'brightstars.txt') a = txt_read( file, stars, nrec=count) negative_latitude = 2707 dumstars = replicate(dumstar,count) stars = replicate(onestar,count) openr, /get_lun, iu, file readf, iu, dumstars, format=formata free_lun, iu openr, /get_lun, iu, file readf, iu, stars, format=formatr free_lun, iu small = where( stars.nr GE negative_latitude AND stars.dec[0] EQ 0 ) IF small[0] NE -1 THEN BEGIN minutes = where( stars[small].dec[1] GT 0 ) IF minutes[0] NE -1 THEN BEGIN stars[small[minutes]].dec[1] = -stars[small[minutes]].dec[1] message, /info, 'fixed minutes:'+strcompress(n_elements(minutes)) ENDIF seconds = where( stars[small].dec[1] EQ 0 AND stars[small].dec[2] GT 0) IF seconds[0] NE -1 THEN BEGIN stars[small[seconds]].dec[2] = -stars[small[seconds]].dec[2] message, /info, 'fixed seconds:'+strcompress(n_elements(seconds)) ENDIF FOR i=0,n_elements(small)-1 DO BEGIN print, dumstars[small[i]], format=formata print, stars[small[i]], format=formatr ENDFOR small = where( stars.nr GE negative_latitude AND stars.dec[0] EQ 0 AND stars.dec[1] GT 0) print, small ENDIF openw, /get_lun, iu, file printf, iu, stars, format=formatr free_lun, iu RETURN & END