-
Notifications
You must be signed in to change notification settings - Fork 25
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
IRF classes #151
Comments
I'd suggest a light internal data structure, since the gammapy's IRF structure may not be stable and it has some assumptions on how IRFs are dimensioned that we might not want to make initially in pyirf. For example, they assume IRFs are 2D or 3D and are already marginalized to a specific observation (which is fine for a DL3 IRF), but in pyirf might want to be able to make IRFs as a function of not only fov coordinates + energy, but also zenith angle, or other dimensions (a master IRF that can then be later marginalized to many observations). |
could look at xarray for inspiration for the API at least. It may be overkill as an explicit dependency, though it does give you interpolation, plotting, and IO (to hdf5 netcdf) built-in (http://xarray.pydata.org/en/stable/data-structures.html). |
The idea is actually pretty similar to the gammapy |
@maxnoe and @kosack In Gammapy we have (for "historical reasons") two nd data structures: This year we spend some time to refactor the existing IRF classes in Gammapy and introduced a ND base class. The class takes the declaration of the axis coordinates as a list of Using this base class the actual implementations of the IRF classes with fixed dimensions simplify to just declaring the physical axes and order and implement specific plotting functionality see e.g. EffectiveAreaTable2D. We also decided to keep the previously existing public API, that's why the base classes are not yet publicly documented. In general I think a package like
|
@adonath If you plan to move IRFs to use Maps, then that sounds like a good solution. It solves the dimensionality problem (assuming the spatial coordinates can be in AltAZ) and would be a nice interface. So I would suggest we just start with using |
Right now, we do not have special datastructures for IRFs, we use astropy quantities, numpy arrays.
This makes functions simpler and more flexible but an advantage of a specific datastructure would be to keep information together that belongs together (irfs with their bins).
Since gammapy already has these classes, we could think about using them, but that would again mean adding gammapy as required depedency.
An alternative would be to use some thin data class that holds the values, binnings and metadata.
The text was updated successfully, but these errors were encountered: