22 __all__ = [
"Mask",
"MaskPixel"]
27 from ._fitsIoWithOptions
import imageReadFitsWithOptions, imageWriteFitsWithOptions
28 from ._imageLib
import MaskX
29 from ._slicing
import supportSlicing
30 from ._disableArithmetic
import disableMaskArithmetic
35 class Mask(metaclass=TemplateMeta):
36 TEMPLATE_PARAMS = (
"dtype",)
37 TEMPLATE_DEFAULTS = (MaskPixel,)
44 return "{}, bbox={}, maskPlaneDict={}".format(self.array, self.getBBox(), self.getMaskPlaneDict())
47 return "{}.{}={}".format(self.__module__, self.__class__.__name__, str(self))
49 readFitsWithOptions = classmethod(imageReadFitsWithOptions)
52 """Write an Mask to FITS, with options
57 Fits file path to which to write the mask.
58 options : `lsst.daf.base.PropertySet`
59 Write options. The item ``item`` is read.
60 It must contain an `lsst.daf.base.PropertySet` with data for
61 ``lsst.afw.fits.ImageWriteOptions``.
62 item : `str`, optional
63 Item to read from the ``options`` parameter.
64 If not specified it will default to "mask" if present, else
65 will fallback to the generic "image" options.
70 item =
"mask" if "mask" in options
else "image"
74 Mask.register(MaskPixel, MaskX)
75 Mask.alias(
"X", MaskX)
def writeFitsWithOptions(self, dest, options, item=None)
def disableMaskArithmetic(cls)
def imageWriteFitsWithOptions(self, dest, options, item="image")