#!/bin/csh -f
set nonomatch

#elegant quad.ele

# Collapse the file and also create some measurement error values (Ex, Ey)
# Set these to small values so they shouldn't matter
sddscollapse quad.fin -pipe=out \
    | sddsprocess -pipe=in quad.finc \
    "-define=column,Ex,1e-8 grnd * abs 1e-8 +" \
    "-define=column,Ey,1.5e-8 grnd * abs 1.5e-8 +"

\rm quad.emit	
sddsemitproc quad.finc quad.emit -sigmaData=Sx,Sy -nErrorSets=4 -errorData=Ex,Ey -variableName=L0.L

sddsplot -ylabel="Beamsize (m)" \
    -column=L0.L,Sx,Ex quad.finc -graph=error,subtype=0 -legend=edit=%/Sigma//\
    -column=L0.L,Sy,Ey quad.finc -graph=error,subtype=1 -legend=edit=%/Sigma//\
    -column=L0.L,?SigmaData quad.emit -graph=sym,vary=subtype -legend=edit=%/Sigma// -topline=@EmittanceLabel \
    -column=L0.L,?SigmaFit quad.emit -graph=line,vary -legend=edit=%/Sigma//	



