dose_cv_lognormal — DRIVE doseunif op

• Data kinds: scalar × scalar × scalar × scalar → table

• Call: import fullseye as fs; fs.ledger.dose_cv_lognormal(d_median: 'float', sigma_ln: 'float', dose_mg: 'float', density: 'float', basis: 'str' = 'number', method: 'str' = 'closed', sampling: 'str' = 'poisson', n_rep: 'int' = 2000, seed: 'int' = 0, max_draws: 'int' = 20000000) -> 'dict' (to call the implementation directly, import doseunif; doseunif.dose_cv_lognormal(d_median: 'float', sigma_ln: 'float', dose_mg: 'float', density: 'float', basis: 'str' = 'number', method: 'str' = 'closed', sampling: 'str' = 'poisson', n_rep: 'int' = 2000, seed: 'int' = 0, max_draws: 'int' = 20000000) -> 'dict'; from the registry, opsdrive.get("dose_cv_lognormal"))

Usage

CV of the content of 1 dose (drug dose_mg) taken from a powder with log-normal particle sizes (particle-count fluctuation only).

Closed form (derivation in the module header): CV² = c · D63³ / D, c = πρ/6, D63³ = d_g³ exp(13.5 σ²) = d_v³ exp(4.5 σ²). basis:

"number" (d_median is the number-based median diameter d_g, how particles are counted in images) / "volume" (volume-based median diameter d_v, D50 of laser diffraction). sampling: "poisson" (default, the particle count N is Poisson) / "fixed_count" (N fixed to the integer obtained by rounding λ, CV² = CV²_Poisson − 1/N). method="monte_carlo": builds one dose n_rep times (draw N, draw N diameters from the lognormal and sum the masses) and returns the sample CV —— a path independent of the closed form (it does not use the formula). The standard error cv_mc_se comes from the spread of 20 bundles. If the total number of diameters drawn exceeds max_draws, it does not silently reduce but raises ValueError (look at λ × n_rep and reduce n_rep, or use the closed form).

Returns: cv (value for method), cv_closed, particles_per_dose (λ; integer N for fixed_count), mean_particle_mg, d63, d_number_median and d_volume_median [µm], basis, sampling, method; for Monte Carlo also cv_mc, cv_mc_se, n_rep, draws. Raises ValueError: a quantity that should be positive is not, misspelling, N < 2 with fixed_count, Monte Carlo total exceeds the limit.

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_dose_uniformity_from_grinding — py -3.11 examples/poc_dose_uniformity_from_grinding.py

Ops the type connects to (they accept table as input)

course_layout · course_occupancy · course_contains · world_build · world_camera · world_move · lidar_scan · rss_longitudinal_same

Same category (doseunif)

dose_cv_from_sizes · grind_time_for_dose_cv


*Provenance: doseunif.py — DRIVE operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

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