E. Métral
06 April 2011

Evolution of the bunch length during the LHC scrubbing run in 2011
(Data from Timber, BQM from GiuliaP, i.e. 8 GHz sampling)

$DefaultFont={"Times",16};

1+1;Print["\nDate:   \t ",DateList[],"\nKernel: \t ",$Version," Release ",$ReleaseNumber,"\n        \t run on ",$MachineName,"@",$MachineDomains,"\n"]

th=0.007;   (* thickness of the lines in the plots*)

fontsize=16;
imsize=70*8;

Off[General::spell];
Off[General::spell1];

1) Reading the data for the bunch length from an external csv from Timber => Bunch length in the BQM

SetDirectory["/Users/eliasmetral/Documents/CERN/Private_Since_07-12-08/CERNMachines/LHC/MDs/2011/LHCScrubbingRun2011/DataForBunchShortening/MD_06-04-11"]

Data0=Import["TIMBER_DATA_BunchLengths2.csv"];
dim0=Dimensions[Data0]

Data1=Take[Data0,-dim0[[1]]+2];
Dimensions[Data1]

numberOf25nsRFbuckets=Dimensions[Data1][[2]]

DataTimeSteps=Transpose[Data1][[1]];
numberOfTimeSteps=Dimensions[DataTimeSteps][[1]]

DataToBePlotted=Transpose[10^9*Take[Transpose[Data1],-numberOf25nsRFbuckets+1]];

xmin=0;
xmax=500;
ymin=0;
ymax=2;
listplot1=ListPlot[DataToBePlotted[[1]],PlotRange->{{xmin,xmax},{ymin,ymax}},Frame->True,FrameLabel->{"Bunch number","Bunch length [ns]"},GridLines->Automatic,PlotStyle ->{RGBColor[0,0,0],PointSize[0.02]},ImageSize->imsize,LabelStyle->Directive[20,Bold]]

DataTimeSteps[[669]]

listplot669=ListPlot[DataToBePlotted[[669]],PlotRange->{{xmin,xmax},{ymin,ymax}},Frame->True,FrameLabel->{"Bunch number","Bunch length [ns]"},GridLines->Automatic,PlotStyle ->{RGBColor[0,0,1],PointSize[0.02]},ImageSize->imsize,LabelStyle->Directive[20,Bold]]

DataTimeSteps[[738]]

listplot738=ListPlot[DataToBePlotted[[738]],PlotRange->{{xmin,xmax},{ymin,ymax}},Frame->True,FrameLabel->{"Bunch number","Bunch length [ns]"},GridLines->Automatic,PlotStyle ->{RGBColor[1,0,0],PointSize[0.02]},ImageSize->imsize,LabelStyle->Directive[20,Bold]]

ShowAll=Show[listplot1,listplot669,listplot738,ImageSize->imsize,LabelStyle->Directive[20,Bold]]

ShowAllZoom=Show[listplot669,listplot738,PlotRange->{{xmin,xmax},{0,2}},ImageSize->imsize,LabelStyle->Directive[20,Bold]]

2) Reading the data for the filled bucket from an external csv from Timber => Filled bucket in the BQM (opening the file and erasing the lines before the one dealing with FILLED BUCKETS)

Data2=Import["TIMBER_DATA_FilledBuckets2ndCase2.csv"];
Dimensions[Data2]

Data21=Take[Data2[[3]],-numberOf25nsRFbuckets+1];

Dimensions[Data21][[1]]

NumberOfBunchesNominal=300; (* total number of bunches except the low intensity pilot bunch in position 1 *)
ListOfFilledBucketsNominal=Take[Data21,NumberOfBunchesNominal]

DataFinalToBePlotted1=Table[{Data21[[i]],DataToBePlotted[[669]][[i]]},{i,1,NumberOfBunchesNominal}];

listplotFinal1=ListPlot[DataFinalToBePlotted1,PlotRange->{{0,35640},{0,2}},Frame->True,FrameLabel->{"Bunch number","Bunch length [ns]"},GridLines->Automatic,PlotStyle ->{RGBColor[0,0,0],PointSize[0.02]},ImageSize->imsize,LabelStyle->Directive[20,Bold]]

DataFinalToBePlotted2=Table[{Data21[[i]],DataToBePlotted[[738]][[i]]},{i,1,NumberOfBunchesNominal}];

listplotFinal2=ListPlot[DataFinalToBePlotted2,PlotRange->{{0,35640},{0,2}},Frame->True,FrameLabel->{"Bunch number","Bunch length [ns]"},GridLines->Automatic,PlotStyle ->{RGBColor[1,0,0],PointSize[0.02]},ImageSize->imsize,LabelStyle->Directive[20,Bold]]

Show[listplotFinal1,listplotFinal2]

ShowAllZoom=Show[listplotFinal1,listplotFinal2,PlotRange->{{0,20000},{0.6,1.8}},ImageSize->imsize,LabelStyle->Directive[20,Bold]]

Show[listplotFinal1,listplotFinal2,PlotRange->{{16900,17900},{0.6,1.8}},ImageSize->imsize,LabelStyle->Directive[20,Bold]]