Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

Two rises in the same day. Calculation


izubiaurre

Recommended Posts

Hi,

I have a curious case that calculating some random astro rising and setting times, I was getting erroneus results that for certain day (only one in the whole year) this astro wasn't rising despite I know that was otherwise. After some debug with the results for every single day of the year calculating rising times, I realized that this wrong result was caused by the fact of having two rising times in the same day. The first one at 0:01 and the second one must be at 23:57 (I'm calculating 23:57 value following the results of the next days and previous days). 

I'm following the Astronomical Algorithms from Jean Meeus book formulas for calculations. I think that the algorithms from the book are not prepared for these cases.

¿Do you know any way to solve this problem?

Thank you in advance

Link to comment
Share on other sites

When I did this, the library I used had  next_rising and next_setting functions. It was just a case of stepping through those.
Although how you handle the case of two in one day is down to your design. Personally I worked on the basis of "nights" rather than 24 hour days.

Link to comment
Share on other sites

2 minutes ago, pete_l said:

When I did this, the library I used had  next_rising and next_setting functions. It was just a case of stepping through those.
Although how you handle the case of two in one day is down to your design. Personally I worked on the basis of "nights" rather than 24 hour days.

Which library was that? I'm currently using AAplus for C#, but astro rising/setting functions are mine and I'm gettting nuts trying to find a solution fot this case.

I'm getting these results:

 

Quote

 visible (UTC): 2019 Apr 17 00:17
 visible (UTC): 2019 Apr 18 00:13
 visible (UTC): 2019 Apr 19 00:09
 visible (UTC): 2019 Apr 20 00:05

NO visible : 2019 Apr 21

 visible (UTC): 2019 Apr 22 23:53
 visible (UTC): 2019 Apr 23 23:49
 visible (UTC): 2019 Apr 24 23:45

And this NO visible at 2019 Apr 21 is caused by the two risings in the same day
1st : 0:01
2nd: 23:57

The first one is before the nighttime of Apr 21th, so I'm calculating for the next day that gives 23:53, BUT the gap between Apr 21 0:01 and Apr 22 23:53 is more than 24h, my functions is returning wrong result. Maybe I should try to look this direction, if the gap between the results are bigger than 24h, treat as a special case.

 

Link to comment
Share on other sites

Sometimes speaking and taking a little breath helps to get the results, even if they're not the expected ones.

 

Quote

visible (UTC): 2019 Apr 19 00:09
visible (UTC): 2019 Apr 20 00:05
visible (UTC): 2019 Apr 21 00:01
visible (UTC): 2019 Apr 21 23:57
visible (UTC): 2019 Apr 22 23:53
visible (UTC): 2019 Apr 23 23:49
visible (UTC): 2019 Apr 24 23:45
visible (UTC): 2019 Apr 25 23:42


Thanks for everything. Now I have to test more deeply if this is a correct result by chance or if the algorithm is correct for every case.

Link to comment
Share on other sites

2 hours ago, izubiaurre said:

Sometimes speaking and taking a little breath helps to get the results

This is what is often known in software development as "rubber ducking".  The idea being that merely explaining the problem to someone else leads you to see the solution yourself.  As such, you don't really need the other person to be there.  You might as well explain the problem to a rubber duck :)

James

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.