Skip to content

Models, measurements, and simulation

Datasets

DatasetRegistryEntry

archive_sha256: str property

archive_size_bytes: int property

archive_url: str property

cache_path: Path | None property

cached: bool property

citation_doi: str property

citation_text: str property

description: str property

format_version: int property

id: str property

license_spdx: str property

license_url: str property

source_description: str property

source_url: str property

tags: list[str] property

title: str property

version: str property

DatasetRegistry(*, registry_url: str | None = None, cache_dir: Path | None = None)

cache_dir: Path property

registry_url: str property

clean(id: str) -> bool

clean_all() -> int

download(id: str) -> Path

download_all() -> list[Path]

list() -> list[DatasetRegistryEntry]

open(id: str) -> Dataset

Dataset

ground_truth_object: ComplexArray | None property

measurement_units: str | None property

measurements: MeasurementStack property

path: Path | None property

provenance: Mapping[str, str] property

reconstruction_model: ImagePlaneModel property

true_model: ImagePlaneModel property

valid_object_mask: MaskArray | None property

reconstruction_problem() -> ReconstructionProblem

open_dataset(id: str, *, registry_url: str | None = None, cache_dir: Path | None = None) -> Dataset

Experiment configuration

PupilAberration(*, astigmatism: float = 0.0, coma: float = 0.0, spherical: float = 0.0, edge_apodization: float = 0.0)

Direct radian weights for sampled pupil-polynomial terms.

All four coefficients default to zero. edge_apodization controls the radial amplitude decay and is not a normalized Zernike coefficient.

astigmatism: float property

coma: float property

edge_apodization: float property

spherical: float property

Optics(wavelength: float, objective_na: float, magnification: float, camera_pixel_size: float, *, medium_index: float = 1.0, defocus_distance: float | None = None, pupil_aberration: PupilAberration | None = None)

Physical microscope parameters used to compile an image-plane model.

Wavelength, camera pixel size, and optional defocus distance are metres. Numerical aperture, magnification, and medium index are dimensionless. Invalid non-positive values raise InvalidParameterError.

camera_pixel_size: float property

defocus_distance: float | None property

magnification: float property

medium_index: float property

object_pixel_size: float property

objective_na: float property

wavelength: float property

LEDArray(grid_shape: Shape2D, pitch: float, distance: float, center: tuple[float, float], *, wavelength_override: float | None = None, illumination_order: Sequence[int] | None = None, intensity_weights: Sequence[float] | None = None, rotation_degrees: float = 0.0)

Planar LED grid geometry.

pitch and distance are metres. center is expressed in grid coordinates, and source order must match acquisition frame order.

grid_shape: Shape2D property

source_count: int property

LEDSphere(angles: FloatArray, radius: float, *, center_offset: tuple[float, float, float] = (0.0, 0.0, 0.0), orientation_degrees: tuple[float, float, float] = (0.0, 0.0, 0.0), angular_corrections: FloatArray | None = None, wavelength_override: float | None = None, illumination_order: Sequence[int] | None = None, intensity_weights: Sequence[float] | None = None)

source_count: int property

SphericalLEDArm(commanded_angles: FloatArray, arm_length: float, *, pivot_offset: tuple[float, float, float] = (0.0, 0.0, 0.0), orientation_degrees: tuple[float, float, float] = (0.0, 0.0, 0.0), theta_zero_degrees: float = 0.0, phi_zero_degrees: float = 0.0, theta_scale: float = 1.0, phi_scale: float = 1.0, elevation_axis_tilt_degrees: float = 0.0, theta_backlash_degrees: float = 0.0, phi_backlash_degrees: float = 0.0, wavelength_override: float | None = None, intensity_weights: Sequence[float] | None = None)

source_count: int property

RotatingLEDArc(led_thetas: Sequence[float], rotation_angles: Sequence[float], radius: float, *, axis_origin_offset: tuple[float, float, float] = (0.0, 0.0, 0.0), axis_tilt_degrees: tuple[float, float] = (0.0, 0.0), led_angular_corrections: FloatArray | None = None, led_radial_offsets: Sequence[float] | None = None, rotation_zero_degrees: float = 0.0, rotation_scale: float = 1.0, rotation_backlash_degrees: float = 0.0, wavelength_override: float | None = None, led_intensity_weights: Sequence[float] | None = None)

led_count: int property

rotation_count: int property

source_count: int property

AngleList(angles: FloatArray)

source_count: int property

KVectorList(k_vectors: FloatArray)

source_count: int property

