Skip to content Skip to sidebar Skip to footer

Generate A Gaussian Kernel Given Mean And Standard Deviation

This question here addresses how to generate a Gaussian kernel using numpy. However I do not understand what the inputs used kernlen and nsig are and how they relate to the mean/st

Solution 1:

You could use astropy, especially the Gaussian2D model from the astropy.modeling.models module:

from astropy.modeling.models import Gaussian2D

g2d = Gaussian2D(x_mean=8, y_mean=10, x_stddev=3, y_stddev=3)  # specify properties

g2d(*np.mgrid[0:100, 0:100])  # specify the grid for the array

enter image description here


Post a Comment for "Generate A Gaussian Kernel Given Mean And Standard Deviation"