Skip to content

Commit

Permalink
special case: if trying to deconvolve own beam from self, just return…
Browse files Browse the repository at this point in the history
… point
  • Loading branch information
keflavich committed May 25, 2024
1 parent df2db3c commit 71450a4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions radio_beam/beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,15 @@ def deconvolve(self, other, failure_returns_pointlike=False):
failure_returns_pointlike
"""

new_major, new_minor, new_pa = deconvolve_optimized(self.to_header_keywords(),
other.to_header_keywords(),
failure_returns_pointlike=failure_returns_pointlike)
if self == other:
# if you're deconvolving the beam from itself, we shouldn't go
# through the deconvolution process; 'failure_returns_pointlike'
# would return this if set, but we shouldn't give that option in this case
new_major, new_minor, new_pa = 0., 0., 0.
else:
new_major, new_minor, new_pa = deconvolve_optimized(self.to_header_keywords(),
other.to_header_keywords(),
failure_returns_pointlike=failure_returns_pointlike)

# Keep the units from before
new_major = (new_major * u.deg).to(self.major.unit)
Expand Down

0 comments on commit 71450a4

Please sign in to comment.