;plot_shartman_points
;
;PURPOSE:
;	This file will open up the text files containing the ShackHartman wave
;	front centroid positions (x,y) and plot them on a two dimensional plot
;	The program assumes that the centroid positions are located in files 
;	with .coo.1 files
;
;INPUTS,
;	Directory  The directory containing the .coo.1 files 
;
;
;********************************************************

pro plot_shartman_points, Directory=Directory

;set directory path delimiter
    if (!version.os_family eq 'unix') then begin
       delim='/'
    endif else begin
       delim='\'
    endelse

;Background plotting color

TVLCT,[[255],[255],[255]],100
white='FFFFFF'x

If (not keyword_set(Directory)) then Directory='/a/pippin01/Volumes/u08/lsst/CPanalysis/2005-05-10/ShackHartman/'

plot,[200,900],[100,900],/NODATA,xtitle='X coordinate',ytitle='Y coordinate',background=white,color=000,/xstyle,/ystyle

for file_number=1, 100 do begin

if file_number lt 10 then file_name=Directory+'hr5132a_'+string(file_number,format='(I1)')+'_raw.fits.coo.1'
if file_number ge 10 and file_number lt 100 then file_name=Directory+'hr5132a_'+string(file_number,format='(I2)')+'_raw.fits.coo.1'
if file_number ge 100 and file_number lt 1000 then file_name=Directory+'hr5132a_'+string(file_number,format='(I3)')+'_raw.fits.coo.1'

print,file_name

readcol,file_name,x_coord,y_coord,format='f,f',SKIPLINE=42

oplot,x_coord,y_coord,psym=3,color=(float(file_number)/24*100)


endfor

                                                                                                      
end




