Skip to content

beam tracker: Curvature correction

At ID16A the spec holotomo sequence also contains z correction for the beam tracker.

It have to be back ported.

Probably the best place in put in inside the beam tracker correction.

Actually the beam tracker use a linear correction.

But the displacement is on a beam distance, so it's curve.

First we have to find this correction in the SPEC macros.

Here is the reference code:

def _zerror_sy_stage(sy_val) '{
    # this is the error in Tz in mm for an absolute sy position (due to cradle)
    local r, sy_orig, res
    r = 103.17
    sy_orig = -1.93208

    res = sy_val-sy_orig
    res = 1/2/r*res*res

    return res;
}'

def move_sx(sxpos, sleeptime) '{
    local sypos, szpos, sleeptimeapplied
    local correct_cradle, correct_cradle_dsz

    correct_cradle = 1

    if (sleeptime == 0) {
        sleeptimeapplied = 2*FTOMO_PAR["ref_mot_settle_time"]
    } else {
        sleeptimeapplied = sleeptime
    }
    get_angles
    if (A[sx] != sxpos) {
        sypos = A[sy] + _sy_change(sxpos-A[sx])
        szpos = A[sz] + _sz_change(sxpos-A[sx])
        if (correct_cradle == 1) {
            correct_cradle_dsz = - (_zerror_sy_stage(sypos) - _zerror_sy_stage(A[sy]))
            printf("Correction in Z for sy cradle movement (mm): %f\n", correct_cradle_dsz)
            szpos += correct_cradle_dsz
        }
        printf("New sy position: %f\n", sypos)
        printf("New sz position: %f\n", szpos)
        move_sample_serial(sxpos, sypos, szpos)
        sleep(sleeptimeapplied)
    }
}'
Edited by Valentin Valls