radio-astro-tools / radio-beam

A simple toolkit for reading and manipulating beams from astrophysical radio spectral data cubes.
https://radio-beam.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
26 stars 21 forks source link

Simplify finding the common beam of any 2 Beam objects #102

Closed e-koch closed 3 years ago

e-koch commented 3 years ago

Addresses #97 and is an updated version initially started in #100.

This PR adds a more general Beam.commonbeam_between and find_commonbeam_between functions that accepts 2 Beams to find the common beam between them. The previous version common_2beams exists and still only accepts a Beams object.

The expected usage is from within Beam:

common_beam = beam1.commonbeam_with(beam2)

This should make it far easier to compare beams from 2 different spectral-line cubes or 2D images and find the common beam that both can be convolved to to match the resolution.

codecov-commenter commented 3 years ago

Codecov Report

Merging #102 (5b3cfff) into master (39b9a6a) will increase coverage by 0.13%. The diff coverage is 91.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #102      +/-   ##
==========================================
+ Coverage   85.91%   86.04%   +0.13%     
==========================================
  Files          12       12              
  Lines        1335     1362      +27     
==========================================
+ Hits         1147     1172      +25     
- Misses        188      190       +2     
Impacted Files Coverage Δ
radio_beam/commonbeam.py 70.79% <81.81%> (+0.20%) :arrow_up:
radio_beam/tests/test_beams.py 98.93% <91.66%> (-0.33%) :arrow_down:
radio_beam/beam.py 84.88% <100.00%> (+0.17%) :arrow_up:
radio_beam/tests/test_beam.py 96.52% <100.00%> (+0.14%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 39b9a6a...5b3cfff. Read the comment docs.