Skip to content

Commit

Permalink
Round up telescope header values
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jul 14, 2023
1 parent 1fbbff6 commit 9e76b8b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/lvmscp/delegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ async def get_telescope_info(self) -> dict:
if km_cmd.status.did_fail:
self.command.warning(f"Failed getting {telescope} k-mirror status.")
else:
km_position = km_cmd.replies.get("Position")
km_position = numpy.round(km_cmd.replies.get("Position"), 2)

foc_cmd = await self.command.send_command(
f"lvm.{telescope}.foc",
Expand All @@ -352,7 +352,7 @@ async def get_telescope_info(self) -> dict:
if foc_cmd.status.did_fail:
self.command.warning(f"Failed getting {telescope} focus status.")
else:
foc_position = foc_cmd.replies.get("Position")
foc_position = numpy.round(foc_cmd.replies.get("Position"), 2)

for key in keys:
if key == "km" and telescope == "spec":
Expand All @@ -366,17 +366,19 @@ async def get_telescope_info(self) -> dict:
ra_h: float = pwi_status.get("ra_j2000_hours", -999.0)
if ra_h > 0:
ra_h *= 15.0
ra_h = numpy.round(ra_h, 6)
data[f"{telescope}ra"] = (ra_h, "Telescope pointing RA [deg]")
elif key == "dec":
dec = pwi_status.get("dec_j2000_degs", -999.0)
dec = numpy.round(dec, 6)
data[f"{telescope}dec"] = (dec, "Telescope pointing Dec [deg]")
elif key == "airm":
alt = pwi_status.get("altitude_degs", None)
comment = "Telescope airmass"
if alt is None:
data[f"{telescope}airm"] = (-999.0, comment)
else:
airm = 1 / numpy.cos(numpy.radians(90 - alt))
airm = numpy.round(1 / numpy.cos(numpy.radians(90 - alt)), 3)
data[f"{telescope}airm"] = (airm, comment)

return data

0 comments on commit 9e76b8b

Please sign in to comment.