23 __all__ = [
"Image",
"DecoratedImage"]
28 from ..slicing
import supportSlicing
29 from .fitsIoWithOptions
import imageReadFitsWithOptions, imageWriteFitsWithOptions
30 from .image
import ImageI, ImageF, ImageD, ImageU, ImageL
31 from .image
import DecoratedImageI, DecoratedImageF, DecoratedImageD, DecoratedImageU, DecoratedImageL
34 class Image(metaclass=TemplateMeta):
41 return "{}, bbox={}".
format(self.array, self.getBBox())
44 return "{}.{}={}".
format(self.__module__, self.__class__.__name__,
str(self))
46 readFitsWithOptions = classmethod(imageReadFitsWithOptions)
48 writeFitsWithOptions = imageWriteFitsWithOptions
51 Image.register(np.int32, ImageI)
52 Image.register(np.float32, ImageF)
53 Image.register(np.float64, ImageD)
54 Image.register(np.uint16, ImageU)
55 Image.register(np.uint64, ImageL)
56 Image.alias(
"I", ImageI)
57 Image.alias(
"F", ImageF)
58 Image.alias(
"D", ImageD)
59 Image.alias(
"U", ImageU) 60 Image.alias("L", ImageL)
66 return ImageF(self, deep=
True)
69 return ImageD(self, deep=
True)
71 readFitsWithOptions = classmethod(imageReadFitsWithOptions)
73 writeFitsWithOptions = imageWriteFitsWithOptions
76 DecoratedImage.register(np.int32, DecoratedImageI)
77 DecoratedImage.register(np.float32, DecoratedImageF)
78 DecoratedImage.register(np.float64, DecoratedImageD)
79 DecoratedImage.register(np.uint16, DecoratedImageU)
80 DecoratedImage.register(np.uint64, DecoratedImageL)
81 DecoratedImage.alias(
"I", DecoratedImageI)
82 DecoratedImage.alias(
"F", DecoratedImageF)
83 DecoratedImage.alias(
"D", DecoratedImageD)
84 DecoratedImage.alias(
"U", DecoratedImageU) 85 DecoratedImage.alias("L", DecoratedImageL)
88 for cls
in set(Image.values()):
91 for cls
in set(DecoratedImage.values()):
daf::base::PropertySet * set
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)