make_mask

acstools.satdet.make_mask(filename, ext, trail_coords, sublen=75, subwidth=200, order=3, sigma=4, pad=10, plot=False, verbose=False)

Create DQ mask for an image for a given satellite trail. This mask can be added to existing DQ data using acstools.utils_findsat_mrt.update_dq().

Note

Unlike detsat(), multiprocessing is not available for this function.

Parameters:
  • filename (str) – FITS image filename.

  • ext (int, str, or tuple) – Extension for science data, as accepted by astropy.io.fits.

  • trail_coords (ndarray) – One of the trails returned by detsat(). This must be in the format of [[x0, y0], [x1, y1]].

  • sublen (int, optional) – Length of strip to use as the fitting window for the trail.

  • subwidth (int, optional) – Width of box to fit trail on.

  • order (int, optional) – The order of the spline interpolation for image rotation. See skimage.transform.rotate().

  • sigma (float, optional) – Sigma of the satellite trail for detection. If points are a given sigma above the background in the subregion then it is marked as a satellite. This may need to be lowered for resolved trails.

  • pad (int, optional) – Amount of extra padding in pixels to give the satellite mask.

  • plot (bool, optional) – Plot the result.

  • verbose (bool, optional) – Print extra information to the terminal, mostly for debugging.

Returns:

mask – Boolean array marking the satellite trail with True.

Return type:

ndarray

Raises:
  • ImportError – Missing scipy or skimage>=0.11 packages.

  • IndexError – Invalid subarray indices.

  • ValueError – Image has no positive values, trail subarray too small, or trail profile not found.