fit_streak_profile

acstools.utils_findsat_mrt.fit_streak_profile(yarr, p0, fit_background=True, plot_streak=False, max_width=None, ax=None, bounds=None)

Fits a Gaussian to a 1D cross-section of a trail in an image.

Parameters:
  • yarr (float) – Values of trail cross-section at each position.

  • p0 (list of float or None) – Initial guesses for amplitude, mean, and sigma parameters. Each guess is allowed to be None if unknown.

  • fit_background (bool, optional) – Set to fit a polynomial to the background. The default is True.

  • plot_streak (bool, optional) – Set to plot the resulting fitted profile. The default is False.

  • max_width (int or None, optional) – Maximum allowed width of robust satellite trail. Used to define background regions. The default is None.

  • ax (matplotlib.axes.Axes or None, optional) – Matplotlib subplot axis of the plot. The default is None (no plot).

  • bounds (dict or None, optional) – Dictionary containing the bounds of fit parameters. Format is {'parameter': (lower, upper)}. The default is None.

Returns:

  • g (Gaussian1D) – Best-fit 1D Gaussian model.

  • snr (float) – Derived signal-to-noise ratio of feature.

  • width (float) – Derived 3-sigma width of feature, where sigma is from the Gaussian fit.

  • mean_flux (float) – The mean flux measured within +/-sigma from the Gaussian fit.