forrestguice / SuntimesCalendars

A calendar provider add-on for Suntimes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Twilight calendars are added with entries back to 1 Jan 1970

kwlg opened this issue · comments

commented

Device: OnePlus 6
Android version: 9

I have an issue where any twilight calendars have their entries added from 1 Jan 1970, i.e. the beginning of the epoch time.

Opening my calendar app on an arbitrary date shows the following:
Screenshot_20190726-005635

Screenshot_20190726-005259

All events has their start time on 1 Jan 1970 01:00 and end time when the actual sunrise or sunset takes place. Thus, the events have a duration of about 49 years.

This only seems to happen for the following three calendars:

  • Astronomical twilight
  • Nautical twilight
  • Civil twilight

The moon calendars work the way they should.

A screenshot of the settings page, with both windows set to one year:
Screenshot_20190726-010246

In summary:
Expected results

  • The twilight calendars only have two entries each per day (one for sunset and one for sunrise)

Actual results

  • The twilight calendars have some 18000 entries per day with a duration of 49 years.

yikes.. I must admit the "actual results" make me lol. Thanks for the detailed report. There are some good clues here, I'm optimistic the problem can be found. I should have some time to investigate soon.

A screenshot of the main Suntimes activity may be helpful, as well as the two version numbers at the top of the SuntimesCalendars "About". Thank you.

I think the bug appears when sunrise/sunset and other twilight times don't occur at the configured location. I'm able to reproduce it (or something very similar) by configuring Suntimes to a polar location. In this case the moonrise/moonset calendar only works by chance of location. I'm hoping a screenshot of Suntimes will show a column of "none".

I'm not sure I fully understand this yet. These erroneous events appear to end at reasonable looking twilight times. That still has me confused.

commented

Sorry, I forgot the version numbers in my previous post, which should of course always be part of a bug report. The version numbers are 0.3.1 (3fde396@1556749166280) and 0.11.7 (1).

Below is the requested screenshot:
Screenshot_20190728-000317-01

I think this is now fixed - v0.3.2 will probably be on F-Droid within the week.

It was basically untested with higher latitudes and didn't handle any of the special cases. That is an oversight on my part (Suntimes already handles those situations). Thank you for reporting the problem. It has been very helpful. :)

commented

Great, thank you, the new version seems to have solved this issue! However, I may have found another issue, which might be a side effect of the fix? Please let me know if I should create a new issue or if this is a bug at all?

If I open the sunset event of the civil twilight calendar in the calendar app, the start and end times confuse my a bit. Below is an example:
Screenshot_20190808-095157
The start time is 21:17 and the end time is 22:29. Looking at the suntimes app, the times agree with the time of sunset of the "actual" line and the time of sunrise of the "civil" line, respectively:
Screenshot_20190808-095209

If I instead open an entry of the nautical twilight calendar, I see the following times. Start: 22:29. End: 03:00 the next day.
Screenshot_20190808-095823
Looking at the suntimes app, these times agree with the time of sunset of the "civil" line today (see the screenshot from the suntimes app above) and the time of sunrise of the "civil" line tomorrow:
Screenshot_20190808-095836

Please notice that this last example is from the nautical calendar for which all times are "none" in the suntimes app.

What are the expected start and end times of the calendar entries? Is this an issue or am I just confusing myself in some way? :)

Thank you for your help!

Version numbers:
Screenshot_20190808-100706

It is confusing (I had to do a double take) but this looks right to me.

In the average case there are two sets of twilight per day, morning twilight (sunrise column), and evening twilight (sunset column). They are different though in that the morning column gives start times, while the evening column gives end times. Civil twilight starts at the time in the left column and ends at sunrise. It begins at sunset and ends at the time in the right column. BTW the "note" area to the right of the clock tries to hint at this too - the evening times are noted as "until end of", while the morning times are noted "until".

Anyhow, in the example, "Civil Twilight 21:17 to 22:29" is an evening twilight. In this case civil twilight starts at sunset (21:17), lasts about an hour, and ends at 22:29 (time given for evening civil twilight). At 22:29 civil twilight ends and evening nautical twilight begins, but there aren't any nautical twilight times given (morning or evening). What does this mean exactly.. Since the evening times are endpoints, it indicates that nautical twilight never sets (and that there is no astronomical twilight). It is nautical twilight all night long, until civil twilight rises again the next morning (2:15). Its also possible to visualize this with the "lightmap" graphic (colorful bar below the table).

This is one of a couple special cases. Suppose instead that there aren't any times gives for Civil twilight (or nautical twilight or astronomical) but sunrise/sunset times are given. I think this situation would be labeled a "white night". The sun sets but it is civil twilight all night long. Suppose there isn't a sunrise/sunset time but times are given for civil twilight. The sun never rises above the horizon and the brightest it gets is civil twilight. I think this situation would be labeled "polar twilight". And so on for "civil polar night" and "nautical polar night" (https://en.wikipedia.org/wiki/Polar_night).

I think that "blue hour" row muddies things a little, since its slightly different than the other twilights. It starts at 8 degrees and ends at 4 degrees (and vice versa), and overlaps periods of both nautical and civil twilight. The other twilight periods stack together neatly (e.g. nautical twilight begins when civil twilight ends).

I hope this clears things up a little. Trying to explain it definitely helps me organize my thoughts. Also, looking critically at these details is pretty much the only way to uncover problems. I appreciate it.