40m QIL Cryo_Lab CTN SUS_Lab TCS_Lab OMC_Lab CRIME_Lab FEA ENG_Labs OptContFac Mariner WBEEShop
  TCS elog, Page 3 of 6  Not logged in ELOG logo
ID Dateup Author Type Category Subject
  101   Tue Nov 23 06:15:08 2010 WonComputingHartmann sensorImage folder structure

Attached below is a diagram that describes the organisation of image folders that I am using at the moment with Run_initialize and Run_acquire scripts.

Once the uppermost folder 'image' is set up, other folders in it will be created by the matlab codes if not present. Still it may be of less hassle to create the folders beforehand.

Images that are used during State 1 are saved inside 'probe' and 'secondary' folders (but not inside 'cbt' folders) with prefixes, e.g., 'dark' (for background count estimation) 'expadj' (for exposure adjustments), 'test' etc.

Hope this helps to understand image saving/reading procedures used throuout the two Run scripts. 


  102   Tue Nov 30 11:01:19 2010 AidanComputingGeneralNew workstation added in TCS Lab. New Static IP

I added a workstation at in the TCS lab.

  103   Tue Nov 30 11:03:19 2010 AidanComputingFrame GrabberEDT frame grabber works under Ubuntu

The new machine in the TCS lab is running Ubuntu. I installed the frame-grabber into it and, after loading the configuration file for the camera, was able to access the serial port on the camera and also was able to record a properly formatted image from the Hartmann sensor.

  104   Tue Jan 25 16:38:16 2011 AidanElectronicsPre-amplifierL1 TCSY ISS Board transfer function

 I measured the AC and DC channel transfer functions of the eLIGO L1 TCSY ISS board for PD1 and PD2. The gain is quite high on the AC channels so I added +40dB of attenuation to the source from the SR785. As Frank pointed out, even though this isn't exactly +40dB at low frequencies, it still attenuates and that attenuation is common to both the input to the Channel 1 of the SR785 and the input to the ISS board.

The results are shown in the attached plot. I didn't bother including the phase, I'm just interested in the magnitude for calibration purposes.

 The original data files from the SR785 are attached below: 

Channel Name Filename
L1 TCSY PD1 - AC SRS003.78D
L1 TCSY PD2 - AC SRS004.78D
L1 TCSY PD1 - DC SRS005.78D
L1 TCSY PD2 - DC SRS006.78D


Attachment 1: L1TCS_ISS_boards_transfer_functions.pdf
Attachment 2: SRS003.78D
Attachment 3: SRS004.78D
Attachment 4: SRS005.78D
Attachment 5: SRS006.78D
  105   Tue Feb 8 13:02:26 2011 AidanElectronicsDelivery NoteThorlabs S322C 200W power head arrived

 The 200W Thermopile power head from Thorlabs arrive today. The scanned delivery note and calibration info are attached.

Attachment 1: Co2_200W_power_meter_delviery_note.pdf
Attachment 2: Co2_200W_power_meter_calibration_info.pdf
  106   Fri Feb 18 13:26:23 2011 AidanThings to BuyDelivery NoteFirst parts of Bosch framing have arrived from Valin

The first pieces of the Bosch framing have arrived from Valin Corporation. These are just small pieces such as the fasteners and the gussets. There are no custom lengths of framing yet.

The details are in the attached Packing List. [1:25PM] I haven't verified that everything is there yet.


Attachment 1: Packing_List_01.pdf
Packing_List_01.pdf Packing_List_01.pdf
  107   Fri Feb 18 14:53:50 2011 PhilLaserLaserLTG laser delivering specified power

I got the LTG CO2 laser to deliver 50.02W as measured by the Thorlabs 200W power head today. This required running the Glassman HV supply at full power (30.0kV, 31.1mA), tweaking the end grating and output coupler alignments, and cleaning the ZnSe Brewster windows on the laser tubes, and it only lasted a few seconds before dropping back to ~48W, but the laser delivered the specified power. In the factory it delivered 55W at the 10.6 micron line I am using now- I checked it with the CO2 laser spectrum analyzer- so there is more work to do.

  108   Wed Feb 23 18:04:38 2011 AidanThings to BuyDelivery NoteFirst parts of Bosch framing have arrived from Valin


The first pieces of the Bosch framing have arrived from Valin Corporation. These are just small pieces such as the fasteners and the gussets. There are no custom lengths of framing yet.

The details are in the attached Packing List. [1:25PM] I haven't verified that everything is there yet.


 Another box of Bosch stuff arrived in my office. The packing list is attached

