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

Add a PSFKernel to perform PSF convolution on Maps #1447

Merged
merged 16 commits into from Jul 4, 2018

Conversation

3 participants
@registerrier
Contributor

registerrier commented Jun 28, 2018

This is a first commit to discuss.

Two function that take a TablePSF or an EnergyDependentTablePSF as well as a MapGeom are provided and are used to build the PSF kernel map.

The creators on PSFKernel ensure that there is an odd number of pixels for convolution.

The PSFKernel.apply()method is performing the PSF kernel convolution on a Map that has the same geometry.

A number of tests are present already and should be completed.

@registerrier registerrier requested review from cdeil and adonath Jun 28, 2018

@registerrier registerrier self-assigned this Jun 28, 2018

@registerrier registerrier added this to To do in Map analysis via automation Jun 28, 2018

@registerrier registerrier added this to the 0.8 milestone Jun 28, 2018

@cdeil

@registerrier - Thanks!

See my inline comments. Almost all of them are to reduce the amount of code and code duplication. At the moment there's ~ 20 lines of non-trivial code here that's duplicated for the 2D and 3D case for no good reason, and IMO the method to compute the kernel is unnecessarily complex (e.g. the solid angle multiplication), given that a caller has little control e.g. over PSF placement anyways (at least you don't show how to do it by preparing a geom object that's centered on a source or expose a source position option at the moment in the constructor methods).

Show outdated Hide outdated gammapy/cube/psf_kernel.py
Show outdated Hide outdated gammapy/cube/psf_kernel.py
Show outdated Hide outdated gammapy/cube/psf_kernel.py
Show outdated Hide outdated gammapy/cube/psf_kernel.py
Show outdated Hide outdated gammapy/cube/psf_kernel.py
Show outdated Hide outdated gammapy/cube/psf_kernel.py
Show outdated Hide outdated gammapy/cube/tests/test_psf_kernel.py
Show outdated Hide outdated gammapy/cube/tests/test_psf_kernel.py
Show outdated Hide outdated gammapy/cube/psf_kernel.py
Show outdated Hide outdated gammapy/cube/psf_kernel.py

@registerrier registerrier moved this from To do to In progress in Map analysis Jun 29, 2018

Show outdated Hide outdated gammapy/maps/geom.py

registerrier added some commits Jul 2, 2018

@cdeil cdeil assigned cdeil and unassigned registerrier Jul 4, 2018

@cdeil

cdeil approved these changes Jul 4, 2018

@cdeil cdeil merged commit 2437fa5 into gammapy:master Jul 4, 2018

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

Map analysis automation moved this from In progress to Done Jul 4, 2018

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jul 4, 2018

Member

@registerrier - Thank you very much!

Member

cdeil commented Jul 4, 2018

@registerrier - Thank you very much!

@joleroi joleroi referenced this pull request Jul 6, 2018

Merged

Improve SkyModelMapFit #1454

@cdeil cdeil referenced this pull request Jul 6, 2018

Closed

Introduce PSF kernel classes #1048

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment