6 Monitor Drift Rate using SerialEM

After checking Focus and Stigmation at S1 or S2 mode, we usually watch the drifting visually on analog TV monitor. When we feel it is stable, then we take the shot. This watching is not quantitative at all. With CCD only system, because of the jiggling due to reading out speed of CCD camera, this watching is even more problematic.

Luckily, with SerialEM's macro ability, we can get the drifting rate quantitatively. We do this by running the following macro:

MacroName Drift
#### Editing ###########################
# Set to type of picture to take
shot = Focus
# unbinned pixel size in nm (related with mag, check Chen's table)
pixel = 0.18
# binning of shot in CCD setup
bin = 2
# Set to interval between pictures in seconds
interval = 15
# Set to maximum number of pictures
times = 10
# Set to criterion drift in A/sec
crit = 1
# End of parameters
##### End of Editing #####################

# actual pixelsize
ps = $pixel * $bin

SuppressReports
$shot
Delay $interval
Loop $times index
$shot
AlignTo B
ReportAlignShift
ClearAlignment
dx = $reportedValue1
dy = $reportedValue2
dist = sqrt $dx * $dx + $dy * $dy 
#echo Distance = $dist pixels
dist_in_nm = $dist * $ps 
#echo Distance = $dist_in_nm nm
drift = $dist_in_nm / $interval * 10
echo -----------------------------------------------
echo Drift = $drift A/sec
if $drift < $crit
echo Drift is low enough after shot $index
## for film, uncomment the next line to retract CCD
#Call CCD
break
endif
if $index < $times
Delay $interval
else
Pause Drift never got below $crit: Continue anyway?
endif
EndLoop

The idea of this macro is very clear: By aligning two images taken at certain interval, the distance is figured out. Dividing the distance by the interval, we get the drifting rate.

It is worth mentioning that there are two conditions needed to be satisfied. 1. There is no continuous imaging currently taken. 2. The shot defined in the macro needs to in single mode. E.g., in the above macro, Focus is used for this job, therefore, Focus has to be in single mode , selected in Camera Control panel.

Pay attention to the line

#Call CCD

Uncomment this line will have CCD automatically being retracted when the drifting rate is low enough.