computeAbsorption#
- computeAbsorption(imageData, absorpMin)#
Compute absorption ratio from atom/light(/dark) images.
Converts raw images into an absorption ratio \(a = I_\mathrm{atom}/I_\mathrm{light}\) with optional dark subtraction when a third channel is present. Negative or non-physical intensities are clipped to small positive values to avoid division by zero.
- Parameters:
imageData (
double) – 4-D image stack with shape (\(N_y,N_x,N_\mathrm{run},N_\mathrm{ch}\)), where the last dimension is either[atom, light, dark](3) or[atom, light](2)absorpMin (
double, optional) – Minimum allowed absorption; values below are not clipped in code (default: 0)
- Returns:
Absorption ratio \(a = I_\mathrm{atom}/I_\mathrm{light}\); values are in [0, +inf)
- Return type:
double
- Notes:
For 3-channel input, this computes
atom = atom-darkandlight = light-dark.Light values \(\le 0\) are replaced by
epsto keep \(a\) finite.Atom values \(< 0\) are clipped to 0.
Example:
a = computeAbsorption(cat(4, atomImg, lightImg, darkImg)); OD = absorption2Od(a);