-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from LCOGT/feature/no_reclassify
Only reclassify if we haven't seen the target before.
- Loading branch information
Showing
5 changed files
with
126 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from banzai_nres.dbs import cos_great_circle_distance | ||
from astropy.coordinates import SkyCoord | ||
from astropy import units | ||
import numpy as np | ||
|
||
|
||
def test_gc_distance(): | ||
ra1, dec1 = 150.0, 25.0 | ||
ra2, dec2 = 100.0, 10.0 | ||
coord1 = SkyCoord(ra1, dec1, unit=(units.deg, units.deg)) | ||
coord2 = SkyCoord(ra2, dec2, unit=(units.deg, units.deg)) | ||
expected = np.cos(np.deg2rad(coord1.separation(coord2).deg)) | ||
|
||
actual = cos_great_circle_distance(np.sin(np.deg2rad(ra1)), np.cos(np.deg2rad(ra1)), | ||
np.sin(np.deg2rad(dec1)), np.cos(np.deg2rad(dec1)), | ||
np.sin(np.deg2rad(ra2)), np.cos(np.deg2rad(ra2)), | ||
np.sin(np.deg2rad(dec2)), np.cos(np.deg2rad(dec2))) | ||
np.testing.assert_allclose(actual, expected) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters