Skip to content

feat: add laser channels; use them in the confocal examples and docs - #164

Merged
tlambert03 merged 2 commits into
mainfrom
feat/laser-channels
Oct 21, 2026
Merged

tlambert03 merged 2 commits into
mainfrom
feat/laser-channels

Conversation

@tlambert03

@tlambert03 tlambert03 commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #163. This adds LASER_405, LASER_445, LASER_488, LASER_515, LASER_561 and LASER_640 to microsim.schema.optical_config.lib: a laser line, a dichroic (main beam splitter) and an emission bandpass. The filters are generic (not specific products). power defaults to 1e5 W/cm² (peak irradiance at the focus... about 50 µW at NA 1.4), so they work out of the box:

from microsim.schema.optical_config.lib import LASER_488

sim = ms.Simulation(..., channels=[LASER_488], detector=HYD_SP8, exposure_ms=0.002)

# or, for a different power
LASER_488.model_copy(update={"power": 1e4})

Now that confocal actually computes excitation at the excitation wavelength, it felt pretty wrong for all of our confocal examples to be using broadband widefield filter cubes with the mock fluorophore and a CCD. So the confocal examples, docs and notebooks now use laser lines, a HyD detector, and realistic pixel dwell times (a few µs). A few other things along the way:

  • the README/quickstart example stays minimal (just defaults, now with a 1 AU pinhole rather than 0.2), and the docs get a separate "more realistic confocal" example right after it. Both figures are regenerated.
  • re-executed the tutorial and example notebooks (and stripped the log spam out of their outputs)
  • fpbase_scope.py now uses widefield, since its filter set is a widefield cube
  • docs/index.md now fetches EGFP from FPbase, so that doc test is skipped when offline (like stages.md already was)

Smarter defaults for Confocal() (e.g. a laser channel rather than the FITC cube when you don't pass channels) would be nice too, but I'll leave that for a follow-up.

- `LASER_405/445/488/515/561/640` library channels: a laser, a dichroic (main
  beam splitter) and an emission bandpass.  `power` is the peak irradiance at
  the focus (1e5 W/cm^2 is ~50 uW at NA 1.4).
- confocal examples, notebooks and docs use laser lines, HyD detectors and
  realistic powers and pixel dwell times, rather than broadband filter cubes
  (and mostly real fluorophores rather than the mock one).
- re-executed the tutorial and example notebooks, without log output.
- the README example uses a 0.6 AU pinhole (0.2 AU was very photon-starved).
- `fpbase_scope.py` uses widefield (its filter set is a widefield cube).
- README and docs/index.md now fetch EGFP from FPbase, so their doc tests are
  skipped offline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.06%. Comparing base (429e6e4) to head (45964f3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #164      +/-   ##
==========================================
- Coverage   89.14%   89.06%   -0.09%     
==========================================
  Files          51       51              
  Lines        3483     3483              
==========================================
- Hits         3105     3102       -3     
- Misses        378      381       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- the README and quickstart go back to the defaults-only example (with a 1 AU
  pinhole), and the docs get a separate "more realistic confocal" example
  with EGFP, LASER_488, a HyD and a 2 us dwell.
- `LASER_*` channels default to `power=1e5` (W/cm^2 peak at the focus, ~50 uW
  at NA 1.4), so they give a sensible image without setting it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tlambert03
tlambert03 merged commit 8400fd8 into main Oct 21, 2026
20 checks passed
@tlambert03
tlambert03 deleted the feat/laser-channels branch October 21, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant