threeML / hawc_hal

HAWC Accelerated Likelihood - python-only framework for HAWC data analysis
BSD 3-Clause "New" or "Revised" License
11 stars 21 forks source link

Using asymmetric PSF in HAL #59

Closed zhoouhaoo closed 3 years ago

zhoouhaoo commented 3 years ago

Feature Request

We need to read asymmetric PSF (asymmetric double gaussian function) from detector response file and use it to convolve point and extended sources.

hayalaso commented 3 years ago

I'm joining the party late, but I started looking into tools for convolving 2D spaces. I noticed that currently, we have in psf_convolutor.py the following imports:

from numpy.fft import rfftn, irfftn
#from scipy.signal import fftconvolve
from scipy.fftpack import helper

I found out that astropy also has some convolution libraries. I played with some functions from the tutorial in here.

It has the options to create the PSF (kernels in astropy lingo), so, if I'm thinking this correctly, we could fit the 2D gaussian PSF in HAWC simulations, save the widths, and use Gaussian2DKernel(here). It even has an option if the Gaussian is tilted. Or if we save 2D histograms, there's a CustomKernel (here) to create your own PSFs.

To convolve there are the convolve and convolve_fft functions.

github-actions[bot] commented 3 years ago

This issue has become stale. Is there an update? We will close in 14 days