CodedIllumination(k_vectors: FloatArray, frame_weights: FloatArray)

frame_count: int property

source_count: int property

Compiled model

ImagePlaneModel

Compiled pupil, Fourier crops, sampling, and frame/source weights.

Returned arrays are NumPy copies/views of immutable compiled model data. Shapes use (height, width) and k-vectors use radians per metre.

frame_count: int property

frame_gains: FloatArray | None property

image_shape: Shape2D property

is_multiplexed: bool property

k_vectors: FloatArray property

pupil: ComplexArray property

pupil_support: MaskArray property

reconstruction_shape: Shape2D property

source_count: int property

suggest_reconstruction_shape(optics: Optics, illumination: Illumination, image_shape: Shape2D, reconstruction_shape: ReconstructionShapeSpec = 'smooth') -> Shape2D

compile_model(optics: Optics, illumination: Illumination, image_shape: Shape2D, reconstruction_shape: ReconstructionShapeSpec = 'smooth') -> ImagePlaneModel

compile_camera_model(model: ImagePlaneModel, camera: CameraModel) -> ImagePlaneModel

Measurements and simulation

MeasurementStack(measurements: FloatArray, *, frame_weights: Sequence[float] | None = None, masks: MaskArray | None = None)

Resident float64 intensity stack shaped (frames, height, width).

Python-owned input is copied once during construction. Optional masks use uint8 values, and frame weights are float64. Invalid dimensions or non-finite values raise a typed FpmError subclass.

array: FloatArray property

frame_count: int property

frame_weights: FloatArray property

image_shape: Shape2D property

shape: tuple[int, int, int] property

CameraModel(*, photons_per_pixel: float = 1000.0, gain_counts_per_electron: float = 1.0, offset_counts: float = 0.0, read_noise_electrons: float = 0.0, dark_current_electrons: float = 0.0, shot_noise: bool = False, pixel_sensitivity: FloatArray | None = None, bit_depth: int | None = 16, saturation_counts: float | None = None, quantize: bool = True, bad_pixels: Sequence[int] = (), bad_pixel_value_counts: float | None = None)

Detector response and acquisition-noise model.

Sensitivity maps are float64 arrays with detector (height, width). Counts and electron quantities use the units stated by their names. The default bit depth is 16; detector simulation runs in Rust without the GIL.

ideal() -> CameraModel staticmethod

IlluminationAcquisitionErrors(*, frame_gain_relative_std: float = 0.0, missing_frames: Sequence[int] = (), source_permutation: Sequence[int] | None = None)

SyntheticObject(field: ComplexArray)

Rust-owned complex128 object field shaped (height, width).

field: ComplexArray property

label: str | None property

shape: Shape2D property

amplitude_only(amplitude: FloatArray) -> SyntheticObject staticmethod

biological_like(shape: Shape2D, features: int, seed: int) -> SyntheticObject staticmethod

constant(shape: Shape2D, amplitude: float = 1.0, phase: float = 0.0) -> SyntheticObject staticmethod

from_amplitude_image(path: Path) -> SyntheticObject staticmethod

from_amplitude_phase(amplitude: FloatArray, phase: FloatArray) -> SyntheticObject staticmethod

from_amplitude_phase_images(amplitude_path: Path, phase_path: Path, phase_extent: float) -> SyntheticObject staticmethod

mixed_test_pattern(shape: Shape2D) -> SyntheticObject staticmethod

particle_field(shape: Shape2D, particles: int, seed: int) -> SyntheticObject staticmethod

phase_disk(shape: Shape2D, radius_pixels: float, phase_shift: float) -> SyntheticObject staticmethod

phase_only(phase: FloatArray) -> SyntheticObject staticmethod

random_phase(shape: Shape2D, standard_deviation: float, seed: int) -> SyntheticObject staticmethod

resolution_target(shape: Shape2D) -> SyntheticObject staticmethod

siemens_star(shape: Shape2D, spokes: int) -> SyntheticObject staticmethod

SimulationResult

ground_truth_object: ComplexArray property

ideal: bool property

measurements: MeasurementStack property

missing_frames: list[int] property

random_seed: int property

reconstruction_model: ImagePlaneModel property

true_model: ImagePlaneModel property

simulate(true_model: ImagePlaneModel, object: ComplexArray | SyntheticObject, *, reconstruction_model: ImagePlaneModel | None = None, camera: CameraModel | None = None, illumination_errors: IlluminationAcquisitionErrors | None = None, seed: int = 0) -> SimulationResult