;xy_offsets ; ;PURPOSE: ; This script will return the average offset over the whole night for a given ; point on the ShackHartman grid. The covariance spectrum will then be obtained. ; pro routine_plot_xy_offsets_average,Date=Date,stats_directory=stats_directory,$ x_center_file=x_center_file,y_center_file=y_center_file,$ depth=depth,x_off=x_off,y_off=y_off If (not keyword_set(Date)) then Date='10' If (not keyword_set(stats_directory)) then stats_directory='stats_1_06' If (not keyword_set(x_center_file)) then x_center_file='x_centers.txt' If (not keyword_set(y_center_file)) then y_center_file='y_centers.txt' If (not keyword_set(depth)) then depth=1 If (not keyword_set(postscript_dir)) then postscript_dir='postscripts' If (not keyword_set(x_off)) then x_off=0 If (not keyword_set(y_off)) then y_off=0 postscript_dir='/a/pippin01/Volumes/u08/lsst/CPanalysis/2005-05-'+Date+$ '/ShackHartman/'+postscript_dir+'/' image_dir='/nfs/slac/g/ki/ki08/lsst/CPanalysis/1_06_figs/' ;ARRAYS OF FILES Date_Arr=['10','11','12'] x_offsets_arr=fltarr(3,625) y_offsets_arr=fltarr(3,625) for i=0, n_elements(Date_arr)-1 do begin stats_directory='/nfs/slac/g/ki/ki08/lsst/CPanalysis/2005-05-'+Date_Arr(i)+$ '/ShackHartman/stats_1_06/' off_name=stats_directory+'Average_offsets.txt' readcol,off_name,xoffsets,yoffsets,format='X,X,f,X,f' x_offsets_arr(i,*)=xoffsets y_offsets_arr(i,*)=yoffsets endfor readcol,'/nfs/slac/g/ki/ki08/lsst/CPanalysis/2005-05-'+Date_Arr(0)+$ '/ShackHartman/stats_1_06/Average_offsets.txt',$ x_coord_avg,y_coord_avg,$ format='X,f,X,f,X' x_coord_avg_arr=fltarr(3,625) y_coord_avg_arr=fltarr(3,625) for i=0, 2 do begin x_coord_avg_arr(i,*)=x_coord_avg y_coord_avg_arr(i,*)=y_coord_avg endfor ;CONSTANTS num=25 grid_spots=625 index=findgen(625) set_plot,'ps' device,filename=image_dir+'Average_offsets.ps' loadct,39 ;load color table 39 device,/color ;allow color on the postscript device,ysize=8.5,/inches ;Height of plot in y device,xsize=10.0,/inches ;Width of plot in x device,yoffset=1.0,/inches ;Y position of lower left corner white='FFFFFF'x black='000000'x !P.CHARSIZE=.7 !P.THICK=1.2 items_k_tran=['5/10/05','5/11/05','5/12/05'] sym_k_tran=[80,160,240] line_k_tran=[0,0,0] text_array=[0,0,0] !p.multi=[0,1,1] fitted=where(x_offsets_arr(0,*) ne 0) erase !p.noerase=1 plot,[100,820],[180,880],/xstyle,/ystyle,xrange=[100,820],yrange=[180,880],$ /nodata,color=black,background=white for i=0,2 do begin partvelvec,x_offsets_arr(i,fitted),y_offsets_arr(i,fitted),$ x_coord_avg_arr(i,fitted),y_coord_avg_arr(i,fitted),$ yrange=[100,820],xrange=[180,880],$ background=white,color=sym_k_tran(i),xstyle=5,ystyle=5 endfor legend,items_k_tran,colors=sym_k_tran,psym=line_k_tran device,/close set_plot,'z' erase device, set_font='Courier' device,set_resolution=[1400,1200] !p.charsize=3 !p.charthick=4 !x.thick=4 !y.thick=4 !p.thick=3.5 white='FFFFFF'x black='000000'x red='FF0000'x loadct,39 !p.noerase=0 plot,[100,820],[180,880],/xstyle,/ystyle,xrange=[100,820],yrange=[180,880],$ /nodata,color=black,background=white,ytitle='Y coordinate (pixels)',$ xtitle='X coordinate (pixels)' !p.noerase=1 for i=0,2 do begin partvelvec,x_offsets_arr(i,fitted),y_offsets_arr(i,fitted),$ x_coord_avg_arr(i,fitted),y_coord_avg_arr(i,fitted),$ yrange=[100,820],xrange=[180,880],$ background=white,color=sym_k_tran(i),xstyle=5,ystyle=5 endfor legend,items_k_tran,colors=sym_k_tran,psym=line_k_tran,$ textcolors=text_array jpgimg=tvrd() tvlct,reds,greens,blues,/get write_png,image_dir+'Average_offsets.png',$ jpgimg,reds,greens,blues set_plot,'x' end