Minor fixes

This commit is contained in:
Lukas Klass 2020-05-13 16:34:52 +02:00
parent 156f6f5abf
commit 31a1a2c496

View File

@ -28,7 +28,7 @@ class PixelMask(np.ndarray):
# ndarray input arguments. This will call the standard
# ndarray constructor, but return an object of our type.
# It also triggers a call to PixelMask.__array_finalize__
obj = super(PixelMask, cls).__new__(cls, (int(pixel_geometry.value[0]), int(pixel_geometry.value[1])),
obj = super(PixelMask, cls).__new__(cls, (int(pixel_geometry.value[1]), int(pixel_geometry.value[0])),
dtype=float, buffer=None, offset=0, strides=None, order=None)
obj[:, :] = 0
# set the new attributes to the values passed
@ -91,7 +91,7 @@ class PixelMask(np.ndarray):
"""
# Calculate the center coordinates
if center_offset:
if center_offset is not None:
xc = self.pixel_geometry[1] / 2 - 0.5 * u.pix + center_offset[0]
yc = self.pixel_geometry[0] / 2 - 0.5 * u.pix + center_offset[1]
else: