Initialize CircularAperture from other apertures #393
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
Afrho
andEfrho
classes can take aQuantity
or anAperture
as an input for the photometric aperture radius, and they will convert it to a coma equivalent radius, as needed. While writing new code for PR #376, I needed to repeat that same Quantity/Aperture conversion code, and also repeat tests for each case. This seemed like an opportunity for an enhancement that could simplify the code.Each of the
Aperture
classes can be converted to an effective circular aperture based on the assumption of a 1/rho coma. This PR enables any of theAperture
classes to directly initialize aCircularAperture
object using that coma equivalent aperture conversion:Or, a radius may be given as a
Quantity
, in which case the "coma equivalent" radius is the same value:With this change, the
Afrho
,Efrho
, and any similar code that needs the effective aperture radius for a 1/rho coma can pass their input parameters toCircularAperture
without the need to test forQuantity
vs.Aperture
input, and the developers do not need to be concerned with the conversions for testing coverage: