Repository navigation
fix: off-grid laser lines, dropped emission sample, and QE without an emission filter - #161
Merged
Merged
Conversation
…ission filter - an excitation wavelength between the 1 nm samples of the fluorophore's absorption spectrum (e.g. a 488.5 nm laser) gave zero excitation, because spectra were combined with an inner join. The absorption cross-section is now interpolated at the light's wavelengths, Spectrum * Spectrum evaluates both at the union of their wavelengths, and excitation filters are applied with the new Spectrum.transmitted() (so a laser line stays a laser line). - bin_spectrum dropped the lowest-wavelength sample (right-closed bins), so the PSF weights missed some of the emission (widefield is now 0.2-5% brighter). - the detector QE was not applied to channels without an emission filter. Adds OpticalConfig.detected_fraction(), Fluorophore.emission_per_absorbed_photon, and Spectrum.at(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #161 +/- ##
==========================================
+ Coverage 88.15% 88.26% +0.10%
==========================================
Files 48 48
Lines 3292 3314 +22
==========================================
+ Hits 2902 2925 +23
+ Misses 390 389 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A few small spectral bugs I found while working on the confocal excitation fix (coming in a follow-up PR):
Spectrum * Spectrumzero-filled any wavelength present in only one of the two spectra, so combining spectra on different grids silently lost signal. e.g. FITC with a detector QE sampled every 2 nm gave half the photons it should (53 vs 107 photons/s), and two 1 nm grids offset by 0.5 nm gave exactly 0. Both are now interpolated onto the union of their wavelengths (newSpectrum.at()).Spectrum.transmitted()(so a laser line stays a laser line).bin_spectrumdropped the lowest-wavelength sample (right-closed bins), so PSF weights were missing a bit of the emission. widefield and confocal images are now ~0.3-1.5% brighter in a fluorophore's main channel (more, relatively, for weak bleedthrough).Also adds
OpticalConfig.detected_fraction()andFluorophore.emission_per_absorbed_photon.filtered_emission_ratenow spans the fluorophore's full emission range (zeros outside the filter) andabsorption_ratethe light's wavelengths; totals are unchanged.