Bug 211772 - Moon rise and set information wrong
Summary: Moon rise and set information wrong
Status: RESOLVED FIXED
Alias: None
Product: kstars
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Prakash
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-25 13:34 UTC by David Houlden
Modified: 2015-01-27 17:18 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Whats Up Tonight showing moon rise and set times (75.34 KB, image/png)
2010-06-17 20:58 UTC, David Houlden
Details
Object details showing different set time (45.54 KB, image/png)
2010-06-17 20:59 UTC, David Houlden
Details
Another screenshot of Whats Up Tonight (74.14 KB, image/png)
2010-06-18 21:36 UTC, David Houlden
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Houlden 2009-10-25 13:34:42 UTC
Version:           1.5.3 (using KDE 4.3.2)
OS:                Linux

In "What's Up Tonight" I am seeing the following on today 25th Oct 2009.
Moon rises at: 13:14 on Sunday 25 Oct 2009
Moon sets at: 22:08 on Monday 26 Oct 2009

In the object details window for the moon I see
Rise time 13:39
Set time: 23:19

The rise time should be 13:39 for my location and the set time 22:08. This is confirmed by observing the sky map where I see the moon rise when the time is 13:39 and set at 22:08.

Summary:
Moon rise time incorrect in What's Up Tonight.
Moon set day and date incorrect in What's Up Tonight. (Should be Sunday 25th in above example).
Moon set time incorrect in object details window.
Comment 1 Alexey Khudiakov 2010-06-17 20:02:50 UTC
Is there mistake in your bug report? It seems that rise/set time in details dialog are correct but than you state that it's not.
Comment 2 Alexey Khudiakov 2010-06-17 20:21:31 UTC
Rise/set time is consistent in detail dialog and what's up tonight in 4.4.4 and trunk. I didn't tried to use 4.3 though.

Could anyone reproduce the bug?
Comment 3 David Houlden 2010-06-17 20:58:50 UTC
Created attachment 48084 [details]
Whats Up Tonight showing moon rise and set times
Comment 4 David Houlden 2010-06-17 20:59:53 UTC
Created attachment 48085 [details]
Object details showing different set time
Comment 5 David Houlden 2010-06-17 21:05:01 UTC
I have also moved on to 4.4.4 since reporting this. However, the set times are still inconsistent. I've attached a couple of screen shots to show the problem. One shows a set time of 12:13 am while the other shows 00:29.
Comment 6 David Houlden 2010-06-18 21:36:54 UTC
Created attachment 48118 [details]
Another screenshot of Whats Up Tonight

Here is a screenshot showing another problem I see today in What's Up Tonight. The moon rise time is shown as 11:19 am on Friday 18 June. The moon set time is 11:30 pm on Saturday 19 June. That means the moon is above the horizon for over 36 hours without setting which is not correct.
Comment 7 Prakash 2010-06-18 21:40:36 UTC
I fixed this in trunk yesterday. BTW, was the other problem due to the moon set time of the next day being shown instead?
Comment 8 David Houlden 2010-06-19 14:56:32 UTC
(In reply to comment #7)
> I fixed this in trunk yesterday. BTW, was the other problem due to the moon set
> time of the next day being shown instead?

I have compiled kstars from trunk and am observing the following problems. 

The moon set time is still wrong in the object details window. I think you are right, it is showing the set time of the next day.

The moon set time in What's Up Tonight is now correct until I change the date to a future day. The setting time shown for a day in the future is the time for a day earlier than it should be.
Comment 9 Alexey Khudiakov 2010-06-19 15:43:40 UTC
Rise/set times are calculated in 3 places: KSPopupMenu, detail dialog and WUT dialog. Methods to account for rise on the next day are different in each place.

I think that right way to fix it is to fix to fit code in SkyObject. I have no idea how to get time for the right day.
Comment 10 Alexey Khudiakov 2010-06-19 16:24:14 UTC
This could be cause of bug #179389 as well
Comment 11 Prakash 2010-06-19 17:49:05 UTC
Its not exactly computed in WUT, its computed in KSAlmanac - which stores rise-set times of the Sun and the Moon. It by default computes the rise time of the next day, and set time in the current/next day.

The code used for computing the Rise/Transit/Set times in KSAlmanac "seems" to be doing the right thing, I tested it for different dates. (I used http://www.timeanddate.com/worldclock/moonrise.html to verify the times)

David, are you sure there's something wrong with the set time in WUT when you change the date? If yes, I think I know where the bug is.
Comment 12 Prakash 2010-06-19 17:59:16 UTC
Okay, I found the bug in Detail dialog, it just looks at the value of the times of rise and set times, and looks for set time in the next day if its value is lower. But the riseSetTime() function in SkyObject seems to take care of this by itself. So, the next day's time gets displayed instead.
Comment 13 David Houlden 2010-06-19 19:01:34 UTC
(In reply to comment #11)
> David, are you sure there's something wrong with the set time in WUT when you
> change the date? If yes, I think I know where the bug is.

Yes, it definitely looks wrong to me and I've checked against the times given by http://www.usno.navy.mil/USNO/astronomical-applications/data-services/rs-one-year-us

You can try it yourself. With WUT open, click on "Change Date" and change it to tomorrow. Moon rise time seems to be correct but the set time is wrong. Same for any date in the future.
Comment 14 Prakash 2010-06-19 19:21:09 UTC
Hmm, weird, its place dependent then. It updates fine for me though, what's the location setting that you're using?
Comment 15 David Houlden 2010-06-19 19:31:24 UTC
(In reply to comment #14)
> Hmm, weird, its place dependent then. It updates fine for me though, what's the
> location setting that you're using?

Cambridge, United Kingdom
Comment 16 Prakash 2010-06-19 19:46:10 UTC
I see, the times are offset by a day and an hour at times, or just an hour at times. Is there some DST involved here as well?
Comment 17 David Houlden 2010-06-19 20:41:45 UTC
Yes, DST is involved. You should maybe look at bug 209647. I follow the procedure described there to get the clock set right when I start kstars.
Comment 18 Alexey Khudiakov 2010-06-28 20:18:52 UTC
I'd like to point that there is definite problem in the SkyObject::riseSetTime* functions. They return QTime but time without date make little sense. One have to start guessing date and obviously he will get it wrong in some cases. Functions should return both date and time (KSDateTime). Such modification could solve some of problems at least.
Comment 19 Prakash 2010-06-28 21:05:49 UTC
Right, I was thinking of the same as well, we end up doing a lot of guesswork on the date. Will look into this soon.
Comment 20 Jasem Mutlaq 2015-01-27 17:18:28 UTC
Looks like the issue is fixed in recent KStars versions. Just verified with multiple sources and rise/transit/set times are accurate. Please reopen if you experience the issue again in the GIT version (v.2.3.0)