Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions skyfield/starlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ def _observe_from_bcrs(self, observer):
if len(position.shape) > 1:
if len(observer.xyz.au.shape) > 1:
vector = position - observer.xyz.au
vel = (observer.velocity.au_per_d.T - velocity).T
vel = (velocity - observer.velocity.au_per_d.T).T
else:
vector = (position.T - observer.xyz.au).T
vel = (observer.velocity.au_per_d - velocity.T).T
vel = (velocity.T - observer.velocity.au_per_d).T
else:
vector = position - observer.xyz.au
vel = (observer.velocity.au_per_d.T - velocity).T
vel = (velocity - observer.velocity.au_per_d.T).T
distance = length_of(vector)
light_time = distance / C_AUDAY
if len(position.shape) > 1 and not t.shape:
Expand Down
12 changes: 12 additions & 0 deletions skyfield/tests/test_stars.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
from skyfield import api
from skyfield.data.hipparcos import load_dataframe
from skyfield.framelib import ICRS

def test_astrometric_velocity():
ts = api.load.timescale()
for zero, jd in ((0.0, api.T0),
(0.0, [api.T0, api.T0 + 1.0]),
([0.0, 0.0], api.T0)):
star = api.Star(ra_hours=zero, dec_degrees=zero,
ra_mas_per_year=1000.0, parallax_mas=1000.0)
a = api.SSB.at(ts.tdb_jd(jd)).observe(star)
ra_rate = a.frame_latlon_and_rates(ICRS)[4]
assert (abs(ra_rate.mas.per_day - 1000.0 / 365.25) < 1e-9).all()

def test_dataframe():
with api.load.open('hip_main.dat.gz') as f:
Expand Down
Loading