Skip to content

Commit 7b1d048

Browse files
committed
Pixel area must be positive
1 parent 67be391 commit 7b1d048

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

scopesim/optics/optical_train.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ def prepare_source(self, source):
358358
# ..todo: lower needed because "DEG" is not understood, this is ugly
359359
pixarea = (header["CDELT1"] * u.Unit(header["CUNIT1"].lower()) *
360360
header["CDELT2"] * u.Unit(header["CUNIT2"].lower())).to(u.arcsec**2)
361+
pixarea = np.abs(pixarea) # CDELTi can be negative, pixarea cannot
361362
data = data / pixarea.value # cube is per arcsec2
362363

363364
data = (data * factor).value

0 commit comments

Comments
 (0)