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 PSF convolve function #155

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@ellisowen
Contributor

ellisowen commented Jul 25, 2014

As discussed in pull request #154

@ellisowen

This comment has been minimized.

Show comment
Hide comment
@ellisowen

ellisowen Jul 25, 2014

Contributor

It's not clear why this still isn't passing - I don't get a problem on my machine...

Contributor

ellisowen commented Jul 25, 2014

It's not clear why this still isn't passing - I don't get a problem on my machine...

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jul 28, 2014

Member

You have to add a skipif for scipy as described here to get rid of this test error:
https://travis-ci.org/gammapy/gammapy/jobs/30803093#L1029

Member

cdeil commented Jul 28, 2014

You have to add a skipif for scipy as described here to get rid of this test error:
https://travis-ci.org/gammapy/gammapy/jobs/30803093#L1029

@ellisowen

This comment has been minimized.

Show comment
Hide comment
@ellisowen

ellisowen Jul 28, 2014

Contributor

This should now be OK - please review

Contributor

ellisowen commented Jul 28, 2014

This should now be OK - please review

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jul 29, 2014

Member

So given

image = some ndarray
psf = some EnergyDependentTablePSF

you propose

image2 = gammapy.image.psf_correlate(image, psf, many_extra_args)

which does these three steps:

table_psf = psf.table_psf_in_energy_band(some_extra_args)
kernel = table_psf.kernel(some_extra_args)
image2 = scipy.ndimage.convolve(image, kernel)

I'm not sure what this function does is useful / re-usable enough to warrant adding it.
We already have a bunch of PSF objects, and writing a function psf_convolve that only works with one of them and doesn't do much is a bit dubious IMO.

Before you work more on this or we close it, let's look at your use case and see if there really is something worth splitting out into a separate function ... e.g. if there's code to PSF-convolve cubes and it automatically loops over the energy slices that might very well be worth adding it as a utility to make sure users don't have to re-implement it over and over.

OK?

Member

cdeil commented Jul 29, 2014

So given

image = some ndarray
psf = some EnergyDependentTablePSF

you propose

image2 = gammapy.image.psf_correlate(image, psf, many_extra_args)

which does these three steps:

table_psf = psf.table_psf_in_energy_band(some_extra_args)
kernel = table_psf.kernel(some_extra_args)
image2 = scipy.ndimage.convolve(image, kernel)

I'm not sure what this function does is useful / re-usable enough to warrant adding it.
We already have a bunch of PSF objects, and writing a function psf_convolve that only works with one of them and doesn't do much is a bit dubious IMO.

Before you work more on this or we close it, let's look at your use case and see if there really is something worth splitting out into a separate function ... e.g. if there's code to PSF-convolve cubes and it automatically loops over the energy slices that might very well be worth adding it as a utility to make sure users don't have to re-implement it over and over.

OK?

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jul 29, 2014

Member

Closing this now ... we can always re-open if you want to make a pull request here.

Member

cdeil commented Jul 29, 2014

Closing this now ... we can always re-open if you want to make a pull request here.

@cdeil cdeil closed this Jul 29, 2014

@cdeil cdeil changed the title from Psf convolve to Add PSR convolve function Apr 8, 2015

@cdeil cdeil added the feature label Apr 8, 2015

@cdeil cdeil added this to the 0.1 milestone Apr 8, 2015

@cdeil cdeil changed the title from Add PSR convolve function to Add PSF convolve function Apr 8, 2015

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