Each Undulator is 994.45 mm. Each quad is 100 mm in length (90 effective)  with a 23.75 mm separation or a 123.75 center to center separation  The first quad is 25.975 mm from beginning of the undulator, so the quad centers for undulator 1 should be at:

1.	75.975 mm
2.	199.725
3.	323.475
4.	447.225
5.	570.975
6.	694.725
7.	818.475
8.	942.225

There is 2 mm separation between undulators. The ends add 4.5 mm + 123.75 be between the last undulator 1 quad center and the undulator 2 first quad center.  This adds to be: 130.25 from the center of the last quad in undulator 1 to the center of the first quad in undulator  

1.	1072.475 mm
2.	1196.225
3.	1319.975
4.	1443.725
5.	1567.475
6.	1691.225
7.	1814.975
8.	1938.725

The 1st undulator begins at 196 mm from the detector so the quad centers on the pulsed wire plots are approximately at:
         Z                     Index  (Gives the index of the discrete measurement point)
1.	271.975 mm           949
2.	395.725		 1153
3.	519.475               1357
4.	643.225               1562
5.	766.975		 1765
6.	890.725		 1970
7.	1014.475		 2174
8.	1138.225		 2378

The second undulator starts at 1204.375 mm. The 2nd undulator's quad centers on the pulsed wire plots are approximately at:
		Z			Index
1.	1268.475 mm			2593
2.	1392.225			2798
3.	1515.975			3002
4.	1639.725			3206
5.	1763.475			3410
6.	1887.225 			3614			
7.	2010.975   			3818
8.	2134.725  			3908
    (will use Q8 location =  2.065248 because of noise on ends for By and dispersion)

Using 1.239876 m (Undulator 2 Q1) for the center of the first quad found by using the adjacent zero crossings and finding the center. This is the quad that has the largest kick, so will minimize but also look at last quad at 2.065248 (Undulator 2 Q8).

The calibration magnets were set to 5 amps for these measurements.  The pole tip fields were 96 G for the upstream calibration magnet and 103 G for the downstream magnet, both of which are at 45 degrees.  The Bx and By fields for the upstream and downstream magnets should be: 68 G and 73 G respectively.  The measured peak fields from the pulsed wire data are ~ 68 G.  The downstream calibration magnet doesn’t read higher than the upstream because of dispersion in the wire. 

Filter setup for BTwire program. The BTwire program has 3 sample lengths which smooth the data and the derivatives.  They are:

#define BTWIRE_NUM_SAMP_IN_FIT_SMOOTH 10   -  This smooths the voltage data
#define BTWIRE_NUM_SAMP_IN_FIT_DERIV 10   - This is the # of points for each derivative data point.  This prevents 
#define BTWIRE_NUM_SAMP_IN_FIT_DERIV_SMOOTH 29  - This smooths the derivative data and can be used to filter out the undulator oscillations.  

Scope setup:

1 msec/dev
5 mV/div

Pulser Setup
375 V 

Agilent Function generator setup:
2 microsec square pulse
1 Volt
0.193 Hz

The detector is 196 mm cm from beginning of undulator.

Total time for scope sample = 0.01 sec
Number of samples = 5000
Time per sample = 0.000002 sec or 2 micro sec
Wave speed ~ 306 m/s
Distance for each sample = 306*0.000002 = 0.000612 m/sample
Undulator period = 0.018 m
Samples per period = 0.018 m / 0.000612 m/sample = 29.4 samples/undulator period

Vertical undulator adjustments are 1.5 mm/turn.

Looking at the quad centers for undulator 2 on the scope the centers are

For all alignment runs calibration magnets set to 10 Amps.  The fields should be

Upstream Bx, By = 132.2 G at 0.09 m
Downstream Bx, By = 141.4 G at 2.36 m

The actual locations and fields given for run:
‘Wire Set to X and Y =0, X_US = +0.850, X_DS = +0.545 mm.ru4’ are:
 
Upstream Bx = 144.46 G at 0.086052 m or index = 642
Upstream By = 131.63 G at 0.086658 m or index = 643

Downstream Bx = 132.75 G at 2.371278 m or index = 4413 
Downstream By = 123.18 G at 2.370672 m or index = 4412

The process for alignment was to move the undulator to several offset positions and measure the field at each position (example: VISA Undulator 2 Bx vs z Y offset  = -1.084 mm.bmp).  For each quad determine its  zero field offset using a linear  fit to the offset vs field data (example Undulator 1 Bx vs Y for Quad 1.bmp).     With the zero offsets determined for each quad, fit the quad zero offsets vs z position and move the undulator this amount.  These linear fits and their residuals show what moves were made to align each undulator and the residual offset each quad would have at this alignment.  

The data was processed using programs:  

Process_VISA_Und1_Horizontal_data_set.m
Process_VISA_Und2_Horizontal_data_set.m 
Process_VISA_Und1_Vertical_data_set.m
Process_VISA_Und2_Vertical_data_set.m

These programs use pairs of runs at each offset to determine the fields at each quad.  Then these offsets are fitted and the adjustment at the adjustment points are determined and plotted.