## uBlox F9T qErr correction

Here's a test of how to correct the 1PPS signal out of an F9T with the qErr-value from the UBX-TIM-TP message.

When the time-interval-counter is configured with start=reference-clock, stop=uBlox, the qErr is applied with a + sign to the measured time-interval - resulting in much smoother data for averaging times up to tau=1000s.

## 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] #``````