! This CESRV script is designed to correct
! the dispersion (688) and phase (7260) measurements 
! of 22 April 2008 (688) 
! using all non-superconducting quads 
! 1 May 2008   JAC
 l:CHESS_20050617
 read e:688
 veto eta 38w
 veto eta 26e
 veto eta 20e
 veto eta 16e
 veto eta 9e
 read p:7260
 veto phase 3w
 veto phase 4w
 veto phase 5w
 veto phase 6w
 veto phase 47w
 veto phase 47e
 veto phase 45e
 veto phase 4e
 veto cbar 3w
 veto cbar 4w
 veto cbar 5w
 veto cbar 6w
 veto cbar 47w
 veto cbar 47e
 veto cbar 45e
 veto cbar 4e
 merit_data all
 veto vert 0:99
 veto hori hb01:hb06
 opt_vars all
n
n
 veto skew all
 veto sex all
 veto bpm_tilt all
 veto vert all
 veto hori all
 veto quad all

! use skew 2w:2e
 use quad 3w:3e
! use quad 10w:34w
 opt locked

 plot phase
 plot eta bottom
 clip bottom 0.6
 clip top 20.0
 scale bottom 0.6
 scale top 20.0
 out gif 
yes
no
Prior to simultaneous phase/eta correction
 plot cbar bottom
 scale bottom 0.1
 out gif
yes
yes

 set orbit_x_wgt(0:99)=0
 set orbit_y_wgt(0:99)=0
 set eta_x_wgt(0:99)=0.
 set eta_x_wgt(0:99)=20.
 set eta_y_wgt(0:99)=20.
 set phase_x_wgt(0:99)=20.
 set phase_y_wgt(0:99)=20.
! set cbar12_wgt(0:99)=1e2
 set cbar12_wgt(0:99)=0

 set quad_k1_wgt(0:99)=1e0
 set skew_wgt=1e0

 merit all
 sho data phase x 3
 sho data eta x 3
 limit off
 show top
 run

! plot model-design
 plot eta bottom
 scale bottom 0.6
 scale top 20.
 out gif
yes
no
After simultaneous phase/eta correction
 plot cbar bottom
 scale bottom 0.1
 out gif
yes
yes












