photon_sample — PHOTON counting op

• Data kinds: image2d → image2d

• Call: import fullseye as fs; fs.ledger.photon_sample(image, photons_per_unit=100.0, dark_rate=0.0, seed=0) (implementation को सीधे call करना हो तो import photoncount; photoncount.photon_sample(image, photons_per_unit=100.0, dark_rate=0.0, seed=0), registry से लेना हो तो opsphoton.get("photon_sample"))

उपयोग

expected-photon image को Poisson-sample करके वास्तविक photon count image बनाता है।

> नीचे का विस्तृत विवरण मूल text में है — सारांश और headings का अनुवाद हो चुका है।

*image* is a non-negative 2-D map of scene radiance in arbitrary units; lambda = image * photons_per_unit + dark_rate is the expected number of photons in each pixel over the exposure, and the result is one Poisson realisation of it. *dark_rate* is the dark-count contribution (a SPAD counts thermally generated carriers even in the dark) in the same photon units.

Returns the counts themselves as a float64 (H, W) image (integer valued). That is the deliberate difference from backends_aug.aug_shot_noise, which returns Poisson(v*K)/K clipped to [0, 1] for training-data augmentation: every operator downstream here (Fano factor, Anscombe, Coates, dToF) needs N, and the rescale-and-clip is not invertible.

seed is a required non-negative integer and the RNG is numpy.random.default_rng(seed) — same seed, same frame, on any machine.

Ground truth it reproduces (pinned in tests/test_photoncount.py): the sample mean and sample variance both converge to lambda. Measured on a flat lambda = 100 field of 512x512 pixels at seed 0 — mean 99.9796, Fano factor 1.001089, so the photon-limited SNR is sqrt(lambda): 9.9990 predicted from the mean, 9.9935 actually achieved.

Raises ValueError: negative or non-finite *image*, negative *photons_per_unit* / *dark_rate*, a non-integer or negative *seed*, an image

over MAX_IMAGE_ELEMENTS, and — instead of letting numpy fail deep inside the sampler — any lambda over MAX_LAMBDA.

उपयोग की विस्तृत guide

• photon_timeresolved family guide

संदर्भ (sample data, साहित्य)

• Sample data catalog (DL URL / license) — 2-D के लिए skimage.data (BSD/public) + synthetic, 3-D के लिए real data sources (Stanford/PDS आदि) के DL URL।

• Operators का स्रोत और संदर्भ — इस op family के मूल research/methods के स्रोत।

• Algorithm का मानक स्रोत (लेखक, वर्ष) और उपयोग ऊपर की family usage guide में दिए गए हैं।

चलाए जा सकने वाले उदाहरण (verified samples जो सच में यह op call करते हैं)

• photon_timeresolved — py -3.11 examples/photon_timeresolved.py

• poc_colocalization_crosstalk — py -3.11 examples/poc_colocalization_crosstalk.py

• poc_search_sweep_width — py -3.11 examples/poc_search_sweep_width.py

वे अगले ops जिनसे type जुड़ता है (image2d को input के रूप में लेते हैं)

photon_statistics · photon_uncertainty · anscombe_transform · anscombe_inverse

इसी category के (counting)

photon_statistics · photon_uncertainty


*Provenance: photoncount.py — PHOTON operator registry. यह per-op note tools/opdocs.py md से अपने-आप generate होता है (हाथ से edit न करें)।*

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