Skip to content

Commit

Permalink
Merge pull request #192 from ajrigby/astropy531
Browse files Browse the repository at this point in the history
Fix for changes between astropy 5.2.2 and 5.3.1
  • Loading branch information
astrofrog committed Aug 7, 2023
2 parents 75ec031 + 1326caf commit 9818555
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions astrodendro/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def major_sigma(self):
computed from the intensity weighted second moment in direction of
greatest elongation in the PP plane.
"""
dx = self.spatial_scale or u.pixel
dx = self.spatial_scale if self.spatial_scale is not None else u.pixel
a, b = self._sky_paxes()
# We need to multiply the second moment by two to get the major axis
# rather than the half-major axis.
Expand All @@ -335,7 +335,7 @@ def minor_sigma(self):
computed from the intensity weighted second moment perpendicular to
the major axis in the PP plane.
"""
dx = self.spatial_scale or u.pixel
dx = self.spatial_scale if self.spatial_scale is not None else u.pixel
a, b = self._sky_paxes()
# We need to multiply the second moment by two to get the minor axis
# rather than the half-minor axis.
Expand Down Expand Up @@ -484,7 +484,7 @@ def area_exact(self):
"""
The exact area of the structure on the sky.
"""
dx = self.spatial_scale or u.pixel
dx = self.spatial_scale if self.spatial_scale is not None else u.pixel
indices = zip(*tuple(self.stat.indices[i] for i in range(3) if i != self.vaxis))
return len(set(indices)) * dx ** 2

Expand Down Expand Up @@ -562,7 +562,7 @@ def area_exact(self):
"""
The exact area of the structure on the sky.
"""
dx = self.spatial_scale or u.pixel
dx = self.spatial_scale if self.spatial_scale is not None else u.pixel
return self.stat.count() * dx ** 2


Expand Down

0 comments on commit 9818555

Please sign in to comment.