detsat

acstools.satdet.detsat(searchpattern, chips=[1, 4], n_processes=4, sigma=2.0, low_thresh=0.1, h_thresh=0.5, small_edge=60, line_len=200, line_gap=75, percentile=(4.5, 93.0), buf=200, plot=False, verbose=True)

Find satellite trails in the given images and extensions. The trails are calculated using Probabilistic Hough Transform.

Note

The trail endpoints found here are crude approximations. Use make_mask() to create the actual DQ mask for the trail(s) of interest.

Parameters:
searchpatternstr

Search pattern for input FITS images, as accepted by glob.glob().

chipslist

List of extensions for science data, as accepted by astropy.io.fits. The default values of [1, 4] are tailored for ACS/WFC.

n_processesint

Number of processes for multiprocessing, which is only useful if you are processing a lot of images or extensions. If 1 is given, no multiprocessing is done.

sigmafloat, optional

The size of a Gaussian filter to use before edge detection. The default is 2, which is good for almost all images.

low_threshfloat, optional

The lower threshold for hysteresis linking of edge pieces. This should be between 0 and 1, and less than h_thresh.

h_threshfloat, optional

The upper threshold for hysteresis linking of edge pieces. This should be between 0 and 1, and greater than low_thresh.

small_edgeint, optional

Size of perimeter of small objects to remove in edge image. This significantly reduces noise before doing Hough Transform. If it is set too high, you will remove the edge of the satellite you are trying to find.

line_lenint, optional

Minimum line length for Probabilistic Hough Transform to fit.

line_gapint, optional

The largest gap in points allowed for the Probabilistic Hough Transform.

percentiletuple of float, optional

The percent boundaries to scale the image to before creating edge image.

bufint, optional

How close to the edge of the image the satellite trail has to be to be considered a trail.

plotbool, optional

Make plots of edge image, Hough space transformation, and rescaled image. This is only applicable if n_processes=1.

verbosebool, optional

Print extra information to the terminal, mostly for debugging. In multiprocessing mode, info from individual process is not printed.

Returns:
resultsdict

Dictionary mapping (filename, ext) to an array of endpoints of line segments in the format of [[x0, y0], [x1, y1]] (if found) or an empty array (if not). These are the segments that have been identified as making up part of a satellite trail.

errorsdict

Dictionary mapping (filename, ext) to the error message explaining why processing failed.

Raises:
ImportError

Missing scipy or skimage>=0.11 packages.