question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing rise and set events in rising_and_settings?

See original GitHub issue

Hello, I post here what I posted also on StackExcange, since this could be me doing something wrong, but it could be a bug as well.

To compute the Andromeda Galaxy Risings and Settings I essentially use this code (in a more colplex code, but this serves the purpose):

from skyfield import api, almanac
from skyfield.api import N,S,E,W, wgs84, load, Star

ts = api.load.timescale()
eph = api.load('de421.bsp')
t0 = ts.utc(2021, 11, 1)
t1 = ts.utc(2021, 11, 13)

#The object
andromeda = Star(ra_hours=(00, 42, 44.330), dec_degrees=(41, 16, 7.50), parallax_mas=6.0, radial_km_per_s=-300, names=("Andromeda"))

#The Location
location = api.wgs84.latlon(46.1927800 * N, 9.0170300 * E, elevation_m=200 )

rise_set = almanac.risings_and_settings(eph, andromeda, location)
riseset_time, isrise = almanac.find_discrete(t0, t1, rise_set)
for riseset_time_u, isrise_u in zip(riseset_time, isrise):
    print(riseset_time_u.utc_iso(), 'Rise' if isrise_u else 'Set')

I do optain this results

2021-11-04T07:51:31Z Set
2021-11-04T10:33:33Z Rise
2021-11-05T07:47:35Z Set
2021-11-05T10:29:37Z Rise
2021-11-06T07:43:39Z Set
2021-11-06T10:25:41Z Rise
2021-11-07T07:39:43Z Set
2021-11-07T10:21:45Z Rise
2021-11-08T07:35:47Z Set
2021-11-08T10:17:49Z Rise
2021-11-09T07:31:51Z Set
2021-11-09T10:13:53Z Rise

Now the problem is that t0 is set on November the 1st, but the rises_and_settings function does not return any result before Novembr 4th.

P.S Transits seem to be correct, though

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
davidmikolascommented, Nov 15, 2021

Just some thoughts, without appreciation of other problems it may cause:

If step_days were an explicit argument of risings_and_settings() like horizon_degrees and radius_degree then readers of the documentation (or those using help()) would know this was there and the default was 0.25. Right now it’s a hidden assumption.

The curse of writing such an amazing package is that we assume everything is “right” and “perfect” if not explicitly warned otherwise 😃

0reactions
edosecommented, Mar 26, 2022

I believe this can be solved by: (1) finding the times of altitude extrema, (2) returning None or empty list if all altitudes are above or all are below the user’s horizon altitude, else (3, normal case) inserting those extrema times to the list of window edges then letting find_discrete() continue as normally.

If one relies on smaller step size alone, one will always miss some extrema. The way not to miss extrema is first to find extrema, for example, by finding changes in (sign of d(altitude)/d(time)), which is quite a smooth function, even for solar system bodies. Altitude extrema found, one cannot then miss risings and settings, however close together they are, or however polar the latitude.

Read more comments on GitHub >

github_iconTop Results From Across the Web

An Experiential Marketing Agency: Rise & Set
Rise & Set Agency is an insights-driven, ideas-led event and experiential marketing agency. We build meaningful connections for our clients.
Read more >
Solar Fire User Guide - Astrolabe
Solar Fire includes natal, progressed, directed, solar, lunar and any planet or asteroid return, composite, harmonic, lunar phase, rise/set and prenatal charts, ...
Read more >
Style of the Oration - Brill
did not simply reproduce the set of characteristics that scholars have iden- ... range far; a moon which month-beginnings cause to rise, and...
Read more >
RISE & SET | New York NY - Facebook
RISE & SET, New York, New York. 784 likes · 2 were here. RISE & SET IS A LUXURY LIFESTYLE MARKETING AGENCY CREATING...
Read more >
RISE & SET : Experiential Marketing - LinkedIn
We're a handpicked, multi-disciplinary and culturally diverse team of storytellers, artists, designers, event producers, fabricators, publicists and brand ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found