Closed mworion closed 3 years ago
I switched from 1.36 to 1.37. And I could reproduce this situation just by switching the skyfield version.
from skyfield.api import Topos, load
from skyfield import almanac
location = Topos(longitude_degrees=11,
latitude_degrees=47,
elevation_m=500)
ephemeris = load('tests/testData/de421.bsp')
ts = load.timescale(builtin=True)
t0 = ts.tt_jd(2459360)
t1 = ts.tt_jd(2459360 + 30)
f = almanac.dark_twilight_day(ephemeris, location)
times, events = almanac.find_discrete(t0, t1, f)
with open('compare1.36.txt', 'w+') as f:
for t, e in zip(times, events):
f.writelines(f'{t.tt:10.4f}, {e}\n')
I see in a diff that th "night" section so event 0 is in 1.36 and misses in 1.37. So to correct it's not oscillating, but missing event. I wrote the content in a file and made a diff. Michel
Thanks very much for the example script! I've tried it out and done some checking. Try this in your script and let me know if it has an effect:
f.step_days = 0.04
Yes, this sorts it out in my app. Many thanks ! Plot is again OK with 1.37. Added this in my code. Michel
For anyone reading this later: the fix went out in Skyfield 1.38.
@brandon-rhodes Since I moved to 1.37 I observed a change in my app when calculating the twilight data from:
to:
I calculate the data with
f = almanac.dark_twilight_day(self.app.ephemeris, location)
When looking to the data I see oscillating value for event codes (second row):