diff --git a/pyobs/modules/telescope/basetelescope.py b/pyobs/modules/telescope/basetelescope.py index 36834325..125a91d7 100644 --- a/pyobs/modules/telescope/basetelescope.py +++ b/pyobs/modules/telescope/basetelescope.py @@ -310,12 +310,10 @@ async def _update_celestial_headers(self) -> None: "SUNDIST": (None if sun_dist is None else float(sun_dist.degree), "Solar Distance from Target"), } - def _get_derotator_offset_from_header(self, hdr, obstime): - lat, lon, height = hdr["LATITUDE"][0], hdr["LONGITUD"][0], hdr["HEIGHT"][0] - location = EarthLocation(lat=lat * u.deg, lon=lon * u.deg, height=height * u.m) - target = SkyCoord(ra=hdr["TEL-RA"][0] * u.deg, dec=hdr["TEL-DEC"][0] * u.deg, frame="gcrs") - parallactic = Observer(location=location).parallactic_angle(time=obstime, target=target).deg - return float(parallactic - hdr["TEL-ALT"][0] - hdr["TEL-ROT"][0]) + def _calculate_derotator_position(self, ra: float, dec: float, alt: float, obstime: Time) -> float: + target = SkyCoord(ra=ra * u.deg, dec=dec * u.deg, frame="gcrs") + parallactic = self.observer.parallactic_angle(time=obstime, target=target).deg + return float(parallactic - alt) __all__ = ["BaseTelescope"]