Rainbow — Configuration and Parameters

Parent: Rainbow

Configuration contract

Versioned TOML is the single configuration source, parsed with toml++. Precedence: defaults, preset/base configuration, per-job configuration, explicit command-line overrides. Resolve inheritance before execution; reject unknown keys, invalid units, conflicting controls, unsupported modes, and out-of-range table requests. Save the complete resolved configuration with every result. External tables carry content checksums. No important physical, numerical, camera or execution tuning constant is hidden in code.

Separate physical parameters from numerical accuracy and resource controls. SI units internally. User-facing names include units, for example radius_um, number_density_m3, temperature_c, position_m, exposure_s and sun_angular_radius_deg. Angles are radians internally. Fixed physical constants and mathematical normalization rules are not artistic tunables.

Cloud and population

Controls: geometry type (box, sphere, ellipsoid or finite cylinder), position, orientation and dimensions; homogeneous number density; physical versus weighted particles; fixed-count versus Poisson physical population; sample count in weighted mode; independent position and radius seeds. Initial cloud profile is homogeneous. Other profiles are rejected until implemented.

Density may be entered as number density or liquid water content, never both as independent inputs. For a number-weighted radius distribution f(a), liquid water content is Nrho_water(4pi/3)E[a^3]. Derive the other representation and report both. Physical mode does not permit independently specifying density, volume and an inconsistent particle count. Weighted sample count controls approximation noise and never changes physical density.

Droplet radii

Selectable monodisperse, truncated lognormal, and tabulated number distributions. Monodisperse specifies radius. Lognormal specifies geometric median radius, geometric standard deviation and lower/upper radius bounds; normalize after truncation and report actual derived moments. Tabulated input explicitly declares number weighting, units and bin semantics. Report radius quantiles, mean radius, effective radius E[a^3]/E[a^2], and expected population. Diameter input, if accepted, must be labelled and converted once. No inferred unit conventions.

Illumination and optics

Controls: Sun azimuth/elevation or explicit direction, spectrum file/preset, source intensity, point versus finite-disc model, angular radius, solar-disc brightness profile and quadrature; water optical-constant dataset and supported temperature; surrounding refractive index; wavelength range. Temperature adjustment requires a valid dataset/model and is otherwise rejected. Expose solver tolerance, radius/wavelength/angular sampling, adaptive refinement, interpolation policy, cache path and memory budget. Physical Sun size is distinct from numerical quadrature density.

Camera, image and motion

Controls: camera position, orientation/look-at, field of view or sensor size plus focal length, image dimensions, entrance-pupil diameter, focus distance, declared point-spread model, exposure interval, frame time, frame count, background spectrum/colour, exposure compensation, white point and preview tone mapping. Reject inconsistent FOV/focal-length inputs. A normalized empirical PSF is supported as a controlled approximation; do not silently combine it with physical blur models.

Motion controls: stationary or constant velocity baseline, velocity vector and optional declared distribution, independent motion seed, exposure integration tolerances and sample bounds. Time samples resolve variation in scattering and projection. Fluid simulation, turbulence, evaporation and nonspherical drop dynamics are reserved extensions and are not presented as working switches.

Transport, accuracy and execution

Transport selects thin or homogeneous attenuation; optical-depth diagnostics are always available. Numerical controls include spectral/angular/radius integration tolerances, tile size, temporal sampling, image reconstruction, reference versus accelerated colour path and validated precision policy. Resource controls include threads, process count, CPU affinity, memory cap, particle batch size, worker/job IDs, shard count, checkpoint location and cache limit.

Experiments and provenance

Sweeps specify explicit lists or linear/logarithmic ranges plus repeats and a resource budget. Reuse position/radius random variates across parameter comparisons when appropriate; retain independent realization seeds for estimating variance. Output includes resolved parameters, derived physical quantities, approximation flags, table hashes, software/build identity, hardware/thread settings, timings and checksums. Defaults are labelled exploration presets, not measured waterfall properties.

Architecture

Parallel execution

version 1  ·  created 2026-10-16  ·  updated 2026-10-16