Skip to content

Commit dd21255

Browse files
committed
Bugfix RA column unit in sbpy-ephem CLI script.
1 parent f716f24 commit dd21255

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sbpy/data/ephem/cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,14 @@ def miriade(self) -> Ephem:
297297
return eph
298298

299299
def _format_eph(self, eph: Ephem) -> Ephem:
300-
# convert RA and Dec to Angle in units of degree
301-
eph["ra"] = Angle(eph["ra"], eph["ra"].unit).to("deg")
300+
# convert RA and Dec to Angle
301+
eph["ra"] = Angle(eph["ra"], eph["ra"].unit).to(
302+
"hourangle" if self.args.radec == "hmsdms" else "deg"
303+
)
302304
eph["dec"] = Angle(eph["dec"], eph["dec"].unit).to("deg")
303305

304306
if self.args.radec == "hmsdms":
305-
eph["ra"].info.format = lambda x: x.to_string(
306-
sep=":", precision=2, unit="hourangle"
307-
)
307+
eph["ra"].info.format = lambda x: x.to_string(sep=":", precision=2)
308308
eph["dec"].info.format = lambda x: x.to_string(sep=":", precision=1)
309309
else:
310310
eph["ra"].info.format = lambda x: x.to_string(

0 commit comments

Comments
 (0)