TA
TakatoPhy/mot-monitor
Real-time MOT fluorescence monitor using USB cameras. Loading curve fitting, centroid tracking, background subtraction — no photodiode required.
mot-monitor
Real-time MOT (magneto-optical trap) fluorescence monitor using USB cameras.
Turn any USB camera into a quantitative MOT diagnostic tool — no photodiode required.
Features
- Real-time fluorescence intensity — ROI-based intensity with automatic background subtraction
- Loading curve fitting —
N(t) = N_ss (1 - exp(-t/τ))with steady-state atom number and lifetime - MOT position tracking — centroid and 2D Gaussian size of the fluorescence spot
- Background ring subtraction — robust against ambient light variations
- Live strip chart — time series of fluorescence intensity and position
- Recording & export — save time series to CSV or HDF5
- PyQt5 GUI — live camera view with ROI overlay, plots, and one-click fitting
- CLI — headless monitoring and batch fitting
Installation
pip install mot-monitor # core (OpenCV + NumPy + SciPy)
pip install mot-monitor[gui] # + PyQt5 GUI
pip install mot-monitor[export] # + HDF5 exportQuick start
GUI
mot-monitor guiCLI
# Live monitor (prints fluorescence intensity to stdout)
mot-monitor monitor --camera 0 --roi 200,150,100,100
# Fit loading curve from recorded CSV
mot-monitor fit recording.csv
# Record fluorescence time series
mot-monitor record --camera 0 --duration 30 --output data.csvHow it works
- Capture frames from USB camera via OpenCV
- Define ROI around the MOT fluorescence spot
- Subtract background using an annular ring around the ROI
- Integrate pixel intensity within ROI → fluorescence signal (proportional to atom number)
- Track signal over time → loading curve, optimization feedback
Background subtraction
The background ring method estimates the local background from an annular region surrounding the ROI. This is subtracted per-frame, making the measurement robust against:
- Room lighting changes
- Scattered laser light
- Camera gain drift
Why not a photodiode?
MOT loading timescales are seconds — USB camera frame rates (30 fps) are more than sufficient.
A camera also gives you spatial information (position, size, shape) that a photodiode cannot.
References
- Tranter et al., "Multiparameter optimisation of a magneto-optical trap using deep learning", Nature Communications 9, 4360 (2018) — USB camera fluorescence for MOT optimization
- Chin et al., "Direct measurement of loading and loss rates in a magneto-optical trap", PRA 76, 013402 (2007)
License
MIT
On this page
Languages
Python100.0%
MIT License
Created March 12, 2026
Updated March 12, 2026