Skip to content

Commit

Permalink
Revert "Initalize CircularAperture from coma equivalent radius."
Browse files Browse the repository at this point in the history
This reverts commit cbb0156.
  • Loading branch information
mkelley committed Jan 17, 2024
1 parent cbb0156 commit 6596232
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 35 deletions.
6 changes: 1 addition & 5 deletions docs/sbpy/activity/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Introduction
Apertures
---------

Four photometric aperture classes are defined, primarily for use with cometary comae:
Four photometric apertures are defined:

* `~sbpy.activity.CircularAperture`: a circle,
* `~sbpy.activity.AnnularAperture`: an annulus,
Expand Down Expand Up @@ -48,10 +48,6 @@ Ideal comae (constant production rate, free-expansion, infinite lifetime) have *
>>> sba.CircularAperture(ap.coma_equivalent_radius()) # doctest: +FLOAT_CMP
<CircularAperture: radius 1669.4204086589311 km>

Through the ``coma_equivalent_radius()`` method, all apertures may be used to initialize a ``CircularAperture`` instance using the :func:`~sbpy.activity.CircularAperture.from_coma_equivalent` method:

>>> sba.CircularAperture.from_coma_equivalent(ap)
<CircularAperture: radius 1669.4204086589311 km>

Reference/API
-------------
Expand Down
19 changes: 0 additions & 19 deletions sbpy/activity/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,25 +134,6 @@ def coma_equivalent_radius(self):
return self.radius
coma_equivalent_radius.__doc__ = Aperture.coma_equivalent_radius.__doc__

@classmethod
def from_coma_equivalent(cls, aperture):
"""Initialize based on coma equivalent radius.
Parameters
----------
aperture : `Aperture` or `~sbpy.units.Quantity`
Another aperture or a radius.
"""

if isinstance(aperture, Aperture):
radius = aperture.coma_equivalent_radius()
else:
radius = u.Quantity(aperture)

return cls(radius)


class AnnularAperture(Aperture):
"""Annular aperture projected at the distance of the target.
Expand Down
11 changes: 0 additions & 11 deletions sbpy/activity/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,6 @@ def test_as_angle(self):
angle = r.to('arcsec', sbu.projected_size(eph))
assert np.isclose(aper.as_angle(eph).dim.value, angle.value)

def test_from_coma_equivalent(self):
# test initialization from another aperture
shape = [1, 2] * u.arcsec
an_aper = AnnularAperture(shape)
circ_aper = CircularAperture.from_coma_equivalent(an_aper)
assert circ_aper.dim == 1 * u.arcsec

# test initialization from a radius
circ_aper = CircularAperture.from_coma_equivalent(1 * u.arcsec)
assert circ_aper.dim == 1 * u.arcsec


class TestAnnularAperture:
def test_str(self):
Expand Down

0 comments on commit 6596232

Please sign in to comment.