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:
filenamestr

FITS image filename.

extint, str, or tuple

Extension for science data, as accepted by astropy.io.fits.

trail_coordsndarray

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

sublenint, optional

Length of strip to use as the fitting window for the trail.

subwidthint, optional

Width of box to fit trail on.

orderint, optional

The order of the spline interpolation for image rotation. See skimage.transform.rotate().

sigmafloat, 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.

padint, optional

Amount of extra padding in pixels to give the satellite mask.

plotbool, optional

Plot the result.

verbosebool, optional

Print extra information to the terminal, mostly for debugging.

Returns:
maskndarray

Boolean array marking the satellite trail with True.

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.