ism3d.utils.misc.makekernel

ism3d.utils.misc.makekernel(xpixels, ypixels, beam, pa=0.0, cent=None, mode='center', factor=10, verbose=True)[source]

mode: ‘center’,’linear_interp’,’oversample’,’integrate’

beam=[bmaj,bmin] FWHM not (bmin,bmaj) pa=east from north (ccw)deli

in pixel-size units

by default: the resulted kernel is always centered around a single pixel, and the application of

the kernel will lead to zero offset,

make a “centered” Gaussian PSF kernel:
e.g. npixel=7, centered at px=3

npixel=8, centered at px=4 so the single peak is always at a pixel center (not physical center) and the function is symmetric around that pixel the purpose of doing this is to avoid offset when the specified kernel size is even number and you build a function peaked at a pixel edge.

is x ks (peak pixel index) 10 x 7(3) okay 10 x 8(4) okay 10 x 8(3.5) offset for convolve (non-fft), odd ks is required (the center pixel is undoubtely index=3)

even ks is not allowed

for convolve_fft, you need to use cent=ks/2:

technically it’s not the pixel index of image center but the center pixel is “considers”as index=4

the rule of thumb-up:

cent=floor(ks/2.) or int(ks/2) # int() try to truncate towards zero.

note:

Python “rounding half to even” rule vs. traditional IDL:

https://docs.scipy.org/doc/numpy/reference/generated/numpy.around.html https://realpython.com/python-rounding/ Python>round(1.5) # 2 Python>round(0.5) # 0 IDL>round(1.5) # 2 IDL>round(0.5) # 1

“forget about how the np.array is stored, just use the array as it is IDL;

when it comes down to shape/index, reverse the sequence”

About Undersampling Images: http://docs.astropy.org/en/stable/api/astropy.convolution.discretize_model.html