ecpi.process.imag.core.source_finder module

Section author: ECLAIRs GP team

Methods to find sources in the sky image

Summary

Classes:

MaxSourceFinder

Sky source finder, based on the best excess in the SNR image

Class diagram:

Reference

class MaxSourceFinder(sky_count, sky_snr, fit_method=<function gaussian_2d_2width_offset>, fit_sigma=1.155, subimage_size=10, image_margins=0)[source]

Bases: object

Sky source finder, based on the best excess in the SNR image

change_sky(sky_count, sky_snr)[source]

re-configure the MaxSourceFinder with a new sky

Parameters
  • sky_count (2D array) – sky image to loo for sources in

  • sky_snr (2D array) – sky snr image

fit_source(snr_min, peak_position=None, show=None, verbose=None)[source]

Finds the source using the SkySNR and SkyCount images

  • look for the best excess in the SkySNR map.

  • select a region around the source in the SkyCount image to do the fit (+-10 pixels)

  • perform a 2D-Gaussian fit to get the final location of the source

fit results in self.params = [height_fit, x_pos_fit, y_pos_fit, sigma_x_fit, sigma_y_fit]

Parameters
  • snr_min – snr limit for the source research

  • peak_position – position of the peak to be fitted,

if already known. [pix_y, pix_z]. Default=None :param show: show fit plot :param verbose: print statement feedback :type snr_min: float (>0) :type peak_position: [float, float] :type show: string (‘2d’ or ‘3d’ or default=None) :type verbose: bool (default=None)

Variables

success – 0

fit_source_position(show=None)[source]

fit a gaussian 2D on a sky portion around the source

sky portion = subimage_size around the source

If the fitted peak position is out of the sky portion, the fit is considered as a failure.

fit params are save in sky image pixel coordinates

Parameters

show (string) – plot the sky portion in ‘2d’ or in ‘3d’. Default=None.

get_peak_position_and_value()[source]

Returns the pixel coordinates and the value of the maximum SNR found on the SNR image