You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the comment it tries to renormalize along the migration axis, but I think the specified axis is wrong. It seems the function assumes that the returned matrix matrix_interp from the astropy.interpolate.griddata is the shape (n_energy_bins, n_migration_bins, n_fov_offset_bins), but when I checked it by myself it is returned with an extra axis at the beginning which is originally used for storing multiple matrixes of all the grid points. So the current normalization with the axis 1 must be done along the energy axis, resulting the matrix different from the original one.
The wrongly interpolated energy dispersion clearly affects the reconstruction of the Crab spectrum (I will add the plots later here) as shown in the attached plots. Since the interpolation method is already updated in pyirf v0.7.0, it does not make sense to open an issue in the pyirf repository. One solution is to implement a custom interpolation method in our pipeline which normalizes along the migration axis, until we update pyirf to newer versions. Please let me know what you think @jsitarek.
The text was updated successfully, but these errors were encountered:
sorry for a late feedback.
Indeed you are right, the old code was wrong. The new code also changed the API, so I think your proposed solution is the best: we keep with the reimplemented function in the code, and refactor it once again to a new function when we update the pyirf version.
We can close this issue when #91 is merged
Hi @jsitarek, thanks for your checks. I actually opened another pull request #95 to fix this issue since it is a bug and not related to the refactoring #91, so let me merge #95 to the master branch.
I found that the interpolated energy dispersion matrix with the "nearest" method is somehow changed from the original matrix as shown in the attached plots. It seems to me that there is an issue in the pyirf (v0.6.0) interpolation function
pyirf.interpolation.interpolate_energy_dispersion
, where the interpolated matrix is renormalized:https://github.com/cta-observatory/pyirf/blob/3f9cfba672c8a25eb5094d25acf411c6b2104112/pyirf/interpolation.py#L92
According to the comment it tries to renormalize along the migration axis, but I think the specified axis is wrong. It seems the function assumes that the returned matrix
matrix_interp
from theastropy.interpolate.griddata
is the shape (n_energy_bins, n_migration_bins, n_fov_offset_bins), but when I checked it by myself it is returned with an extra axis at the beginning which is originally used for storing multiple matrixes of all the grid points. So the current normalization with the axis 1 must be done along the energy axis, resulting the matrix different from the original one.The wrongly interpolated energy dispersion clearly affects the reconstruction of the Crab spectrum
(I will add the plots later here)as shown in the attached plots. Since the interpolation method is already updated in pyirf v0.7.0, it does not make sense to open an issue in the pyirf repository. One solution is to implement a custom interpolation method in our pipeline which normalizes along the migration axis, until we update pyirf to newer versions. Please let me know what you think @jsitarek.The text was updated successfully, but these errors were encountered: