simtools-get-model-parameter#

Get a model parameter from a simulation-model repository.

simtools.applications.get_model_parameter.run(app_context)[source]#

Run the model-parameter retrieval using an initialized application context.

The application supports three output modes:

  1. Print the model parameter to stdout.

  2. Write the model parameter to a JSON or YAML file using output_file.

  3. Export table-type model parameters using export_model_file.

The export_model_file mode is type-dependent:

  • File-backed parameters are exported as model files.

    Use output_file to override the exported file name.

  • Dict-backed table parameters are exported as ECSV, using output_file as the base name.

For file-backed parameters, export_model_file_as_table can be added to also write an ECSV representation next to the exported file.

Command line arguments

parameter (str, required)

Parameter name

parameter_version (str, optional)

Parameter version

model_version (str, required)

Model version

site (str, required)

South or North.

telescope (str, optional)

Telescope model name (e.g. LST-1, SST-D, …)

output_file (str, optional)

Output file name for writing the model parameter, overriding the exported file name for file-backed parameters, or base file name for exporting dict-backed tables as ECSV.

export_model_file (bool, optional)

Export parameter data (model files for file-backed parameters, ECSV for dict-backed table parameters).

export_model_file_as_table (bool, optional)

Export file-backed parameters as astropy tables in addition to the original file export. Use together with export_model_file.

Raises

KeyError in case the parameter requested does not exist in the model parameters.

Example

Print the mirror_list parameter entry used for a given model_version.

simtools-get-model-parameter --parameter mirror_list \\
        --site North --telescope LSTN-01 \\
        --model_version 5.0.0

Write the model parameter for a parameter to a JSON file.

simtools-get-model-parameter --parameter array_element_position_ground \\
        --site North --telescope LSTN-01 \\
        --parameter_version 6.0.0 \\
        --output_file array_element_position_ground.json

Export a file-backed parameter using the original file name stored in the model repository.

simtools-get-model-parameter --parameter mirror_list \\
        --site North --telescope LSTN-01 \\
        --parameter_version 1.0.0 \\
        --export_model_file

Export a file-backed parameter and override the output file name.

simtools-get-model-parameter --parameter mirror_list \
        --site North --telescope LSTN-01 \
        --parameter_version 1.0.0 \
        --export_model_file --output_file my_mirror_list.dat

Export a file-backed parameter and also write an ECSV table representation.

simtools-get-model-parameter --parameter mirror_reflectivity \\
        --site North --telescope LSTN-01 \\
        --model_version 6.0.2 \\
        --export_model_file --export_model_file_as_table

Export a dict-backed table parameter as ECSV. The .ecsv suffix is added automatically.

simtools-get-model-parameter --parameter fadc_pulse_shape \\
        --site North --telescope LSTN-01 \\
        --parameter_version 2.0.0 \\
        --export_model_file --output_file fadc_pulse_shape

Command line arguments#

options#

–help

show this help message and exit

–parameter

Parameter name

Required.

–output_file

Output file name for writing the parameter value, overriding the file-backed export name, or base name for ECSV export of dict-backed tables.

–export_model_file

Export file-backed parameter data (or dict-backed table data as ECSV when –output_file is supplied).

–export_model_file_as_table

Also export file-backed parameters as ECSV. Use with –export_model_file. This legacy option will be removed when file-backed parameters are replaced by table-backed ones.

simulation model#

–model_version

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

–parameter_version

model parameter version

–site

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

–telescope

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

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.

application#

–show_options

Print available values for a supported option and exit.

Examples#

Export an MST ground position#

Retrieve the North-site ground position of MSTN-09 as a versioned model parameter.

Application: simtools-get-model-parameter

Integration test: get_model_parameter_array_element_position_ground.yml

Command

simtools-get-model-parameter --config tests/integration_tests/config/get_model_parameter_array_element_position_ground.yml

Configuration

log_level: DEBUG
model_version: 6.0.2
output_file: test.json
output_path: simtools-output
parameter: array_element_position_ground
site: North
telescope: MSTN-09

Retrieve the North-site reference altitude#

Read the North observatory reference-point altitude from the simulation-model repository.

Application: simtools-get-model-parameter

Integration test: get_model_parameter_site_parameter.yml

Command

simtools-get-model-parameter --config tests/integration_tests/config/get_model_parameter_site_parameter.yml

Configuration

model_version: 6.0.2
parameter: reference_point_altitude
site: North

Export LST mirror reflectivity#

Retrieve the LSTN-01 mirror-reflectivity table for the selected model version and export it as a table.

Application: simtools-get-model-parameter

Integration test: get_model_parameter_telescope_model_version.yml

Command

simtools-get-model-parameter --config tests/integration_tests/config/get_model_parameter_telescope_model_version.yml

Configuration

export_model_file: true
export_model_file_as_table: true
model_version: 6.0.2
output_path: simtools-output
parameter: mirror_reflectivity
site: North
telescope: LSTN-01

Retrieve a versioned LST mirror list#

Read version 2.0.0 of the LSTN-01 mirror-list parameter from the simulation-model repository.

Application: simtools-get-model-parameter

Integration test: get_model_parameter_telescope_parameter_version.yml

Command

simtools-get-model-parameter --config tests/integration_tests/config/get_model_parameter_telescope_parameter_version.yml

Configuration

log_level: DEBUG
output_file: test.json
output_path: simtools-output
parameter: mirror_list
parameter_version: 2.0.0
site: North
telescope: LSTN-01