Attachment 1: Packing_List_02.pdf
Packing_List_02.pdf Packing_List_02.pdf
  109   Wed Feb 23 20:18:30 2011 AidanElectronicsHartmann sensorSuccessfully re-started the Hartmann sensor

 I reattached the Hartmann Sensor to the LENOVO machine that is running Ubuntu and turned it on (it's been disconnected for a couple of months). The /opt/EDTpdv/serial_cmd was able to communicate successfully with the camera.

  110   Thu Feb 24 10:23:31 2011 Christopher GuidoLaserLaserLTG initial noise

Cheryl Vorvick, Chris Guido, Phil Willems

Attached is a PDF with some initial noise testing. There are 5 spectrum plots (not including the PreAmp spectrum) of the laser. The first two are with V_DC around 100 mV, and the other three are with V_DC around 200 mV. (As measured with the 100X gain preamplifier, so ideally 1 and 2 mV actual) We did one spectrum (at each power level)  with no attempt of noise reduction and one spectrum with the lights off and a make shift tent to reduce air flow. The 5th plot is at 200mv with the tent and the PZT on. (The other 4 have the PZT off).


The second plot is just the spectrums divided by their respectives V_DC to get an idea of the RIN.

Attachment 1: LTG_InitialTest.pdf
LTG_InitialTest.pdf LTG_InitialTest.pdf
  111   Thu Feb 24 13:35:41 2011 AidanThings to BuyDelivery NoteBosch framing has arrived

 The custom pieces of the Bosch framing have arrived. Transportation is currently moving them downstairs to the lab. The packing list is attached.



Attachment 1: Packing_List_03.pdf
Packing_List_03.pdf Packing_List_03.pdf
  112   Thu Feb 24 14:20:55 2011 AidanMiscRing HeateraLIGO H2 Ring Heater Pics

 Here are some pictures of the ring heater segments destined for the H2 Y-arm this year.

 These still need to be put onto ResourceSpace.

Attachment 1: aLIGO_Ring_Heaters.zip
  113   Thu Feb 24 14:23:58 2011 AidanLab InfrastructureHartmann sensorHartmann Sensor box cut down to size

 I reduced the height of the Hartmann sensor box. This is what it looks like now:


Attachment 1: P1000109.jpg
Attachment 2: P1000110.jpg
Attachment 3: P1000111.jpg
Attachment 4: P1000113.jpg
  114   Mon Feb 28 17:33:07 2011 AidanComputingHartmann sensorHartmann Seidel abberation channels in frame builder

Using the same methods as before, see below, I've added some Hartmann sensor EPICS channels to the frames.

The channels record the Hartmann sensor Probe (and Secondary) Coefficients of the Seidel aberrations (PSC, SSC) that are specified (PRISM, ALPHA, PHI, etc).

  1. Created /cvs/cds/caltech/chans/daq/C4HWS.ini with the attached contents.
  2. Added a line to /cvs/cds/caltech/target/fb1/master to load C4HWS.ini
  3. restarted the frame builder by killing daqd




 I've added the digitizer and sensor board temperature readings from the HWS to the frames. This was done in the following way

1. Create a new file /cvs/cds/caltech/chans/daq/C4TCS.ini - with the channels in it - see below

2.  open /cvs/cds/caltech/target/fb1/master

3. add a line that includes the C4TCS.ini file when the frame builder starts

4. restart frame-builder by killing the daq daemon - kill <process id for daqd> (this is the only thing that needs to be entered as it will automatically restart)























  115   Mon Feb 28 17:56:32 2011 AidanComputingHartmann sensorGot HWS code running and interface to EPICS

Here are the notes from today's efforts:



- When you 'Run_HWS' in MATLAB and the camera has not been initialized, it says the camera is not accessible. Either that or you need to run 'sudo matlab' (no, sudo doesn't help)

- In Ubuntu have to run '/opt/EDTpdv/initcam -f ~/dalsa_1m60.cfg' to start the camera

- Now have to install MCA

- MCA installed by is crashing MATLAB - not sure why. Maybe its a 'sudo' problem again?
- sudo matlab has the following problem:
??? Invalid MEX-file
libdbStaticHost.so.3.14: cannot open shared object file: No such file or
- adjusting Makefile for MCA to include the correct suffix for a Linux based MEX file ('mexa64', not 'mexglnx') gets the program to compile correctly and then MATLAB runs MCA fine.

- Running 'Run_HWS' with EPICS running but no channels crashes the program

- copy the HWS.db file to the EPICS db location

- cannot create the matlab images folder when the program runs.
- created these manually
- program is trying to adjust the maximum pixel count - it is failing and the camera is complaining (intensity is quite low right now)
- why exposure mode 6? - requires an external SYNC signal
- can't handle low exposure - FIX THIS!!
- why is the expsoure time increased in stepwise fashion? Use algorithm!
      - Commenting this out!!
    - same for the secondary beam
- After running State 1 it asks to continue to State 2 - if you select 'n' the program crashes

- steered beam properly onto HWS
- continue to State 2 - 'yes' crashes the program
- HS_report is doesn't work
- commented out lines 37 to 47

- get rid of constant requests to continue [run_acquire_auto.m]
- change names of EPICS variables [done]
- add an RMS variable
- the named EPICS variables need to be dynamically named rather than statically named.

run_acquire_auto.m CHANGES
0. Update sensor date: mres = 'y'
1. pres = 'n'; - don't update reference centroids
2. sres = 'n'; - don't update secondary reference centroids
3. select probe beam commented out
4. select secondary beam commented out
5. State 2B - select probe live commented out
6. set user_response = 'y' for continue

A1 - added a loopcounter that starts at zero. the first loop includes user prompts and then they're bypassed in subsequent loops.


-Seidel aberration fitting seems wrong - not resembling the integrated field
- get rid of the constant pop ups
- have a network license EPICS variable
- how many images are used for reference image?
    - added a variable in run_acquire_auto.m :
        - no_of_cim_ref = 200; (no_of_cim = 5 images was previous)
    - changed the averaging in reference image acquisition from
        - "no_of_cim" to "no_of_cim_ref"
    - didn't change the take command from 5 to 200 images
- commented out lines 239-242 in run_initialize - gives a second way to start run_acquire.m
- probe and secondary beams share the probe background - deliberate?
- average all the images and save as a single matlab 16-bit array
- what is the rms noise as a function of the reference image number of averages?

Changing the EPICS variable names.
1. HS_WF - where Seidel coefficients are named.
    - in function seidel_from
2. changed the following lines in 'run_acquire_auto.m'
        %channelname = ['probe-seidel-',fn{counter}];
            channelname = ['C4:TCS-HWSX_PSC_', fn{counter}];

        %channelname = ['secondary-seidel-',fn{counter}];
            channelname = ['C4:TCS-HWSX_SSC_', fn{counter}];
3. ammended the following code in 'run_acquire_auto.m'

    maxEPICSLength = 14;
    for counter = 1:length(fn)
        %channelname = ['probe-seidel-',fn{counter}];
        strname = upper(fn{counter});
        if (numel(strname) > maxEPICSLength)
            strname = strname(1:maxEPICSLength);
        channelname = ['C4:TCS-HWSX_PSC_', strname];
        probe_seidel_array{counter} = HS_EPICS(channelname);
- bug: on restarting and pressing 'space' and enter at approximately the same times here, the program crashed:

Is it okay to assign one of the already existing handle (y or n)? y
Assigned handle 2 to the instance.
Established the connection to the channel secondary_shutter_open.

hsep_secondary =

  HS_EPICS handle

         channelname: 'secondary_shutter_open'
             handler: 2
    EPICS_is_running: 1

  Methods, Events, Superclasses

Please select the probe beam as the light source. Hit any key to continue.

??? Error using ==> textscan
First input can not be empty.

Error in ==> HS_Camera>HS_Camera.get_exposure_time at 942
        ccet = textscan(ccet,'%f %s');


Added the following lines to HWS.db

record(ai, "C4:TCS-HWSX_PSC_PRISM")
record(ai, "C4:TCS-HWSX_PSC_ALPHA")
record(ai, "C4:TCS-HWSX_PSC_PHI")
record(ai, "C4:TCS-HWSX_PSC_COMA")
record(ai, "C4:TCS-HWSX_PSC_BETA")
record(ai, "C4:TCS-HWSX_SSC_PRISM")
record(ai, "C4:TCS-HWSX_SSC_ALPHA")
record(ai, "C4:TCS-HWSX_SSC_PHI")
record(ai, "C4:TCS-HWSX_SSC_COMA")
record(ai, "C4:TCS-HWSX_SSC_BETA")

- restarting IOC with C4:TCS-HWSX channels


-time to add these to the frames


  116   Tue Mar 1 10:47:18 2011 AidanMiscHartmann sensorElectron to Counts conversion efficiency

Using some of the old data from James (attached below), I calculated the CCD conversion efficiency (CE) from electrons to bits (Counts).

Number of electrons(Ne) = QE*Number of Photons(Np)

noiseE = sqrt(Ne);

Number of Counts (NCo)= CE*Ne

Noise in Counts (noiseCo)= CE*sqrt(Ne)

noiseCo = sqrt(CE * NCo)

log(CE) = 2*noiseCo - NCo

Therefore CE = 10.0^(2*noiseCo - NCo)

From James's data on the intensity noise in the CCD, CE = 0.0269


Using this function, I did the same analysis of the upper-left 200x200 pixels over all 200 images:

(data from 200 images, over the upper-left 200x200 pixels)


  117   Tue Mar 1 11:19:34 2011 AidanThings to BuyDelivery NoteMFF001 flipper mirror has arrived

 The Thorlabs MFF001 flipper mirror recommended by Bram has arrived. The delivery note is attached.

Attachment 1: Flipper_mirror_delivery_notice.pdf
  118   Tue Mar 1 11:21:37 2011 AidanThings to BuyDelivery NoteMore Bosch framing parts - angle connectors

 Another box of Bosch framing parts arrived today. The delivery note is attached.

Attachment 1: Packing_List_04.pdf
  119   Tue Mar 1 17:05:45 2011 AidanElectronicsHartmann sensorDalsa 1M60 current draw

Steve and I measured the current drawn by the Dalsa 1M60 by connecting it to the BK Precision 1735 lab power supply that display current and voltage supplied. We tried the camera at a variety of different voltages. The results are presented below:

Voltage  Current(t<5s)  Current(5s<t<10s)   Current(t>10s)

12.7V       0.6A              0.8A              1.11A

15.0V       0.55A             0.69A             0.91A

18.0V       0.41A             0.57A             0.75A

20.0V       0.42A             0.52A             0.67A

Additionally, we tried running the other camera with the lab power supply. I varied the exposure mode and exposure time and checked the current drawn. The supplied voltage was 18.0V.

Exposure Mode 4: current = 0.67A

Exposure Mode 2: 58Hz, exposure time = 16 ms, current = 0.70A

Exposure Mode 2: 58Hz, exposure time = 100 us, current = 0.72A

Exposure Mode 2: 1Hz, exposure time = 998 ms, current = 0.68A

Exposure Mode 2: 1Hz, exposure time = 16 us, gm 0, current = 0.69A

Exposure Mode 2: 1Hz, exposure time = 16 us, gm 2, current = 0.69A

  120   Thu Mar 3 07:30:18 2011 WonComputingHartmann sensorEffect of high pixel count on rms

We have been investigating how pixel count is related to the centroid displacements by taking several sets of image frames with different camera
exposure time and input current.

It appears that the reason why rms value did not drop as fast as it should (as the number of averaged image frames increases) is that the pixel counts were too high.

As was previously done, we took 5000 images for rms analysis, and the reference set of centroids were generated from averaging 4000 sets of centroids using first 2000 and last 2000 images. Once a set of centroids for each image frame is obtained and saved (it took about 30 minutes to obtain centroids of 5000 image frames), rms analysis could be done in seconds.

(Alternatively, one could average the images first then find centroids, but this is much slower and the rms values do not change much.)

First figure is the log plot of rms versus N_av (number of image frames that are averaged over), where the maximum pixel count was about 2000.

Blue line is the calculated rms values, red line is the linear fit of the rms values, and black line is the line of the ideal slope -0.5. The rms values are in pixel units. The slope of the linear fit is -0.487. 

Centroids are obtained from the images taken with the exposure time of 23ms, the value of the current driving light source 28 mA, and the distance between the CCD and the light source was about 50 cm. 


Second figure is the plot using images whose max pixel counts were about 2700 (30ms exposure, same current): this gave the fitted slope to be -0.07.


Next two figures are the plots of rms with the same image set (images with max pixel count of 2700), using 

1. centroids whose peak pixel counts are below 2048 (45 out of 904 centroids), and

2. centroids whose peak pixel counts are above 2047 (859 out of 904 centroids). 
Peak pixel counts were obtained from the first image frame. As pixel counts fluctuate between image frames, it would perhaps be better to use averaged images but the outcome will still be qualitatively the same.

These plots clearly show that centroids with high peak pixel counts are responsible for poor reproducibility of the centroids.

The reason why the value of 2048 was chosen to separate centroids is because the camera will have to use the 12th bit for pixel counts 2048 or above.

I need to do more analysis to determine conclusively if the 12th bit is indeed responsible. What is clear at this point is that, once peak pixel counts go over about 2000, the reproducibility of centroids worsens significantly.


Further investigation revealed that, for the second centroids set (i.e., the centroids obtained from 30ms images) I discussed here, the decrease in centroids reproducibility is due to one spot whose position fluctuated much more wildly than others. That same spot does not cause problems in my first set with lower pixel counts. Here is the 2D plot of rms values of individual centroids fluctuations over image frames. I used griddata command to interpolate values between centroids to get this false color map;


The spot shown on the plot corresponds to the centroid located at the pixel (x,y) = (749,353). Its rms value with N_av = 1000 was 0.055 pixel uniits, which is more than ten times as big as average centroid displacements between two images (which is about 0.003).

Once you remove this centroid from the reference set and redo the analysis, the fitted slope goes back to -0.46.

Since I was wondering if high pixel counts worsens the reproducibility of the centroids, I also generated scatter plot of (1) rms vs peak pixel counts and (2) fitted slope for each centroid vs peak pixel counts (without removing the problematic centroid):

rms_v_pc-with.png slope_v_pc-with.png

It is evident that one centroid is a huge outlier in rms vs pixel counts plot, but it is not so obvious in the plot of slopes vs pixel counts. Furthermore, there does not appear to be any correlation between pixel counts and the values of the fitted slopes. 

And here are the scatter plots after removing the problematic centroid:


which suggests that there is no real correlation between peak pixel counts of centroids and their values of rms or fitted slope. What is still happening, although, is that as we increase pixel counts by either increasing the camera exposure time or the intensity of the light source, the value of the fitted slope increases as well (hence decreases the reproducibility of centroids).

I will continue this discussion in my next post...

Attachment 2: rms-low.png
  121   Tue Mar 8 11:30:26 2011 AidanComputingHartmann sensorHartmann sensor code changes and NTP server

I've made the following changes to the Hartmann sensor code and to the machine running the HWS.

  • Machine name is now princess_sparkle (
  • I set up ntpd on that machine to sync the clock to GPS - roughly.
  • I added a MATLAB function (store_current_centroids.m) to the Hartmann sensor that saves the centroids and peak intensities to file in GPS labeled files
  • ~/Hartmann_Sensor_Data/centroids/<GPSTIME1>/<GPSTIME2>/<GPSTIME>_<name>.mat

GPSTIME1 = floor(GPSTIME/4E4)*4E4

GPSTIME2 = floor(GPSTIME/2E2)*2E2

I had to add a line in the run_acquire_auto.m script to accommodate this new function and I had to add a function that calculates the peak intensities to the HS_Centroids.m class.

  122   Tue Mar 8 18:28:14 2011 AidanComputingGeneralTO DO notes
  1. Write a Wiki page that describes how to add channels to the Athena Box
  2. Write a Wiki page that describes how to add a new computer to the network and mount all the network drives
  3. Add an EPICS channel that writes the disk usage to file (to keep track of the total accumulated disk space used by the centroid storage)
  123   Tue Mar 8 18:48:00 2011 AidanComputingHartmann sensorHWS code is running and recording centroids

The Hartmann sensor is running continuously and is now recording data to file. The formatting has changed slightly with the data now stored in structures called store_measurement every 200s in files in the following way:

  • store_measurement(ii).centroids - the ii-th centroids
  • store_measurement(ii).intensities - the ii-th intensity list
  • store_measurement(ii).time - the time of the ii-th measurement

The files are stored in ~/Hartmann_Sensor_Data/centroids/<GPSTIME rounded to nearest 4E4 seconds>/<GPSTIME rounded to nearest 2E2 seconds>_<subname>.mat


  124   Tue Mar 8 18:57:50 2011 AidanThings to BuyDelivery NoteFiber optics cable and Bosch Fastener
Attachment 1: deliveries_2011-03-08.pdf
deliveries_2011-03-08.pdf deliveries_2011-03-08.pdf
  125   Wed Mar 9 01:00:12 2011 Peter Veitch, Won KimComputingHartmann sensorControl of frame rate usign external trigger

We managed to successfully apply frame rate control via external trigger from a pulse generator.

We supplied 5V pulse train when connected to the optocoupler load, and connected to pins 1 and 2 of external trigger (on the frame grabber board) for using camera 0 (which is the case for us).

Then made the following changes to the config file dalsa_1m60.cfg;

MODE_CNTL_NORM: A0 (previously this value would have been 00)

user_timeout: 0    (this line should be added)

Then I saved the new config file as dalsa_1m60_et.cfg

Next, I loaded the new config using initcam command, then set the exposure mode to be 3. This can be done either using serial_cmd directly or using HS_Camera method set_exposure_mode.

In exposure mode 3, the exposure time is set by the time separation between the falling edges of the pulses, and the camera sets the expousure time to be the maximum value possible (as specified in the camera manual). 

Then I took 10 images using take command, and verified that the frame rate is equal to the frequency of the pulse. We tested 1 Hz and 2 Hz pulse trains, and the frame grabber recoded 1 frames per sec and 2 frames per sec respectively.

We could not yet test the frequency values < 1 Hz as pulse generator we used could not go under 1 Hz.


We used another pulse generator to test pulse frequencies under 1 Hz, and verified that external trigger mode still works.

  126   Fri Mar 11 13:11:33 2011 AidanLab InfrastructureDelivery NoteMore Bosch connectors have arrived

 See attached delivery note ...

Attachment 1: Packing_List_05.pdf
  127   Wed Mar 16 15:05:47 2011 AidanLab InfrastructureDelivery NoteMore Bosch equipment has arrived

30mm T-junctions, grounding straps and T-slot covers have arrived


 See attached delivery note ...


Attachment 1: Packing_List_06.pdf
Packing_List_06.pdf Packing_List_06.pdf Packing_List_06.pdf
  128   Mon Mar 28 13:00:50 2011 AidanLaserHartmann sensorTo do: Check the polarization from the SLED
  129   Wed Mar 30 12:55:54 2011 AidanLaserHartmann sensorPrism modulation experiment

I've set up a quick experiment to modulate the angle of the Hartmann sensor probe beam at 10mHz and to monitor the measured prism. The beam from the SLED is collimated by a lens and this is incident on a galvo mirror. The reflection travels around 19" and is incident on the HWS. When the galvo mirror is sent a 1.1Vpp sine wave, then beam moves around +/- 0.5" on the surface of the Hartmann sensor, giving around 50mrad per Vpp.

The galvo is currently being sent a 0.02Vpp sine wave at 10mHz.

  130   Thu Mar 31 11:27:02 2011 AidanLaserHartmann sensorPrism modulation experiment

I changed the drive amplitude on the function generator to 0.05Vpp and have measured the angle of deflection by bouncing a laser off the laser mirror and projecting it 5.23m onto the wall. The total displacement of the spot was ~3.3mm +/- 0.4mm, so the amplitude of the angular signal is 1.6mm/5.23m ~ 3.1E-4 radians. The Hartmann Sensor should measure a prism of corresponding magnitude.

The frequency is still 10mHz.


I've set up a quick experiment to modulate the angle of the Hartmann sensor probe beam at 10mHz and to monitor the measured prism. The beam from the SLED is collimated by a lens and this is incident on a galvo mirror. The reflection travels around 19" and is incident on the HWS. When the galvo mirror is sent a 1.1Vpp sine wave, then beam moves around +/- 0.5" on the surface of the Hartmann sensor, giving around 50mrad per Vpp.

The galvo is currently being sent a 0.02Vpp sine wave at 10mHz.


  131   Fri Apr 1 02:41:55 2011 WonComputingHartmann sensorexposure time and reproducibility of centroids

 Here is a brief and preliminary summary of rms of centroid displacements calculated at a number of different exposure time values. To get the results I did the following for each value of exposure time:

1. Take a set of images. I took 2000 images for shorter exposure times, 1000 images with exposure times greater than 1 second, and 200 images with exposure time 4.4 second. I tried to keep the maximum pixel count to be roughly the same (about 2430 plus/minus 40).

2. Obtain the centroids for each image frames in a set. I saved centroids as an array of n by m by 2, where n is the number of image frames that I took, m is the number of centroids in each frame, and 2 for x and y coordinates.

Then I iterated through the centroid sets to calculate total rms, using various N_av values. If N_av = 100; then reference centroids were obtained by averaging the centroids of first 50 and the last 50 frames, and remaining 100 frames are averaged to get the other (or non-reference) centroids. I think this method gives a better view of the centroid reproducibility than fixing the number of reference centroids to be, say, first 1000 and last 1000 frames and varying the number of frames to be averaged for non-reference centroid.

Datasets of centroids are labelled as spcdet_I_t, where spcdet stands for "same (maximum) pixel count (with) differen exposure times", I the value of the current that drives the light source, and t the exposure time that I used.

Here are the plots:






It can be seen from these plots that the benefit of averaging multiple frames quickly diminish once we go over 1 second. I am investigating if there is any way to improve the reproducibility while using the same sets of images.

Issues that need further investigation:

  1. Effect of pixels with unusually high pixel count. Dark images that we took show that, with longer exposure times, not only overall dark noise increase (and become less uniform) but also several pixels show unusually high pixel count (even higher than 2000), without a light source on. More investigation is needed to determine how much this affects the centroids calculation and to devise an way to deal with it.

  2. Extra/Duplicate centroids. As exposure time increased, I observed that duplicate centroids start to appear, i.e., HS_Centroids##centroids had duplicate entries. The number of duplicate entries increased as exposure time increased. I believe this is due to the images getting noisier as exposure time increases. So After taking initial reference centroids, I removed duplicate centroid entries before calculating rms. I am thinking about adding a method to do this in HS_Centroids class.

In addition, there were one 'false' centroid when the exposure time was 4.4 seconds. For now I chose to manually remove it myself before calculating rms.

  132   Fri Apr 1 09:51:45 2011 AidanComputingHartmann sensorPrism measurement

 I analyzed the results from the prism experiment. The time series and spectra of the prism are attached.

Conclusions to follow ...

Attachment 1: Hartmann_Sensor_prism_measurement_2011-03-31.pdf
Attachment 2: Hartmann_Sensor_Prism_measurement_times_series_2011-03-31.pdf
  133   Mon Apr 4 13:13:23 2011 AidanThings to BuyDelivery NoteNewfocus 5102 mirrors and Firewire extension cable have arrived

 See attached delivery note ...

Attachment 1: receipt_mirrors.pdf
receipt_mirrors.pdf receipt_mirrors.pdf
  134   Tue Apr 12 22:30:59 2011 AidanComputingEPICSInstalled the thermistor on the Hartmann plate/created MEDM ADC Input screen

I restarted the Athena box and created an MEDM screen that shows the 8 differential input voltages next to their corresponding inputs on the breakout terminal strip. See the attached image. The MEDM screen is located at /home/controls/TCS_athena01_input_screen.adl on tcs_daq.

Channel 1 in the Athena is taking the output from the first channel in the temperature sensing box. That is connect to an RTD in the Hartmann sensor. The three other resistors in the Wheatstone bridge that the RTD is connected to have resistances of 1130 Ohms. There is 7V across the bridge and it has 100x gain afterwards (50x gain stage + 2x gain in single to differential output). The thermistor has temperature dependence K = 0.00385 Ohms/Ohm/degree K for 1000Ohms at 0 degrees.

R = 1000*EXP(K *delta T)

delta T = LOG(R/1000)/K

 I have configured some EPICS channels on the softIoc on the Athena box to display the voltage across the thermistor, calculate its resistance and then calculate the temperature in a linear and exponential fashion. These are stored in /target/TCS_westbridge.db on tcs_daq.

 The calibration of DEGREES_LOG is incorrect (or at least, the sign is). Fix this please.

        field(SCAN,".1 second")
        field(SCAN,".1 second")
        field(SCAN,".1 second")
        field(SCAN,".1 second")

Attachment 1: Screenshot-TCS_athena01_input_screen.adl.png
  135   Tue Apr 12 22:46:27 2011 AidanComputingEPICSAdded temperature sensor channels to the frame builder and restarted fb1

Added the following to the frame builder in /cvs/cds/caltech/chans/daq/C4HWS.ini and restarted daqd as per instructions in http://nodus.ligo.caltech.edu:8080/TCS_Lab/29



  136   Sun Apr 17 14:59:36 2011 AidanThings to BuyDelivery NoteL-Com patch panel, Newport lenses, Thorlabs fibers delivery notes
Attachment 1: newport_lenses_2011-03.pdf
Attachment 2: L-Com_patch_panel_-_2011-03.pdf
Attachment 3: thorlabs_fiber_optic_cables_2011-03.pdf
thorlabs_fiber_optic_cables_2011-03.pdf thorlabs_fiber_optic_cables_2011-03.pdf
  137   Sun Apr 17 21:55:51 2011 AidanLaserHartmann sensorHartmann sensor prism/displacement test

I've set up an experiment to test the HWS intensity distribution displacement measurement code. Basically the beam from a SLED is just reflecting off a galvo mirror onto the HWS. The mirror is being fed a 0.02Vpp *10 gain, 10mHz sinewave from the function generator.

The experimental setup is shown below.

I hacked the HWS code to export the Gaussian X and Y centers to Seidel Alpha and Beta channels in EPICS (C4:TCS-HWSX_PSC_ALPHA, C4:TCS-HWSX_PSC_BETA)

Attachment 1: HWS_prims.jpg
  138   Mon Apr 18 15:03:49 2011 AidanComputingDAQAthena DAC channels hooked up to BNC patch panel

 I added the four Athena DAC channels to the second BNC patch panel in the rack. At the moment there are only two EPICS channels in the database:



  139   Mon Apr 18 15:06:53 2011 AidanThings to BuyHartmann sensorOrdered 2" optics from Newport

 Given that the HWS requires several 2" optics to handle the big beam size, I've ordered the following items from Newport:

  • 2x 2" 50/50 beam splitter: 20B20BS.2
  • 6x 2" NIR mirrors: 5122
  • 8x 2" Ultima mirror mounts: U200-A2K
  140   Fri Apr 22 19:51:37 2011 AidanComputingEPICSpyepics installed on princess_sparkle

 I installed the pyepics package on princess_sparkle since this is much easier under Ubuntu than under CentOS.

  1. sudo apt-get install python-dateutil python-setuptools
  2. make sure that LD_LIBRARY_PATH points to EPICS libraries by echo $LD_LIBRARY_PATH
  3. sudo ldconfig
  4. sudo easy_install -U pyepics

Then I started the following python script ~/start_test_channels.py in the background on princess_sparkle. The EPICS channels are actually in an IOC on tcs_daq. They are all acquired by the frame builder at 16Hz.





Attachment 1: start_test_channels.py
# a short script to output low frequency sine wave to EPICS channels

import epics
import math
import time
import os
import random

a = 0
... 70 more lines ...
  141   Sun Apr 24 18:31:18 2011 AidanComputingNetwork architectureAdded hosts and network drives on TCS machines

Under edit ...

I added the names of the network machines to the /etc/hosts file on princess_sparkle, tcs_daq and tcs_ws.

I also added the /cvs drive on fb1 to the /etc/fstab file on princess_sparkle so that can be accessed from those machines.

  142   Mon Apr 25 16:28:27 2011 Aidan, JoeComputingNetwork architectureFixed problem network drive fb1:/cvs on Ubuntu & CentOS machines

With Joe's help we fixed the failure of princess_sparkle to mount the fb1:/cvs directory when relying on /etc/fstab.

First we changed the mounting options in fstab to the following:

fb1:/cvs        /cvs            nfs     rw,bg,soft        1 1

When we got the following error trying it directly from the command line,

controls@princess_sparkle:~$ sudo mount /cvs
[sudo] password for controls:
mount: wrong fs type, bad option, bad superblock on fb1:/cvs,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

some quick Google searches suggested installing nfs-common, so we tried sudo apt-get install nfs-common and that seemed to do the trick.


For the CentOS machines, the following was done:

sudo mkdir /cvs

and then the same mounting configuration was added to /etc/fstab

Additionally, all three machines now have a /users symbolic link to /cvs/users

  143   Thu Apr 28 22:48:47 2011 AidanLab InfrastructureElectronicsBNC Cables from HWS table to rack

 I labelled and strung 8 of the 16 custom 40' BNC cables from L-Com between the HWS table and the BNC feed-through on the rack. Each cable is labelled HWS TABLE CHxx where 01<= xx <= 08. I'm going to leave the other 8 until we have room in the BNC feedthrough on the rack.

  144   Tue May 10 00:55:08 2011 WonComputingHartmann sensorMatlab Compiler and Matlab Compiler Runtime


I have spent some time with Matlab Compiler and Matlab Compiler Runtime (MCR). I could only get my hands on 2008b version so far, but I believe 2009b version will work in the same way.


Below is a set of notes based on my experience so far.



Matlab compiler installation

1. Copy the toolbox archive files to the folder where matlab is installed. To me this is /usr/matlab_2008b/ (may need to do as root or use sudo). Two files to be copied are tbx.compiler.common and tbx.compiler.glnxa64.

sudo cp tbx.compiler.* /usr/matlab_2008b/

2. Execute the install script.

cd /usr/matlab_2008b
sudo ./install

3. Enter the file installation key that came with the matlab compiler files.

4. Leave the root directory as it was.

5. Finish the installation by activating the toolbox with the license file.

Build a standalone application using matlab compiler

I created a folder called matlab_project as a place to put compiled applications, and matlab_predep as a place to put files to be deployed.

Once Matlab Compiler is installed, it can be launched from the matlab console by typing deploytool. Then I proceeded as below:

1. Create a new project by clicking the New icon (the first one from the left).

2. Choose a standalone application.

3. Click main file and Go to menu Project -> Add Files (or right_click on "main file" icon).

4. Choose the matlab file hello.m (in my case, from matlab_predep folder). hello.m could be, for example, a simple script like

function hello

5. Click the Build icon (third from the right).

When the process finishes, inside matlab_project folder I found a file called "hello.prj" and a folder called "hello". Insider the hello folder was two folders "distrib" and "src".



Install Matlab Compiler Runtime

1. Run MCRinstaller.bin as root. I found this file in the folder /usr/matlab_2008b/toolbox/compiler/deploy/glnxa64

2. Go along with the default options unless desired otherwise.

3. Add following to .bashrc, below the entries regarding EPICS. $LD_LIBRARY_PATH should now be aware of EPICS as well as MCR related paths. 

export MCR_ROOT=/opt/MATLAB/MATLAB_Compiler_Runtime
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MCR_ROOT/v79/runtime/glnxa64:$MCR_ROOT/sys/os/glnxa64:$MCR_ROOT/v79/sys/java/jre/glnxa64/jre1.6.0/lib/amd64/native_threads:$MCR_ROOT/v79/sys/java/jre/glnxa64/jre1.6.0/lib/amd64/server:$MCR_ROOT/v79/sys/java/jre/glnxa64/jre1.6.0/lib/amd64
export XAPPLRESDIR=$MCR_ROOT/v79/X11/app-defaults

4. Run the revised .bashrc by typing 'source ~/.bashrc'. Next time the user logs in, doing this won't be necessary.


Run the built application

1. Go to distrib folder to find the executable application file (e.g., hello). You will also find the executable shell script (e.g., run_hello.sh), the role of which is basically to set up environment variables and run the application, in case the environment variables are not globally set up.

2. Once in that folder, run the application by simply typing ./ and its name (e.g., ./hello). If the library environment variable is set up as in the step 3 of "Install Matlab Compiler Runtime", the application will be run and you should see the hello message as the output.

Build an application that uses HS classes

I wrote a simple script test_HS.m that takes and saves 10 images using the camera, averages the images and finds centroids. Thus the script requires the class files HS_Base, HS_Camera, HS_Image, and HS_Centroids.

I added those four class files by right-clicking Other Files (found below Main function) then choosing Add File, then clicked the build icon.

  145   Wed May 11 09:07:03 2011 AidanComputingHartmann sensorChanged ownership of /opt/EDTpdv

 I changed the ownership of /opt/EDTpdv to controls with the command:

controls@princess_sparkle:/opt/EDTpdv$ sudo chown controls EDTpdv/


  146   Wed May 11 18:38:47 2011 AidanComputingHartmann sensortest_HS binary

 From Won: (the zip file is also on the SVN /users/won/compiled_code/test_HS.zip)


Attached is test_HS.zip file, that contains

- test_HS.prj: project file created by Matlab Compiler. This file is not
 required to run the application but I included it just in case someone's

- test_HS folder contains two subfolders src and distrib, each of which
 contains the standalone application test_HS.

Usage: test_HS <path to the image folder>, for example

 test_HS ~/test_images/

Make sure you create the folder prior to running the application, and the
folder name ends with "/". Running test_HS will take and save 10 images
using the camera (provided the frame grabber applications are installed in
/opt/EDTpdv), averages those 10 images and find centroids, then plots the

As I put in the eLOG, one needs MCRInstaller.bin and run it to install MCR
(probably 2008b 64bit version to test my files). If there are difficulties
getting MCRInstaller, let me know.



Attachment 1: test_HS.zip
  147   Wed May 11 18:44:54 2011 AidanComputingHartmann sensorMatlab Compiler and Matlab Compiler Runtime

Installing MCR

I located the MCRInstaller on our distribution of MATLAB on the Ubuntu machine (/MATLAB_R2009b/toolbox/compiler/deploy/glnxa64/MCRInstaller.bin). I ran the installer, as root,and followed the default options to install it. Next I updated the .bashrc file to include the necessary pointers to various libraries:


export LD_LIBRARY_PATH=/home/controls/base-3-14-11/lib/linux-x86_64:/MATLAB_R2009b/runtime/glnxa64:/MATLAB_R2009b/bin/glnxa64
export MCR_ROOT=/opt/MATLAB/MATLAB_Compiler_Runtime
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MCR_ROOT/v79/runtime/glnxa64:$MCR_ROOT/sys/os/glnxa64:$MCR_ROOT/v79/sys/java/jre/glnxa64/jre1.6.0/lib/amd64/native_threads:$MCR_ROOT/v79/sys/java/jre/glnxa64/jre1.6.0/lib/amd64/server:$MCR_
export XAPPLRESDIR=$MCR_ROOT/v79/X11/app-defaults
Running test_HS binary from Adelaide on Ubuntu distribution


I've downloaded the test_HS binary from the SVN and added the ~/test_images/ directory as recommended by Won. I then ran the code by entering ./test_HS ~/test_images/


The code ran successfully through the serial_cmd access and the image acquisition process and only crashed when it tried to access the variable mes_message. This indicates a run-time error, not a compilation error. If you examine lines 751 and 752 of HS_Camera.m you can see the typo (mes_meesage vs mes_message) in the code that is the source of the error:

751                 mes_meesage = ['Intensity too high: ',fobj.name];
752                 cam.inform_messenger('ImageNotValid',mes_message);

Here's the output:


controls@princess_sparkle:~/Hartmann_Sensor_SVN/users/won/compiled_code/test_HS/test_HS/distrib$ ./test_HS ~/test_images/
The camera is accessible.

G E N E R A L   C A M E R A   S E T T I N G S:

Camera Model No.:               DS-22-01M60-11E
Camera Serial No.:              04437062
Sensor Serial No.:              0411218

Tap 1 Gain:                     0
Tap 2 Gain:                     0

Firmware Design Rev.:           03-81-00070-03  Sep 30 2004
DSP Design Rev.:                17.3

Pretrigger:                     0      
Video Mode:                     Normal Operating Mode
Data Mode:                      12 bit 
Binning Mode:                   1x1

Gain Mode:                      1x Output Gain Mode
Output Configuration:           2 Tap
Exposure Control:               enabled
Exposure Mode:                  2      

SYNC Frequency:                 8 Hz
Exposure Time:                  123646.66 uSec


executing /opt/EDTpdv/take -s 1 -l 10 -f /home/controls/test_images/test ...
??? Undefined function or variable "mes_message".

Error in ==> HS_Camera>HS_Camera.read_raw at 752

Error in ==> HS_Camera>HS_Camera.read_from_folder at 668

Error in ==> HS_Camera>HS_Camera.read_from_fg at 721

Error in ==> HS_Camera>HS_Camera.read_images at 590

Error in ==> test_HS at 9




Build an application that uses HS classes

I wrote a simple script test_HS.m that takes and saves 10 images using the camera, averages the images and finds centroids. Thus the script requires the class files HS_Base, HS_Camera, HS_Image, and HS_Centroids.

I added those four class files by right-clicking Other Files (found below Main function) then choosing Add File, then clicked the build icon.


  148   Tue May 17 16:08:02 2011 AidanComputingHartmann sensorWrite speed of the frame grabber to file

 The attached file shows the output of the command. The maximum average frame rate is 57.2Hz when the nominal frame rate was 58Hz:

/opt/EDTpdv/take -f max_frame_rate_image -l 120 -N 4 -d > max_frame_rate_data.txt








Attachment 1: max_frame_rate_data.txt
reading image from Dalsa 1M60 12 bit dual channel camera link
width 1024 height 1024 depth 12  total bytes 2097152 
writing 1024x1024x12 raw file to max_frame_rate_image0000.raw (actual size 2097152)
writing 1024x1024x12 raw file to max_frame_rate_image0001.raw (actual size 2097152)
writing 1024x1024x12 raw file to max_frame_rate_image0002.raw (actual size 2097152)
writing 1024x1024x12 raw file to max_frame_rate_image0003.raw (actual size 2097152)
writing 1024x1024x12 raw file to max_frame_rate_image0004.raw (actual size 2097152)
writing 1024x1024x12 raw file to max_frame_rate_image0005.raw (actual size 2097152)
writing 1024x1024x12 raw file to max_frame_rate_image0006.raw (actual size 2097152)
writing 1024x1024x12 raw file to max_frame_rate_image0007.raw (actual size 2097152)
... 117 more lines ...
  149   Wed May 18 18:52:12 2011 AidanComputingHartmann sensorTest of position modulation algorithm

 I measured the prism and displacement of the Gaussian beam on the Hartmann sensor. The beam pointing was modulated at 10mHz using a galvo mirror as illustrated in Attachment 1. The galvo was around 680mm from the Hartmann sensor. The amplitude of the prism modulation was approximately 1E-5 radians. The displacement of the beam was measured using a new algorithm that tries to fit a parabola to the logarithm of the intensity of each Hartmann spot. The amplitude of the displacement modulation was measured at around 42 microns: corresponding to around 6E-5 radians (=42um/680mm).

To resolve the discrepancy between the prism and displacement measurements, I removed the Hartmann plate to simply get a Gaussian beam on the CCD (bottom right image in Figures 2 & 3 - the beam is slightly clipped and there is a ghost beam in the center - I'm not yet certain where this is coming from). I measured the Gaussian beam displacement directly by fitting a Gaussian to the mean horizontal cross-section of the intensity distribution (top right plot in Figures 2 & 3). Using this technique the measured displacement on the CCD had an amplitude of around 0.7 +/- 0.05 pixels = 8.4 +/- 0.6 microns, corresponding to a prism of 12.5E-6 radians (seen in top left plot in Figures 2 and 3). This indicates that there is an error in the Gaussian fitting algorithm using the Hartmann sensor data.

 The second plot simply shows the position modulation of the beam as I increased the amplitude of the signal going to the galvo. 


Voltage (Vpp) Displacement on CCD (pixels)
0.01 0.325
0.012 0.400
0.014 0.487
0.015 0.541
0.016 0.576
0.019 0.708
0.02 0.763
0.023 0.887
0.028 1.194
0.034 1.803
0.041 3.053
0.049 7.107


Attachment 1: galvo_mirror_experiment.jpg
Attachment 2: 2011-05-18_gaussian_beam_with_galvo_constant.pdf
Attachment 3: 2011-05-18_gaussian_beam_with_galvo.pdf
  150   Thu May 26 11:56:46 2011 AidanElectronicsLaserGreen Laser Pointer beam profile

This measurement was made with the Thorlabs DCC1545M-GL camera with an RG850 3mm long-pass filter over the CCD.

The beam radius (w) is 191 pixels, where the beam intensity = exp[-2 (x/w)^2 ]

The pixel size is 5.2um. Hence the beam size is 993.2um, which is basically near enough to 1mm radius.


Attachment 1: green_laser_pointer.bmp
Attachment 2: green_laser_pointer.pdf
Attachment 3: Screen_shot_2011-05-26_at_12.28.20_PM.png
ELOG V3.1.3-