Analysis Software
Setup
To set up the laserwire software please clone the git repository from:
https://bitbucket.org/stewartboogert/atf2laserwire.git
git clone https://bitbucket.org/stewartboogert/atf2laserwire.git .
The software directory and data directory will exist in different locations. Create a copy of the data locally.
TBC
General
import lwAna3
a = lwAna3.Analysis(filepath)
Here filepath is typically of the form
../dat/raw/20130201_0645_lws.dat
From here, the best thing to do is look inside the instance of the analysis class using tab complete. You will see a list of functions and objects.
- Capital starting letter denotes a function
- small starting letter denotes object
- using a question mark on a function will tell you about it and what it's arguments are
Typical usage:
a.FilterBelowLimit('refc1amp',300)
a.FilterBelowLimit('cherenkov',5000)
a.FilterReset()
a.FilterBelowLimit('refc1amp',300)
a.FilterBelowLimit('cherenkov',1000)
a.X('chaver,'a')
a.Y('cherenkovcnbgs')
a.PlotXYErrorBar()
a.FitOI()
a.PlotXYFitData()
The X and Y methods pull out the data from the data structure for you and all the plotting functions use this x and y data. Any laser-wire data variable can be used for either as well as a bpm name in capital letters - ie QM14FF. The next optional argument is one of:
r or raw |
raw data shaped in axis0=positions, axis1=pulses |
a or averaged |
averaged data - 1D |
f or filtered |
flitered data - same dimensions as raw but is a masked array type |
t or timeseries |
time series - 1D version of filtered without mask |
- time series still to be finished
If not specified, raw will be assumed For bpms, if used in the X function, the x dimension of the bpm is selected automagically. Otherwise you can specify the axis, but you then have to specify the data type ie
a.X('QM14FF','a','y')
Data Variables
Name |
Purpose |
adcdata |
atf2xpos |
atf2ypos |
atfcharge |
atfext |
atfip |
cbpmx |
cbpmy |
chahor |
chaver |
cherenkov |
cherenkov |
cherenkovcn |
cherenkov charge normalised |
cherenkovcnbg |
calculated background |
cherenkovcnbgs |
cherenkov charge normalised background subtracted |
cherenkovcnbgslen |
cherenkov charge normalised background subtracted laser energy normalised |
cherenkovcnbgslpn |
cherenkov charge normalised background subtracted laser photodiode normalised |
ipanglex |
ipanglexabs |
ipangley |
ipangleyabs |
ipbsmdetec |
ipbsmtotal |
ipm1x |
ipm1y |
ipm2x |
ipm2y |
ipoffsetx |
ipoffsetxabs |
ipoffsety |
ipoffsetyabs |
laseren |
laserenergy2 |
laserenraw |
laserpd |
manang |
manver |
mfb2ffampx |
mfb2ffampxcn |
mfb2ffampy |
mfb2ffampycn |
mfb2ffxpos |
mfb2ffypos |
otrlensz |
otrm1x |
otrm1y |
phasev |
refc1amp |
refc1phase |
sampindex |
td21 |
td22 |
td23 |
td41 |
tekm1 |
tekm2 |
tekm3 |
tekm4 |
telescope |
tempahall |
templab |
templaser |
temppfn |
temprack |
wcm |
wsdetector |
wsdetectorcn |
Laser Analysis
Python scripts and LabView vi written for automatic analysis of m2 data. First use lwWinCam_Data_Extractor_v5.vi in run directory.
- Measure M2
- Run labview vi
- run python script
- use python script to select laser propagation for current fit model
LabView VI
For typical usage, the files for the m2 should be recorded as ###.##mm.wcf - the stage position they were recorded at - irrespective of the number of significant digits. ie a stage position of 90mm should be name 090.00mm.wcf. This fixed filenaming makes both sorting of the data easier and dealing with the files as well as interpreting the name as the stage position. The distance from the lens to the stage zero position is also required.
- Input these parameters at the top
- Make sure the button 'use for m2' is selected
Before using this, a DataRay job (read: settings) file should be prepared. To prepare a job file open a wcf buffer in DataRay, set the settings you want -ie
- Clip level1 = 13.5% of max
- Clip level2 = 4 Sigma
- Crosshairs snap to centroid
- Don't show includsion area
- Deselect auto-orient crosshairs
- Drag cross hairs (at the top or bottom) to make the appropriate angle.
Now save the job file to the same directory as the wcf buffer files for the m2 measurement.
- Note the analysis vi will look inside any subfolders and any wcf files will be included - so probably best to have a directory with only the m2 buffers in it.
- The focal length of the lens normally used for m2 measurement at the ATF2 laser-wire is 1.677m at a wavelength of 532nm.
- The angle of the crosshairs must be specified at the top of the vi for the settings file for python analysis - this unfortunately cannot be extracted automatically
- Browse to the directory of the files and click 'current folder' at the bottom right of the browser window
- Browse to the job file
- Click play to run the vi
This will create a file in the directory of the buffer files - a simple tab delimited text file. Each row corresponds to the average of a file. Columns are named and have a column beside the parameter called '+-' for the standard deviation of the measurement.
If 'use for m2' is selected, the vi will use the lens settings, assume a wavelength of 532nm and write all these details down in a few parameter files in a new directory in
extlw/dat/msq/YYYYMMDD_HHMM/
Where the directory is the current time the vi was run. A settings file is created that contains the necessary information for the automatic fitting and analysis of the extracted data, which is also copied to this directory. From here either use the data yourself or proceed to the python scripts.
Python Scripts
These will automatically fit the m2 for both dimensions, scale the data and prepare a settings file for the overlap integral.
pylab
import lwAna3
lwAna3.Laser.DefaultAnalysis('../dat/msq/20130204_2257/')
repeat for different job files -> different directories
lwAna3.Fit.SelectLaserPropagationFile('../dat/msq/20130205_0530/fit_parameters_input.dat')
Overlap Integral
Option |
Function |
Arguments |
a |
SingleOI Empirical |
(dx,dy,sex,sey) |
b |
SingleOI M2 |
(dx,dy,sex,sey,M2) |
c |
OI Y Empirical (vector, dx, sex, sey) |
d |
OI X Empirical (vector, dy, sex, sey) |
e |
OI Y M2 (vector, dx, sex, sey) |
f |
g |
- lwWinCam_Data_Extractor_v5.vi: