Skip to content

Commit

Permalink
changed method to return optimal derotator position for given position
Browse files Browse the repository at this point in the history
  • Loading branch information
thusser committed Apr 12, 2024
1 parent 82af7e4 commit 37ca5c1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pyobs/modules/telescope/basetelescope.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit 37ca5c1

Please sign in to comment.