Skip to content

Commit

Permalink
fixing import lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
havok2063 committed Jun 21, 2024
1 parent 9804b68 commit 522551d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions python/marvin/tools/mixins/aperture.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@


try:
from photutils import aperture
import photutils.aperture as pap
except ImportError:
aperture = None
pap = None


__all__ = ['GetApertureMixIn', 'MarvinAperture']


class MarvinAperture(aperture.Aperture if aperture.Aperture else object):
class MarvinAperture(pap.Aperture if pap.Aperture else object):
"""Extends `photutils.aperture.Aperture` allowing to extract spaxels in the aperture.
This class is not intended for general use and it is dynamically set as
Expand Down Expand Up @@ -57,7 +57,7 @@ def mask(self):

assert self.parent is not None, 'no parent set'

if isinstance(self, aperture.SkyAperture):
if isinstance(self, pap.SkyAperture):
aperture = self.to_pixel(self.parent.wcs)
else:
aperture = self
Expand Down Expand Up @@ -198,7 +198,7 @@ def getAperture(self, coords, aperture_params, aperture_type='circular',
"""

if aperture is None:
if pap is None:
raise ImportError('this feature requires photutils. Install it by '
'doing pip install photutils.')

Expand All @@ -215,19 +215,19 @@ def getAperture(self, coords, aperture_params, aperture_type='circular',

if aperture_type == 'circular':
if coord_type == 'pixel':
ApertureClass = aperture.CircularAperture
ApertureClass = pap.CircularAperture
else:
ApertureClass = aperture.SkyCircularAperture
ApertureClass = pap.SkyCircularAperture
elif aperture_type == 'elliptical':
if coord_type == 'pixel':
ApertureClass = aperture.EllipticalAperture
ApertureClass = pap.EllipticalAperture
else:
ApertureClass = aperture.SkyEllipticalAperture
ApertureClass = pap.SkyEllipticalAperture
elif aperture_type == 'rectangular':
if coord_type == 'pixel':
ApertureClass = aperture.RectangularAperture
ApertureClass = pap.RectangularAperture
else:
ApertureClass = aperture.SkyRectangularAperture
ApertureClass = pap.SkyRectangularAperture
else:
raise ValueError('invalid aperture_type')

Expand Down

0 comments on commit 522551d

Please sign in to comment.