Skip to content

Commit

Permalink
use np isclose in coordinate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
morcuended committed Jan 30, 2022
1 parent c13bd7f commit f705cbd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions osa/nightsummary/tests/test_source_coordinates.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import numpy as np
from astropy.coordinates import SkyCoord
from astropy.table import Table

Expand All @@ -23,7 +24,7 @@ def test_source_coordinates(run_catalog):

# Check new coordinates
crab_coords = SkyCoord.from_name('Crab')
assert table[table['source_name'] == 'Crab']['source_ra'] == crab_coords.ra.deg
assert table[table['source_name'] == 'Crab']['source_dec'] == crab_coords.dec.deg
assert table[table['source_name'] == 'MadeUpSource']['source_ra'] == 31.22
assert table[table['source_name'] == 'MadeUpSource']['source_dec'] == 52.95
assert np.isclose(table[table['source_name'] == 'Crab']['source_ra'], crab_coords.ra.deg)
assert np.isclose(table[table['source_name'] == 'Crab']['source_dec'], crab_coords.dec.deg)
assert np.isclose(table[table['source_name'] == 'MadeUpSource']['source_ra'], 31.22)
assert np.isclose(table[table['source_name'] == 'MadeUpSource']['source_dec'], 52.95)

0 comments on commit f705cbd

Please sign in to comment.