-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import numpy as np | ||
from astroplan import Observer | ||
import astropy.units as u | ||
|
||
from pyobs.modules.telescope import DummyTelescope | ||
from pyobs.utils.time import Time | ||
|
||
|
||
def test_get_derotator_offset_from_header(): | ||
def test_calculate_derotator_position(): | ||
telescope = DummyTelescope() | ||
telescope.observer = Observer(latitude=-32.375823 * u.deg, longitude=20.8108079 * u.deg, elevation=1798.0 * u.m) | ||
obstime = Time("2024-03-21T20:11:52.281735") | ||
hdr = { | ||
"LATITUDE": (-32.375823, None), | ||
"LONGITUD": (20.810807999999998, None), | ||
"HEIGHT": (1798.0000000004793, None), | ||
"TEL-RA": (138.01290730636728, None), | ||
"TEL-DEC": (-64.86351112618202, None), | ||
"TEL-ROT": (-138.68173828124998, None), | ||
"TEL-ALT": (57.24036032917521, None), | ||
} | ||
np.testing.assert_almost_equal(telescope._get_derotator_offset_from_header(hdr, obstime), 90.22, decimal=2) | ||
ra = 138.01290730636728 | ||
dec = -64.86351112618202 | ||
tel_rot = -138.68173828124998 | ||
alt = 57.24036032917521 | ||
derot = telescope._calculate_derotator_position(ra, dec, alt, obstime) | ||
np.testing.assert_almost_equal(derot - tel_rot, 90.22, decimal=2) |