-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change API of ImageCleaner to be __call__(self, event: ArrayEvent)
#2015
Comments
Side note, I think this shows again that we should Invert the in memory container hierarchy as discussed in #1165 to have
Instead of telescope maps for each data level. |
I don't really like passing too much info to low-level algorithms as it makes it hard to follow what they actually use, and the code becomes needsly confusing (this was one of the "lessons learned" we tried to avoid in ctapipe). Since I think pedestal variances are clearly useful for image cleaning, I would prefer just to pass those to all image cleaners explicitly in ImageProcessor. for the discussion about the array structure, see #1165 |
I think it is important here to make a difference between low-level code in small, self-contained functions with well-defined inputs and outputs and processing components that need to be flexible to allow access to more information that might be needed and which we currently do not anticipate. E.g. the low-level We have seen time and again, that more information becomes useful or is needed and expanding the API every time that happens is I think worse than just providing the high level API with the full event container. |
See also comment in this issue which I closed as duplicate of this one: |
There was a reason it was implemented this way: reusability. The idea was that you might have an ImageCleaner component in multiple places, for example inside the You can of course still use low-level versions of those in each place, but having a configurable algorithm has advantanges: e.g. we could study which cleaning method works best for DVR without having to change the code, or even use different methods for different cameras/telescopes |
You are now arguing some hypothetical use cases against a real one that was brought up multiple times. A usecase that is so important to e.g. the analysis of LST commissioning data, that lack of support for it prevents moving to using the ctapipe tools for the analysis. We need to enable this. Since the components can be configured, I don't see a reason why we can't add the needed configuration options needed for the use cases you mentioned even if we change to the more general API. Another possibility would be to have two public methods in |
Regarding #2331, would it be possible to temporarily add a MAGICCleaner under In this way, we ensure that the current structure of ctapipe cleaning API does not get modified yet, but we allow MAGIC people to update their code bases with more recent versions of ctapipe (I guess we can assume that a hypothetical MAGICCleaner is used only by MAGIC-related projects for now). Then when this issue gets closed you would only need to change the class parent (I am assuming very lightly). |
Any update on this? Now magic-cta-pipe moved to ctapipe v0.19, and I would really like to be able to move to use ctapipe tools for the pipeline, at least at the low level. Right now I am still stuck because I cannot implement the MAGIC cleaning inheriting directly from ImageCleaner. If there is another solution, of course let me know. |
Please describe the use case that requires this feature.
Currently, the
ImageCleaner
has the API of__call__(self, tel_id, image, peak_time)
.For more advanced cleaning methods that e.g. require monitoring information about the current NSB / pedestal variation, it is impossible to use this information.
Describe the solution you'd like
Also switch to
__call__(self, event)
so the cleaning algorithms can access all relevant information.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
E.g. LSTs cleaning is using a factor of the pedestal standard deviation as a lower bound for the cleaning threshold.
The text was updated successfully, but these errors were encountered: