fullseye

tcspc_background_subtract — PHOTON tcspc op

使い方

Remove the ambient-light / dark-count floor from an arrival-time histogram.

Outdoors, most of what a dToF sensor counts is sunlight: a roughly uniform pedestal under the return pulse. It biases the centroid toward the middle of the window (a floor of b per bin pulls the first moment toward window/2) and it inflates the apparent signal, so it is removed before any depth or lifetime estimate.

The level is estimated by method and then subtracted (the sign trap: the result is hist - level, clipped at 0, never hist + level):

leading_bins defaults to None = min(8, len(hist)), so the default call works on a short histogram instead of raising over a constant nobody chose (a fixed default of 8 made method="leading" fail on any histogram with fewer than 8 bins).

scale multiplies the estimated level before subtraction (scale=1.2 for a deliberately aggressive removal). Clipping at 0 means the result is a valid non-negative histogram that the rest of this module will accept.

Ground truth: on a noiseless histogram with a known flat pedestal of 20 counts/bin under a 5000-photon pulse covering 5.1% of the window, the median estimate recovers 20.000000 and the returned histogram equals the pedestal- free pulse exactly (measured area error 0.0, pinned in the tests).

Returns a float64 1-D histogram of the same length as hist.

Raises ValueError: negative, non-finite or non-1-D hist, an unknown method, a leading_bins outside [1, len(hist)], a quantile outside [0, 1], and a negative scale.

詳しい使い方ガイド

参考(サンプルデータ・文献)

実行できる例(この op を実際に呼ぶ検証済みサンプル)

型が繋がる次の op(counts を入力に取れる)

tcspc_coates_correct · tcspc_irf_convolve · tcspc_stats · dtof_depth · lifetime_fit · lifetime_phasor

同カテゴリ(tcspc)

tcspc_simulate · tcspc_irf_convolve · tcspc_stats


Provenance: photoncount.py — PHOTON operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.