-
Notifications
You must be signed in to change notification settings - Fork 27
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
Specify IRF axis orders #28
Conversation
b2980d9
to
f5b1375
Compare
From the GammaLib perspective, I recently changed the code so that the order is not relevant anymore. I have however not tested this. And so far, I had used the ENERGY, THETA order for producing the CTA IRFs that are bundled with the software. Personally I prefer the ENERGY, THETA order since (a) it's the order Fermi-LAT uses (hence our format would be inconsistent with their format), and (b) it orders things by importance of dependency (the THETA dependency for the PSF is smaller than the ENERGY dependency for example). Concerning memory access, what is true for one application is false for another application. You cannot build a general data format on the assumed usage of that format. If a specific code needs things ordered in another way to be more efficient, the code has to deal with that reordering. In any case, GammaLib performs bilinear interpolations, hence needs to access both dimensions in any case. The current GammaLib implementation is ENERGY, DETX and DETY. This is consistent with the ENERGY, THETA order, as DETX, DETY is just a 2D version of THETA. As argued above, I would always put ENERGY first. |
@jknodlseder - OK. For now, I'm changing this spec update to say "recommended axis order: ENERGY, THETA". A better description and example of how axis order is defined in this BINTABLE FITS format would be good here: |
ok |
There is the case of the RPSF: For this the OGIP document recommends @jknodlseder - What's your preference here? (to me, your argument that codes can re-order if they think it matters for performance makes sense, so I guess we should put ENERGY first there also?) |
I would try to follow OGIP as much as possible, so I would keep the established order. Interesting to see that they were concerned by the access performance. They probably had specific applications in mind when writing the spec. |
OK, will keep In Gammapy we only compute a PSF kernel once at the start of the likelihood fit, so such concerns on IRF performance is irrelevant. It might matter for Gammalib, right? |
For EDISP2D is there any preference?
|
Also here, energy axes first (ENERGY, MIGRA), offset angle follows (THETA). |
The recommended axis orders should now (a30965f ) be correct. I've added this general statement:
@jknodlseder - OK for the wording on CUNIT? You plan to change Gammalib to respect those units, right? One last question: at the moment we have this general statement:
@jknodlseder - Does Gammalib currently support |
Merging this now. Further comments and suggestions welcome. FYI - For our Python prototype I'm still looking for feedback how to implement this well (abstract axis and array class, little code) based on |
This pull request specifies the IRF axis orders.
It became apparent that this is needed because we accidentally chose an
ENERGY, THETA
order forBKG_2D
, whereas the current AEFF and PSF formats useTHETA, ENERGY
(see gammapy/gammapy#461 (comment)).I think this pull request is uncontroversial and I'll merge it later today.
Still, @jknodlseder, @mimayer, @JouvinLea, if you could have a look and specifically comment on these questions, that would be useful:
THETA, ENERGY
axis order everywhere? Or isENERGY, THETA
better? The main difference is memory access speed ... values that are typically accessed together should be consecutive in memory so that CPU cache performance is better. I haven't thought about / benchmarked what is better here.ENERGY, DETX, DETY
correspond to the current Gammalib implementation? Or do you haveENERGY, DETY, DETX
?