twodgaussian#
- radiosim.utils.gauss.twodgaussian(params: list, size: int) ndarray[source]#
Returns a 2d gaussian function of the form:
\[\begin{split}x' &= \cos(rot) * x - \sin(rot) * y \\ y' &= \sin(rot) * x + \cos(rot) * y \\ g &= a * \exp(-(((x - \mathtt{center\_x})/ \mathtt{width\_x})^2 \\ &\phantom{=} + ((y - \mathtt{center\_y}) / \mathtt{width\_y})^2 ) / 2 )\end{split}\]Pro: Faster than gauss
Con: More difficult to understand
- Parameters:
- params: list
[amplitude, center_x, center_y, width_x, width_y, rot] (rot (rotation) in radian)
- size: int
length of the image
- Returns:
- rotgauss: array_like
gaussian distribution in two dimensions
Notes
Short version of
twodgaussian: keflavich/gaussfitter