Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add PSFMap class #1432
This PR adds a function to project a
@registerrier - Thanks!
I've left some inline comments.
More generally, I think extending the class-level docstring a bit to describe what this is would be useful.
An example code snippet how to make one of those things in an
Examples section is always gold for users and developers, because then they can just copy & paste that and start to learn / try out a new class in ipython / Jupyter. In this case it could be possible to read a CTA PSF IRF and make such a map with ~ 5 lines?
The other main comment I have is the name. You called the class
PSFMap. But is is not a map. It has a map. Looking at how this is used then from callers, you get code like in your test:
pmap = PSFMap(psfmap)
It's easy to be confused in calling code what the "psf_map" and the "pmap" are, no?
As you've probably seen in
I put "kernel" in the class name, because for me a fundamental difference wrt the IRF classes is that those represent probability density functions, but this is a discretised probability mass function, i.e. what is commonly called a "kernel".
Suggest to avoid the use of "Map" in the class name here to avoid confusion.
Regarding the name, indeed
Making an inheritance on
This object does not contain kernels a priori, but can be used to create them. It could be called PSFKernelMaker or PSFKernelFactory or?
What we are doing here is really to create and handle maps of IRFs (here PSF but the approach would be nearly identical for Edisp). So PSFMapHandler could be a better name?
I'm afraid I'm out of good ideas concerning the name. Maybe leave as-is? I certainly didn't want to suggest changing to subclassing or something like that, I was just confused about what this is and was thinking if there is a better name.