cta-observatory / ctapipe

Low-level data processing pipeline software for CTAO or similar arrays of Imaging Atmospheric Cherenkov Telescopes
https://ctapipe.readthedocs.org
BSD 3-Clause "New" or "Revised" License
63 stars 266 forks source link

Good interface for reading ImPACT templates #2587

Open gschwefer opened 2 weeks ago

gschwefer commented 2 weeks ago

Hi everyone,

this is just to get some discussion and advice on what the best way to read the ImPACT templates might be. Currently, the interface is the following:

You need to specify one directory called root_dir in the config. This directory then needs to contain the template files with the predefined names {camera}.template.gz.

ImPACT also has the option implemented to additionally use the time gradient across the image in the likelihood. For this you need to set the option use_time_gradient in the config and then have templates {camera}_time.template.gz in root_dir

I think having predefined names for the templates is not great, and ideally they would be passed as arguments per tel type in the config. I would also like to eliminate the use_time_gradient option and just use it if time gradient templates are passed and not if not. What is the best way of doing this? Making the template path a TelescopeParameter?

The only upside of the current system to me is that it provides some level of "security" that only sensible and "correct" templates are used for each camera. It would be good to keep some mechanism for validating the templates used in the routine. Would this need to be put into the templates themselves or is there a smart way to do this via the config?

maxnoe commented 2 weeks ago

Making the template path a TelescopeParameter?

Yes, I think this would be the way to go.

It would be good to keep some mechanism for validating the templates used in the routine. Would this need to be put into the templates themselves or is there a smart way to do this via the config?

You could store the tel type in the template files, I am not sure what the format of these files are, but they should support metadata and eventually contain the CTAO product metadata.

Then you can validate that telescope type is equal or at least reasonably close.