Closed Jashcraf closed 1 year ago
top is new algo, bottom is old
overall the new one looks less regular, maybe an operation got broadcast over an unintended dimesnion
Delta calculation
These actually just look like the right values in perhaps different places. Specifically - the middle two columns are switched
Oh my god lData and mData were flipped in the function inputs
Delta is good (left gbd, right beamlets)
k_rays on both == np.array([0,0,1]), which is good! r_rays look a little different at first glance, can we use fewer beamlets without breaking?
4x4 beamlets traces few enough to peruse. Seems like the comparison might be approaching numerical precision limits, this might be a thing with using numexpr for calculations?
Gonna look at the +X differential ray, r_rays should basically all be at x,y = 0 here. They are different and transposed!
Ah I think I might have been looking at the wrong coordinate here is the x,y,z position for each ray at a given pixel - which it is constant across consistency!
plotting after the delta propagation, the beamlets array is entirely black?
Oh it's because I'm passing it weird data, the rayset index is now in the first when it should be in the zeroth. consistency!
Checking after orthogonal transformation. Might have some nan vals in the old method. Viridis is r_data and magma is k_data
Both look good (save the nans)
Ah I forgot to normalize the l vector in the orthogonal transfer matrix
WE WIN
time to try the misaligned case
Breaks during misalignment and focus - I suspect that this has to do with where the ray positions are
Nah the ray positions are identical
Let's check the final ingredients for the matrix, starting with Amplitude
Looks slightly different, don't know what this could be from (other than the complex beam parameter computation)
This is very different!
(The vertical lines are the new algorithm)
For the misaligned case the ray transfer matrices are different!
Works for the defocused case
The orthogonal transformation matrix is looking good, each image is a row in the matrix
The detector coords are wrong!
turns out you need to provide the offset to the rays, not detector
This is fascinating. Thanks for sharing, Jaren!
r_ray and k_ray look good to me, let's try the ray transfer matrices.
A matrix
B Matrix
C matrix
D matrix