scipp / esspolarization

Polarization data reduction for the European Spallation Source
https://scipp.github.io/esspolarization/
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Add flipper matrices for the antiparallel spin case #68

Open astellhorn opened 2 months ago

astellhorn commented 2 months ago

Executive summary

Adding another flipper matrix depending on the ttransmitted spin direction through the flipper when it is off

Context and background knowledge

Until now we have considered the case: When the spin coming into the flipper is parallel to the outer magnetic field (typically called "parallel spin") and is transmitted (not flipped) when the flipper is off, hence afterwards still "parallel".

Now it should be inserted the case: When the spin coming into the flipper is antiparallel to the outer magnetic field and is transmitted (not flipped) when the flipper is off, hence afterwards still "antiparallel".

These two cases have different spin flipper matrices F1 and F2 as described in Inputs

Inputs

I have saved the new flipper matrices in the inverse_of_polarization_matrices.ipynb in the branch Flipper-matrices-antiparallel. Flipper matrices parallel case (already inserted):

F1_parallel = sp.ImmutableDenseMatrix([
    [1, 0, 0, 0],
    [0, 1, 0, 0],
    [1-f1, 0, f1, 0],
    [0, 1-f1, 0, f1],
])
F2_parallel = sp.ImmutableDenseMatrix([
    [1, 0, 0, 0],
    [1-f2, f2, 0, 0],
    [0, 0, 1, 0],
    [0, 0, 1-f2, f2],
])

Flipper matrices antiparallel case:

F1_antiparallel = sp.ImmutableDenseMatrix([
    [f1, 0, 1-f1, 0],
    [0, f1, 0, 1-f1],
    [0, 0, 1, 0],
    [0, 0, 0, 1],
])

F2_antiparallel = sp.ImmutableDenseMatrix([
    [1, 1-f2, 0, 0],
    [0, f2, 0, 0],
    [0, 0, 1, 1-f2],
    [0, 0, 0, f2],

])

Methodology

Use same methodology

Outputs

Use same correction workflow

Which interfaces are required?

Python script

Test cases

Use same correction_test.py

Comments

No response