Skip to content
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 from
Closed

Conversation

@ellisowen
Copy link
Contributor

@ellisowen ellisowen commented Jul 25, 2014

As discussed in pull request #154

@ellisowen
Copy link
Contributor Author

@ellisowen 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
Copy link
Member

@cdeil 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
Copy link
Contributor Author

@ellisowen ellisowen commented Jul 28, 2014

This should now be OK - please review

@cdeil
Copy link
Member

@cdeil 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
Copy link
Member

@cdeil 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 Psf convolve 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 Add PSR convolve function 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
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants