Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion database_scripts/upload_from_model_repository_to_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# shellcheck disable=SC1091

DB_SIMULATION_MODEL_URL="https://gitlab.cta-observatory.org/cta-science/simulations/simulation-model/simulation-models.git"
DB_SIMULATION_MODEL_BRANCH="v1.0.0-parameters"
DB_SIMULATION_MODEL_BRANCH="prod5-prod6-corrections"

# Check that this script is not sourced but executed
if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
Expand Down
11 changes: 2 additions & 9 deletions src/simtools/model/model_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,18 +344,14 @@ def extra_label(self):
"""Return the extra label if defined, if not return ''."""
return self._extra_label if self._extra_label is not None else ""

def get_simtel_parameters(self, parameters=None, telescope_model=True, site_model=True):
def get_simtel_parameters(self, parameters=None):
"""
Get simtel parameters as name and value pairs.

Parameters
----------
parameters: dict
Parameters (simtools) to be renamed (if necessary)
telescope_model: bool
If True, telescope model parameters are included.
site_model: bool
If True, site model parameters are included.

Returns
-------
Expand All @@ -369,10 +365,7 @@ def get_simtel_parameters(self, parameters=None, telescope_model=True, site_mode
_simtel_parameter_value = {}
for key in parameters:
_par_name = names.get_simulation_software_name_from_parameter_name(
key,
simulation_software="sim_telarray",
search_telescope_parameters=telescope_model,
search_site_parameters=site_model,
key, simulation_software="sim_telarray"
)
if _par_name is not None:
_simtel_parameter_value[_par_name] = parameters[key].get("value")
Expand Down
37 changes: 37 additions & 0 deletions src/simtools/schemas/model_parameters/array_window.schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
%YAML 1.2
---
title: Schema for array_window model parameter
version: 0.1.0
meta_schema: simpipe-schema
meta_schema_url: https://raw.githubusercontent.com/gammasim/simtools/main/src/simtools/schemas/model_parameter_and_data_schema.metaschema.yml
meta_schema_version: 0.1.0
name: array_window
description: |-
Length of a coincidence window of the default stereo trigger,
after correction of fixed (cable length, focal length, etc.)
and variable (view direction) delays.
short_description: |-
Length of a coincidence window of the default stereo trigger.
data:
- type: double
unit: ns
default: 1000.
instrument:
class: Camera
type:
- LSTN
- LSTS
- MSTN
- MSTS
- SSTS
- SCTS
activity:
setting:
- SetParameterFromExternal
validation:
- ValidateParameterByExpert
- ValidateTriggerPerformance
source:
- Initial instrument setup
simulation_software:
- name: sim_telarray
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ instrument:
type:
- LSTN
- LSTS
- MSTN
- MSTS
- SSTS
- SCTS
activity:
setting:
- SetParameterFromExternal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ instrument:
type:
- MSTN
- MSTS
- SSTS
- SCTS
activity:
setting:
- SetParameterFromExternal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ instrument:
type:
- MSTN
- MSTS
- SSTS
- SCTS
activity:
setting:
- SetParameterFromExternal
Expand Down
2 changes: 0 additions & 2 deletions src/simtools/schemas/model_parameters/dsum_offset.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ instrument:
type:
- MSTN
- MSTS
- SSTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove only SSTs if it is relevant only for FlashCams?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, see above.

- SCTS
activity:
setting:
- SetParameterFromExternal
Expand Down
2 changes: 0 additions & 2 deletions src/simtools/schemas/model_parameters/dsum_pedsub.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ instrument:
type:
- MSTN
- MSTS
- SSTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove only SSTs if it is relevant only for FlashCams?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, see above.

- SCTS
activity:
setting:
- SetParameterFromExternal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ instrument:
type:
- MSTN
- MSTS
- SSTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove only SSTs if it is relevant only for FlashCams?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, see above.

- SCTS
activity:
setting:
- SetParameterFromExternal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ instrument:
type:
- MSTN
- MSTS
- SSTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove only SSTs if it is relevant only for FlashCams?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, see above.

- SCTS
activity:
setting:
- SetParameterFromExternal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ instrument:
type:
- MSTN
- MSTS
- SSTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove only SSTs if it is relevant only for FlashCams?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, see above.

- SCTS
activity:
setting:
- SetParameterFromExternal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ instrument:
type:
- MSTN
- MSTS
- SSTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove only SSTs if it is relevant only for FlashCams?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, see above.

- SCTS
activity:
setting:
- SetParameterFromExternal
Expand Down
2 changes: 0 additions & 2 deletions src/simtools/schemas/model_parameters/dsum_shaping.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ instrument:
type:
- MSTN
- MSTS
- SSTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove only SSTs if it is relevant only for FlashCams?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, see above.

- SCTS
activity:
setting:
- SetParameterFromExternal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ instrument:
type:
- MSTN
- MSTS
- SSTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove only SSTs if it is relevant only for FlashCams?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, see above.

- SCTS
activity:
setting:
- SetParameterFromExternal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ instrument:
type:
- MSTN
- MSTS
- SSTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove only SSTs if it is relevant only for FlashCams?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, see above.

- SCTS
activity:
setting:
- SetParameterFromExternal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ instrument:
type:
- MSTN
- MSTS
- SSTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove only SSTs if it is relevant only for FlashCams?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, see above.

- SCTS
activity:
setting:
- SetParameterFromExternal
Expand Down
5 changes: 1 addition & 4 deletions src/simtools/simtel/simtel_config_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,7 @@ def _write_site_parameters(self, file, site_model, model_path, telescope_model):
_site_parameters = site_model.get_simtel_parameters()
for par, value in _site_parameters.items():
_simtel_name = names.get_simulation_software_name_from_parameter_name(
par,
simulation_software="sim_telarray",
search_telescope_parameters=False,
search_site_parameters=True,
par, simulation_software="sim_telarray"
)
_simtel_name, value = self._convert_model_parameters_to_simtel_format(
_simtel_name, value, model_path, telescope_model
Expand Down
12 changes: 1 addition & 11 deletions src/simtools/utils/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,6 @@ def get_collection_name_from_array_element_name(name, array_elements_only=True):
def get_simulation_software_name_from_parameter_name(
par_name,
simulation_software="sim_telarray",
search_telescope_parameters=True,
search_site_parameters=True,
):
"""
Get the name used in the simulation software from the model parameter name.
Expand All @@ -350,21 +348,13 @@ def get_simulation_software_name_from_parameter_name(
Model parameter name.
simulation_software: str
Simulation software name.
search_telescope_parameters: bool
If True, telescope model parameters are included.
search_site_parameters: bool
If True, site model parameters are included.

Returns
-------
str
Simtel parameter name.
"""
_parameter_names = {}
if search_telescope_parameters:
_parameter_names.update(telescope_parameters())
if search_site_parameters:
_parameter_names.update(site_parameters())
_parameter_names = {**telescope_parameters(), **site_parameters()}

try:
_parameter = _parameter_names[par_name]
Expand Down
1 change: 1 addition & 0 deletions tests/resources/model_parameters/mirror_list.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"schema_version": "0.2.0",
"parameter": "mirror_list",
"instrument": "LSTN-01",
"site": "North",
"parameter_version": "2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#endif

altitude = 2158.0
array_window = 1000.0
asum_clipping = 9999.0
asum_offset = 0.0
asum_shaping_file = none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#endif

altitude = 2156.0
array_window = 1000.0
asum_clipping = 9999.0
asum_offset = 0.0
asum_shaping_file = none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#endif

altitude = 2158.0
array_window = 1000.0
asum_clipping = 9999.0
asum_offset = 0.0
asum_shaping_file = none
Expand All @@ -19,7 +20,7 @@ atmospheric_transmission = atm_trans_2158_1_3_2_0_0_0.1_0.1.dat
axes_offsets = 0.0 0.0
camera_body_diameter = 348.0
camera_body_shape = 2
camera_config_file = camera_CTA-LST-1_analogsum21_v2020-04-14.dat
camera_config_file = camera_CTA-LST-234_analogsum21_v2020-04-14.dat
camera_degraded_efficiency = 1.0
camera_degraded_map = none
camera_depth = 0.0
Expand Down Expand Up @@ -89,12 +90,12 @@ mirror_align_random_vertical = 0.0039 28.0 0.0 0.0
mirror_class = 0
mirror_degraded_reflection = 1.0
mirror_focal_length = 0.0
mirror_list = mirror_CTA-N-LST1_v2019-03-31.dat
mirror_list = mirror_CTA-N-LST2_v2020-04-07.dat
mirror_offset = 93.25
mirror_reflection_random_angle = 0.0075 0.125 0.037
mirror_reflectivity = ref_LST_2020-04-23.dat
multiplicity_offset = -0.5
nightsky_background = all: 0.238006
nightsky_background = all: 0.244985
nsb_autoscale_airmass = 0.84 0.29
nsb_offaxis = 0.0 0.0 0.0 0.0 0.0
num_gains = 2
Expand All @@ -104,12 +105,12 @@ photon_delay = 19.0
pixeltrg_time_step = 0.0
pm_average_gain = 40000.0
pm_collection_efficiency = 1.0
pm_gain_index = 4.5
pm_gain_index = 3.92
pm_photoelectron_spectrum = spe_LST_2020-05-09_AP2.0e-4.dat
pm_transit_time = 24.74 9.0 350.0 1066.0
pm_voltage_variation = 0.041
pm_transit_time = 20.89 9.0 350.0 1135.0
pm_voltage_variation = 0.03
qe_variation = 0.03
quantum_efficiency = qe_lst1_20200318_high+low.dat
quantum_efficiency = qe_lst2-4_20200318_high+low.dat
random_focal_length = 0.0 0.0
telescope_random_angle = 0.0
telescope_random_error = 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#endif

altitude = 2156.0
array_window = 1000.0
asum_clipping = 9999.0
asum_offset = 0.0
asum_shaping_file = none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#endif

altitude = 2158.0
array_window = 1000.0
asum_clipping = 9999.0
asum_offset = 0.0
asum_shaping_file = none
Expand All @@ -19,7 +20,7 @@ atmospheric_transmission = atm_trans_2158_1_3_2_0_0_0.1_0.1.dat
axes_offsets = 0.0 0.0
camera_body_diameter = 348.0
camera_body_shape = 2
camera_config_file = camera_CTA-LST-1_analogsum21_v2020-04-14.dat
camera_config_file = camera_CTA-LST-234_analogsum21_v2020-04-14.dat
camera_degraded_efficiency = 1.0
camera_degraded_map = none
camera_depth = 0.0
Expand Down Expand Up @@ -89,12 +90,12 @@ mirror_align_random_vertical = 0.0039 28.0 0.0 0.0
mirror_class = 0
mirror_degraded_reflection = 1.0
mirror_focal_length = 0.0
mirror_list = mirror_CTA-N-LST1_v2019-03-31.dat
mirror_list = mirror_CTA-N-LST3_v2020-04-07.dat
mirror_offset = 93.25
mirror_reflection_random_angle = 0.0075 0.125 0.037
mirror_reflectivity = ref_LST_2020-04-23.dat
multiplicity_offset = -0.5
nightsky_background = all: 0.238006
nightsky_background = all: 0.244985
nsb_autoscale_airmass = 0.84 0.29
nsb_offaxis = 0.0 0.0 0.0 0.0 0.0
num_gains = 2
Expand All @@ -104,12 +105,12 @@ photon_delay = 19.0
pixeltrg_time_step = 0.0
pm_average_gain = 40000.0
pm_collection_efficiency = 1.0
pm_gain_index = 4.5
pm_gain_index = 3.92
pm_photoelectron_spectrum = spe_LST_2020-05-09_AP2.0e-4.dat
pm_transit_time = 24.74 9.0 350.0 1066.0
pm_voltage_variation = 0.041
pm_transit_time = 20.89 9.0 350.0 1135.0
pm_voltage_variation = 0.03
qe_variation = 0.03
quantum_efficiency = qe_lst1_20200318_high+low.dat
quantum_efficiency = qe_lst2-4_20200318_high+low.dat
random_focal_length = 0.0 0.0
telescope_random_angle = 0.0
telescope_random_error = 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#endif

altitude = 2156.0
array_window = 1000.0
asum_clipping = 9999.0
asum_offset = 0.0
asum_shaping_file = none
Expand Down
Loading
Loading