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.


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

  • searchpattern (str) – Search pattern for input FITS images, as accepted by glob.glob().

  • chips (list) – List of extensions for science data, as accepted by The default values of [1, 4] are tailored for ACS/WFC.

  • n_processes (int) – 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.

  • sigma (float, optional) – The size of a Gaussian filter to use before edge detection. The default is 2, which is good for almost all images.

  • low_thresh (float, optional) – The lower threshold for hysteresis linking of edge pieces. This should be between 0 and 1, and less than h_thresh.

  • h_thresh (float, optional) – The upper threshold for hysteresis linking of edge pieces. This should be between 0 and 1, and greater than low_thresh.

  • small_edge (int, 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_len (int, optional) – Minimum line length for Probabilistic Hough Transform to fit.

  • line_gap (int, optional) – The largest gap in points allowed for the Probabilistic Hough Transform.

  • percentile (tuple of float, optional) – The percent boundaries to scale the image to before creating edge image.

  • buf (int, optional) – How close to the edge of the image the satellite trail has to be to be considered a trail.

  • plot (bool, optional) – Make plots of edge image, Hough space transformation, and rescaled image. This is only applicable if n_processes=1.

  • verbose (bool, optional) – Print extra information to the terminal, mostly for debugging. In multiprocessing mode, info from individual process is not printed.


  • results (dict) – 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.

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


ImportError – Missing scipy or skimage>=0.11 packages.