Wondering if energy-dependent convolution code is of interest for AstroPy

11 views
Skip to first unread message

Amy Roberts

unread,
Jun 3, 2025, 6:21:31 PMJun 3
to astropy-dev

Hello,

My team and I (especially @Arqu1100) have been working on energy-dependent convolutions for a nuclear physics application: https://github.com/det-lab/energyDependentColvolve.

We're looking to release this code either as a standalone library or as part of a domain-specific library because we ran into quite a few issues when writing the code and would like to help out other groups who need to do this "simple" calculation.  The original use case was beam physics but we think that there might be a need for this in astrophysics as well, hence asking astropy :)

This code is definitely not ready for a pull request, but if there's any interest in this feature we're happy to create one.  @Arqu1100 has worked particularly hard on creating test cases. The only existing library we found that does what we do here is varconvolve, which we haven't been able to verify against our test cases. Other examples of code that does a similar job are referenced on Stack Overflow as being deeply embedded into ldscat (https://stackoverflow.com/questions/18624005/how-do-i-perform-a-convolution-in-python-with-a-variable-width-gaussian).

If there's a better place to ask the question, please let me know.  Thanks all!

Amy Roberts

Amy Roberts

unread,
Jun 3, 2025, 6:56:29 PMJun 3
to astropy-dev
Hello,

Just wanted to add that I had a discussion with pllim on Slack and they suggested looking into scipy or numpy instead.

We'd be happy to implement a version for astropy and its NaN-friendly convolve if there's burning interest (or any interest), but it sounds like that may not be the case.  Also note that the current code uses numba, but that's just us playing around.

Kyle Westfall

unread,
Jun 3, 2025, 8:09:29 PMJun 3
to astro...@googlegroups.com, Amy Roberts

Hi Amy,

In terms of an existing function outside of numpy, scipy, I have used ppxf.ppxf_util.gaussian_filter1d from Michele Cappellari's ppxf package: https://pypi.org/project/ppxf/ .

Some code, documentation, and a (relatively simple) test of how I've used this can be found here:

https://sdss-mangadap.readthedocs.io/en/latest/resolution.html

I'd be interested in a performance comparison (computation accuracy and speed), particularly given the issues you mentioned.  And I'm happy to run some tests on my end.  I'm in the astropy Slack, so I'll ping you there as well.

Thanks,
Kyle
--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/astropy-dev/b26a843e-fb59-4ec2-8556-918550d8b0cfn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages