The ComAdptSim class provides an in-application camera simulator that generates synthetic image data without requiring actual hardware. It supports multiple simulation modes: file-based playback and procedural pattern generation.
The simulation processing follows these steps:
Loads frames from a FITS file. Behavior depends on file content:
Supported pixel types: UINT8, INT16, UINT16 (native), FLOAT, DOUBLE, INT32, UINT32 (automatically converted and scaled to target bit depth based on PixelFormat).
The output pixel values are scaled to match the configured PixelFormat device property (e.g., "Mono12" limits values to 0-4095, "Mono8" to 0-255).
| Parameter | Description | Default |
|---|---|---|
| sim.file | Path to FITS file (resolved via CFGPATH) | (required) |
| sim.nb_of_planes | Number of frames to generate (single-image only) | 10 |
| sim.max_shift | Maximum total shift in pixels (single-image only) | 50 |
| sim.max_shift_pr_frame | Maximum shift per frame (single-image only) | 5 |
| sim.noise | Noise level to add (single-image only) | 10 |
| sim.noise_dist | Noise distribution: Gaussian, Poisson, Uniform | Gaussian |
Single 2D Gaussian star profile, simulating a point source with seeing. The star position shifts randomly between frames.
| Parameter | Description | Default |
|---|---|---|
| sim.amplitude | Peak intensity of the Gaussian | 10000.0 |
| sim.sigma | Gaussian sigma (seeing FWHM ≈ 2.35*sigma) | 5.0 |
Multiple Gaussian stars at random positions, all shifting together.
| Parameter | Description | Default |
|---|---|---|
| sim.amplitude | Peak intensity per star | 10000.0 |
| sim.sigma | Gaussian sigma for all stars | 5.0 |
| sim.nb_stars | Number of stars to generate | 5 |
Uniform illumination across the entire frame (flat field).
| Parameter | Description | Default |
|---|---|---|
| sim.flat_intensity | Constant pixel value | 1000.0 |
Regular grid of Gaussian spots (pinhole mask pattern).
| Parameter | Description | Default |
|---|---|---|
| sim.amplitude | Peak intensity of each spot | 10000.0 |
| sim.grid_spacing | Spacing between spot centers in pixels | 50 |
| sim.spot_size | Gaussian sigma of each spot | 3.0 |
Linear intensity gradient across the frame.
| Parameter | Description | Default |
|---|---|---|
| sim.gradient_dir | Direction: Horizontal, Vertical, Radial | Horizontal |
| sim.gradient_start | Intensity at start/centre | 0.0 |
| sim.gradient_end | Intensity at end/edge | 10000.0 |
Defocused star pattern (donut/annulus shape).
| Parameter | Description | Default |
|---|---|---|
| sim.amplitude | Peak intensity of the ring | 10000.0 |
| sim.ring_inner_radius | Inner radius in pixels | 5.0 |
| sim.ring_outer_radius | Outer radius in pixels | 10.0 |
Alternating black/white squares pattern.
| Parameter | Description | Default |
|---|---|---|
| sim.amplitude | Intensity of white squares (black = 0) | 10000.0 |
| sim.checker_size | Size of each square in pixels | 20 |
Pure noise pattern with no signal structure.
| Parameter | Description | Default |
|---|---|---|
| sim.noise_dist | Distribution: Gaussian, Poisson, Uniform | Gaussian |
| sim.noise_mean | Mean value for noise | 1000.0 |
| sim.noise_std | Standard deviation (Gaussian/Uniform) | 100.0 |
Dispersed spectrum from a point source through a diffraction grating. The spectrum position is fixed; intensity varies over time (aurora-like). Includes absorption lines (Fraunhofer-like) and a zero-order spot.
| Parameter | Description | Default |
|---|---|---|
| sim.amplitude | Peak spectral intensity | 10000.0 |
| sim.sigma | Vertical profile width (seeing/slit) | 5.0 |
| sim.grating_dispersion | Dispersion in pixels/nm | 0.5 |
| sim.grating_wavelength_min | Minimum wavelength in nm | 400.0 |
| sim.grating_wavelength_max | Maximum wavelength in nm | 700.0 |
| sim.grating_order | Diffraction order (0 = direct image only) | 1 |
These parameters apply to all pattern types (not File with cube):
| Parameter | Description | Default |
|---|---|---|
| sim.type | Simulation type (see above) | File |
| sim.width | Image width in pixels | 512 |
| sim.height | Image height in pixels | 512 |
| sim.nb_of_planes | Number of frames to generate | 10 |
| sim.max_shift | Maximum total position shift | 50 |
| sim.max_shift_pr_frame | Maximum shift per frame | 5 |
| sim.noise | Noise level to add | 10 |
| sim.gain | Signal scaling factor | 1.0 |
These parameters are applied during pre-processing to all types:
| Parameter | Description |
|---|---|
| expo.time | Exposure time (scales signal: pixel *= expo_time * gain) |
| expo.frame_rate | Frame generation rate in Hz (0 = use expo_time as period) |
| expo.win_start_x | ROI start X (1-based) |
| expo.win_start_y | ROI start Y (1-based) |
| expo.win_width | ROI width |
| expo.win_height | ROI height |
These device properties (from configuration) affect simulation output:
| Property | Description | Example |
|---|---|---|
| PixelFormat | Output pixel format | Mono8, Mono10, Mono12, Mono16 |
The PixelFormat determines the bit depth of generated/converted pixel values. For example, "Mono12" limits pixel values to 0-4095 (12-bit range).
| expo.bin_x | Horizontal binning factor | | expo.bin_y | Vertical binning factor |