tcspc_background_subtract — PHOTON tcspc op

데이터 종류: countscounts

호출: import photoncount; photoncount.tcspc_background_subtract(hist, method='median', leading_bins=None, quantile=0.5, scale=1.0)(또는 opsphoton.get("tcspc_background_subtract"))

사용법

도달 시각 히스토그램에서 환경광 / 암계수의 바닥을 제거합니다.

> 아래 상세 설명은 원문입니다 —— 요약과 제목은 번역되어 있습니다.

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`):

• `"median"` (default) — the median of every bin. Robust while the pulse

occupies well under half the window, which is the normal dToF case.

• `"leading"` — the mean of the first *leading_bins* bins, the classical

choice when the pulse is known to arrive late (a far target).

• `"trailing"` — the mean of the last *leading_bins* bins, for

fluorescence decays where the tail is background.

• `"quantile"` — the given *quantile* of all bins, for tuning by hand.

*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*.

자세한 사용 가이드

photon_timeresolved 패밀리 가이드

참고(샘플 데이터·문헌)

• 샘플 데이터 카탈로그(DL URL / 라이선스) —— 2-D 는 skimage.data(BSD/public)+ 합성, 3-D 는 실데이터 소스(Stanford/PDS 등)의 DL URL.

• 연산자의 내력·참고문헌 —— 이 연산자 족의 바탕이 된 연구/기법의 출처.

• 알고리즘의 정전(저자·연도)과 용도는 위의 패밀리 사용 가이드에 적혀 있습니다.

실행 가능한 예제(이 연산자를 실제로 호출하는 검증된 샘플)

photon_timeresolvedpy -3.11 examples/photon_timeresolved.py

poc_dtof_rangingpy -3.11 examples/poc_dtof_ranging.py

타입이 이어지는 다음 연산자(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 연산자 레지스트리. 이 op 노트는 tools/opdocs.py md 가 자동 생성합니다(직접 편집하지 마세요).*

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