Trapping again

Since about July 15th our single-ion experiment has been in maintenance-mode, but today again some trapping!

The central 'pale blue dot' is a single 88Sr+ ion trapped between the inner electrodes (cylindrical) which are driven with a ~400 Vpp ~16 MHz sine-wave to create a Paul trap. The outer conical electrodes are grounded. The window-reflections of the 422nm cooling laser create the larger circular spots in the top half of the picture. A single laser-cooled 88Sr+ ion emits around 10 million photons per second, making it easily visible on 1s or longer exposures with a DSLR. Sigma 105mm/F2.8 macro objective with a short (13mm?) extension-tube.

Live stream:

Faster mtotdev() and htotdev()

The AllanTools functions mtotdev() and htotdev() are now almost 10-times faster, after an update to the code that more efficiently calculates moving averages.

The old code used numpy.mean() for each iteration of a loop:

for j in range(0, 6*m): # summation of the 6m terms.
    xmean1 = np.mean(xstar[j     :   j+m])
    xmean2 = np.mean(xstar[j+m   : j+2*m])
    xmean3 = np.mean(xstar[j+2*m : j+3*m])

However this can be computed much faster by noticing that the new mean differs from the old (already computed!) mean by just two points, one at the start is dropped, and a new one at the end is added:

for j in range(0, 6*m): # summation of the 6m terms.
    if j == 0:
        # intialize the sum
        xmean1 = np.sum( xstar[0:m] )
        xmean2 = np.sum( xstar[m:2*m] )
        xmean3 = np.sum( xstar[2*m:3*m] )
    else:
        # j>=1, subtract old point, add new point
        xmean1 = xmean1 - xstar[j-1] + xstar[j+m-1] #
        xmean2 = xmean2 - xstar[m+j-1] + xstar[j+2*m-1] #
        xmean3 = xmean3 - xstar[2*m+j-1] + xstar[j+3*m-1] #