filter_sources
- acstools.utils_findsat_mrt.filter_sources(image, streak_positions, plot_streak=False, buffer=100, minsnr=5, max_width=75, fit_background=True, min_length=50, check_persistence=True, min_persistence=0.5, persistence_chunk=100, min_persistence_snr=3)
Filter trail catalog of likely spurious sources.
The filtering is based on SNR, trail width, and trail_persistence (over what fraction of the trail path can the trail actually be well-detected).
- Parameters:
image (ndarray) – The original image containing the trails.
streak_positions (array) – And array containing the endpoints of each trail being analyzed. The format is
[[(x0, y0), (x1, y1)], [(x0_b, y0_b), (x1_b, y1_b)], ...]
.plot_streak (bool, optional) – Set to turn on plotting for each analyzed trail (WARNING: THIS CAN GENERATE A LOT OF PLOTS). The default is
False
.buffer (int, optional) – Size of cutout region on either side of a trail. The default is 100.
minsnr (float, optional) – Minimum signal-to-noise ratio for a trail to be considered robust. The default is 5.
max_width (int, optional) – Maximum trail width for it to be considered robust. The default is 75.
fit_background (bool, optional) – Set to fit a polynomial to the background on either side of an extracted trail. The default is
True
.min_length (int, optional) – The minimum allowed length of trail to be analyzed. Taking the median along each row of the rotated image to create a 1D profile will also ignore any rows with fewer than this number of pixels. The default is 50.
check_persistence (bool, optional) – Set to turn on persistence checking. The default is
True
.min_persistence (float, optional) – Minimum allowed persistence in order for a trail to be considered robust. The default is 0.5.
persistence_chunk (int, optional) – Minimum size of trail sections when breaking it up to measure persistence. The default is 100.
min_persistence_snr (float, optional) – Minimum required signal-to-noise ratio of a chunk of trail in order to have a persistence score of 1. The default is 3.
- Returns:
properties – Same as the original table but with new columns:
mean trail flux
trail width
trail SNR
trail persistence
trail status (see
acstools.utils_findsat_mrt.TrailFinder.mask_include_status
)
- Return type: