Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retardance above pi #17

Open
gschlafly opened this issue Dec 12, 2022 · 6 comments
Open

Retardance above pi #17

gschlafly opened this issue Dec 12, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@gschlafly
Copy link
Member

Need to check if calculation and interpretation is appropriate

@gschlafly gschlafly self-assigned this Dec 12, 2022
@pvjosue
Copy link
Collaborator

pvjosue commented Dec 12, 2022

image

High retardance that goes over 2*pi

@gschlafly
Copy link
Member Author

Retardance is high for a shell with pytorch and numpy backends.
image

@gschlafly
Copy link
Member Author

Adjusted the creation of the ellipsoid/shell so that the birefringence values were not overwritten by the mask:
vol[0,...] = vol[0,...] * combined_mask.astype(float)

image
However, the retardance still should not be able to go above $\pi$ even with a highly birefringent object.

@gschlafly gschlafly changed the title Retardance above 2pi for clam shell Retardance above pi Jun 24, 2024
@gschlafly gschlafly added the bug Something isn't working label Jun 24, 2024
@gschlafly
Copy link
Member Author

gschlafly commented Jun 24, 2024

The retardance function should only output values between $0$ and $\pi$:
https://github.com/PolarizedLightFieldMicroscopy/GeoBirT/blob/ac9075d681375ebd2d64a9635217e086eeca5dd7/src/VolumeRaytraceLFM/jones/eigenanalysis.py#L65-L68
Thus, the angle calculation should only output values between $0$ and $\pi/2$:
https://github.com/PolarizedLightFieldMicroscopy/GeoBirT/blob/ac9075d681375ebd2d64a9635217e086eeca5dd7/src/VolumeRaytraceLFM/jones/eigenanalysis.py#L5-L21
Consequently, the real part of $a$ should be nonnegative.

To Do

  • Figure out what causes the real part of $a$ to be negative.

@gschlafly
Copy link
Member Author

The real part of the first element of the jones matrix, $a$, is the cosine of the accumulated retardance. The retardance is positive. So the negative real component of $a$ is introduced from the product of the jones matrices.

@gschlafly
Copy link
Member Author

The phase wrapping effect should be accounted for in the final step of calculating the retardance from a jones matrix.

# Calculate the phase differences (retardance)
retardance = np.angle(eigenvalues[0]) - np.angle(eigenvalues[1])

# Normalize the phase difference to [0, 2*pi) and assure values are positive
retardance = (retardance + 2 * np.pi) % (2 * np.pi)

# Wrap the phase difference to [0, pi]
if retardance > np.pi:
    retardance = 2 * np.pi - retardance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants