gammasim / simtools

Tools and applications for the Simulation System of the CTA Observatory.
https://gammasim.github.io/simtools
BSD 3-Clause "New" or "Revised" License
10 stars 1 forks source link

tests of KeyError after positions calibration_elements are added to DB #1051

Open tobiaskleiner opened 1 month ago

tobiaskleiner commented 1 month ago

In export_array_elements_as_table in array_model.

GernotMaier commented 1 month ago

@tobiaskleiner - I guess you mean this function here? https://github.com/gammasim/simtools/blob/f92147265e5da546370b0a46c86360047a8e3b57/simtools/model/array_model.py#L368 (Always better to add a permanent link to issues.

Where exactly do you want to add a test for KeyError? Or is it already implemented and this issue is obsolete?

tobiaskleiner commented 1 month ago

@GernotMaier the current implementation doesn't export the coordinates of other array elements, only telescope model positions. Maybe we can generalize this.? Then the KeyError test is not really needed anymore as there is the try ... except now.

GernotMaier commented 1 month ago

Yes, this should be generalised (possibly with the option of given a list of array element types in the call).

But do I see correctly the array_model only knows about telescopes as array elements, but about the calibration devices?

tobiaskleiner commented 1 month ago

Yes this needs to be added if we want to output all elements.