simtools-derive-mirror-rnda#

Derive mirror random reflection angle based on per-mirror PSF diameter optimization.

Description

This application derives the value of the simulation model parameter mirror_reflection_random_angle using measurements of a PSF containment diameter and focal length of individual mirror panels.

The optimization uses percentage difference as the metric:

pct_diff = 100 * (simulated_psf - measured_psf) / measured_psf

Each mirror is optimized individually, and the final RNDA is the average of all per-mirror optimized values.

Command line arguments

site (str, required)

North or South.

telescope (str, required)

Telescope name (e.g. LSTN-01, SSTS-25).

model_version (str, optional)

Model version.

data (str, required)

ECSV file with PSF diameter (mm) per mirror. Accepted column names: psf_opt, psf, or d80.

fraction (float, optional)

PSF containment fraction for diameter calculation (e.g. 0.8 for D80, 0.95 for D95). Default: 0.8.

threshold (float, optional)

Convergence threshold for percentage difference (e.g. 0.05 for 5%). Default: 0.05.

learning_rate (float, optional)

Learning rate for gradient descent. Default: 0.001.

test (optional)

Only optimize a small number of mirrors.

max_workers (int, optional)

Number of parallel worker processes to use. Default: 0 (auto chooses maximum).

number_of_mirrors_to_test (int, optional)

Number of mirrors to optimize when –test is used. Default: 10.

profile_serial (optional)

Run optimization in a single process (no process pool). Useful for profiling.

psf_hist (str, optional)

If activated, write a histogram comparing measured vs simulated PSF diameter distributions.

cleanup (optional)

Remove intermediate files (patterns: *.log, *.lis*, *.dat) from output.

Example

simtools-derive-mirror-rnda \
    --site North \
    --telescope LSTN-01 \
    --model_version 7.0.0 \
    --data tests/resources/MLTdata-preproduction.ecsv \
    --parameter_version 1.0.0 \
    --test --psf_hist --cleanup

Command line arguments#

options#

–help

show this help message and exit

–data

ECSV file with a PSF diameter column (mm) per mirror

Required.

–threshold

Convergence threshold for percentage difference.

Default: 0.05.

–learning_rate

Learning rate for gradient descent.

Default: 0.001.

–number_of_mirrors_to_test

Number of mirrors to optimize when –test is used.

Default: 10.

–psf_hist

Write a histogram comparing measured vs simulated PSF diameter distributions. Optionally provide a filename (relative to output dir unless absolute).

–cleanup

Remove intermediate files from the output directory (patterns: *.log, *.lis*, *.dat).

application#

–fraction

PSF containment fraction for diameter calculation (e.g., 0.8 for D80, 0.95 for D95).

Default: 0.8.

–show_options

Print available values for a supported option and exit.

simulation model#

–model_version

Simulation production model version(s). Use –show_options model_version.

–parameter_version

model parameter version

–overwrite_model_parameters

JSON string with model parameters to overwrite

–site

Observatory site (e.g., North, South). Use –show_options site.

–telescope

telescope model name (e.g., LSTN-01, SSTS-design, …)

ray tracing configuration#

–ray_tracing_backend

Optical ray-tracing backend (default: sim_telarray).

Choices: sim_telarray, obdeect.

simulation configuration#

–instrument_seed

Seed of the random instrument setup (e.g. mirror deviations, gains); with several random instrument instances, their seeds are derived from it (default: random).

–random_instrument_instances

Number of random instrument instances (random mirror realisations) per image.

Default: 20.

–simulation_seed

Seed of the simulation (events, photons) (default: random). Two values: [instrument_seed, simulation_seed] (use for testing only).

output#

–output_file

Output data file.

–output_file_format

file format of output data

Default: ecsv.

–skip_output_validation

skip output data validation against schema

model repository#

–simulation_models_path

Path containing the simulation-model repository to read.

–simulation_models_git_path

Path to a local normal, bare, or mirror Git repository containing simulation models.

–simulation_models_git_revision

Git tag, ref, or commit to read from the simulation-model repository.

Example#

Derive LST mirror reflection-angle spread#

Fit the random mirror reflection-angle parameter to measured LST point-spread-function data.

Application: simtools-derive-mirror-rnda

Integration test: derive_mirror_rnda_psf_measurement.yml

Command

simtools-derive-mirror-rnda --config tests/integration_tests/config/derive_mirror_rnda_psf_measurement.yml

Configuration

log_level: DEBUG
model_version: 7.0.0
parameter_version: 1.0.0
output_path: simtools-output
data: tests/resources/static/MLTdata-preproduction.ecsv
site: North
telescope: LSTN-01
psf_hist: true
max_workers: 1
number_of_mirrors_to_test: 1
test: true