from_gaussian_moments

from_gaussian_moments#

scarlet2.init.from_gaussian_moments(obs, center, box_sizes=None, min_snr=3, min_corr=0.99, min_value=1e-06, max_value=0.999999)[source]#

Create a Gaussian-shaped morphology and associated spectrum from the observation(s).

The method determines an suitable bounding box that contains the source given its center, computes the deconvolved moments up to order 2, constructs the spectrum from the 0th moment and a morphology image from the 2nd moments (assuming a Gaussian shape).

If multiple observations are given, it takes the median of the moments in the same channel.

Parameters:
  • obs (Observation or list) – Observation from which the source is initialized.

  • center (tuple) – Central pixel of the source

  • box_sizes (None, list[int] or list[SkyCoord]) – A list of box sizes to choose from. If None, chooses multiples of the PSF FWHM from obs.

  • min_snr (float) – Minimum SNR of edge pixels (aggregated over all observation channel) to allow increase of box size

  • min_corr (float) – Minimum correlation coefficient between center and edge color to allow increase of box size

  • min_value (float) – Minimum pixel value (useful to set to > 0 for positivity constraints)

  • max_value (float) – Minimum pixel value (useful to set to < 1 for unit interval constraints)

Returns:

Spectrum and morphology arrays

Return type:

(array,array)

Warning

This method is stable only for isolated sources. In cases of significant blending, the size of the bounding box and the measured moments are likely biased high.

See also

make_bbox

Defines bounding box that contains the source

standardized_moments

Computes 2nd moments for source in bounding box