23 __all__ = [
"Exposure"]
29 from ..slicing
import supportSlicing
30 from ..disableArithmetic
import disableImageArithmetic
31 from ..image.fitsIoWithOptions
import imageReadFitsWithOptions, exposureWriteFitsWithOptions
32 from .exposure
import ExposureI, ExposureF, ExposureD, ExposureU, ExposureL
37 def _set(self, index, value, origin):
38 """Set the pixel at the given index to a triple (value, mask, variance).
42 index : `geom.Point2I`
43 Position of the pixel to assign to.
45 A tuple of (value, mask, variance) scalars.
46 origin : `ImageOrigin`
47 Coordinate system of ``index`` (`PARENT` or `LOCAL`).
49 self.maskedImage._set(index, value=value, origin=origin)
51 def _get(self, index, origin):
52 """Return a triple (value, mask, variance) at the given index.
56 index : `geom.Point2I`
57 Position of the pixel to assign to.
58 origin : `ImageOrigin`
59 Coordinate system of ``index`` (`PARENT` or `LOCAL`).
61 return self.maskedImage._get(index, origin=origin)
68 return ExposureF(self, deep=
True)
71 return ExposureD(self, deep=
True)
74 return self.maskedImage.image
77 self.maskedImage.image = image
79 image = property(getImage, setImage)
82 return self.maskedImage.mask
85 self.maskedImage.mask = mask
87 mask = property(getMask, setMask)
90 return self.maskedImage.variance
93 self.maskedImage.variance = variance
95 variance = property(getVariance, setVariance)
97 readFitsWithOptions = classmethod(imageReadFitsWithOptions)
99 writeFitsWithOptions = exposureWriteFitsWithOptions
102 Exposure.register(np.int32, ExposureI)
103 Exposure.register(np.float32, ExposureF)
104 Exposure.register(np.float64, ExposureD)
105 Exposure.register(np.uint16, ExposureU)
106 Exposure.register(np.uint64, ExposureL)
107 Exposure.alias(
"I", ExposureI)
108 Exposure.alias(
"F", ExposureF)
109 Exposure.alias(
"D", ExposureD)
110 Exposure.alias(
"U", ExposureU)
111 Exposure.alias(
"L", ExposureL)
113 for cls
in set(Exposure.values()):