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
11 changes: 10 additions & 1 deletion lib/astronoby/bodies/deep_sky_object_position.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,16 @@ def astrometric
private

def astrometric_position
@astrometric_position ||= if use_stellar_propagation?
@astrometric_position ||=
if @earth_geometric
barycentric_position - @earth_geometric.position
else
barycentric_position
end
end

def barycentric_position
if use_stellar_propagation?
stellar_propagation.position
else
astronomical_distance = DEFAULT_DISTANCE.meters
Expand Down
16 changes: 8 additions & 8 deletions spec/astronoby/bodies/deep_sky_object_position_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,28 +193,28 @@
apparent = dso.apparent

expect(apparent.equatorial.right_ascension.str(:hms))
.to eq("18h 37m 48.708s")
.to eq("18h 37m 48.6969s")
# Skyfield: 18h 37m 48.70s
# Astropy: 18h 37m 48.6459s
# Stellarium: 18h 37m 48.47s
# SkySafari: 18h 37m 48.28s

expect(apparent.equatorial.declination.str(:dms))
.to eq("+38° 48′ 41.4968″")
.to eq("+38° 48′ 41.4946″")
# Skyfield: +38° 48′ 41.5″
# Astropy: +38° 48′ 50.5021″
# Stellarium: +38° 48′ 42.9″
# SkySafari: +38° 48′ 16.1″

expect(apparent.ecliptic.latitude.str(:dms))
.to eq("+61° 44′ 11.4469″")
.to eq("+61° 44′ 11.4625″")
# Skyfield: +61° 44′ 11.5″
# Astropy: +61° 44′ 11.4624″
# Stellarium: +61° 44′ 13.2″
# SkySafari: +61° 43′ 47.0″

expect(apparent.ecliptic.longitude.str(:dms))
.to eq("+285° 40′ 47.2902″")
.to eq("+285° 40′ 47.0186″")
# Skyfield: +285° 40′ 47.0″
# Astropy: +285° 40′ 47.0272″
# Stellarium: +285° 40′ 41.9″
Expand Down Expand Up @@ -378,23 +378,23 @@
topocentric = dso.observed_by(observer)

expect(topocentric.equatorial.right_ascension.str(:hms))
.to eq("18h 37m 48.708s")
.to eq("18h 37m 48.6969s")
# Skyfield: 18h 37m 48.70s
# Astropy: 18h 37m 29.3159s

expect(topocentric.equatorial.declination.str(:dms))
.to eq("+38° 48′ 41.4968″")
.to eq("+38° 48′ 41.4946″")
# Skyfield: +38° 48′ 41.6″
# Astropy: +38° 48′ 41.6272″

expect(topocentric.horizontal.altitude.str(:dms))
.to eq("+26° 30′ 4.2981″")
.to eq("+26° 30′ 4.2015″")
# Skyfield: +26° 30′ 4.2″
# Astropy: +26° 30′ 4.1613″
# Stellarium: +26° 30′ 4.1″

expect(topocentric.horizontal.azimuth.str(:dms))
.to eq("+299° 35′ 16.2801″")
.to eq("+299° 35′ 16.3765″")
# Skyfield: +299° 35′ 16.6″
# Astropy: +299° 35′ 16.1035″
# Stellarium: +299° 35′ 18.7″
Expand Down
2 changes: 1 addition & 1 deletion spec/astronoby/events/rise_transit_set_calculator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@

aggregate_failures do
expect(events.rising_times.first)
.to eq Time.utc(2025, 10, 1, 1, 31, 27)
.to eq Time.utc(2025, 10, 1, 1, 31, 28)
# USNO: 2025-10-01T01:31 UTC
# Stellarium: 2025-10-01T01:31:27 UTC
# Skyfield: 2025-10-01T01:36 UTC
Expand Down