shukob/CelestialUtil

Inaccurate results

autresphere opened this issue · 9 comments

Hi,

All values I get for moon azimuth and declination are different than those obtained from any online calculator as for instance this one http://www.heavens-above.com/moon.aspx?lat=35.6895&lng=139.6917&loc=Tokyo&alt=37&tz=JapST
I tried with Tokyo location (35.6895, 139.6917) and a GMT+0900 time Zone.

Have you ever checked this was actually working? Or maybe I misunderstand how this is supposed to be used... Thanks for any help.

Hi,

Thanks for reporting,
I also see that the result is incorrect. I will check it in this weekend.
Sorry for inconvenience.

It was the sun that is important when I wrote this, so the moon is not fully tested...

I see that it works around year 2000, but it is incorrect now(2015). So the approximation formula may require some updates. I am now investigating it.

It was the Julian year that was wrong in calculation, now fixed.

Thanks a lot! You're the best!

I am glad to here that : )

Thank you again for reporting the problem!

If you're ok, I'll create a pull request with some adaptation to allow the code to work with ARC.

By the way, I'm trying to show the exact moon position on an iPad using the gyroscope and through the camera. It seems Azimuth and Declination should allow that, but I'm still unsure on how to do that. Any opinion?

Thank you for suggestion!

I also was inconvenient about ARC today.. : )
Would you send PR if you have time?

To show the moon on iPad, you also needs elevation, which is calculated using declination, latitude and hour angle(calculated using light ascension and sidereal time). I'll add them tomorrow.

To show mark up in actual screen, field of view of the camera is required.
Horizontal one can be get using this, and vertical one may be get using this method.

Then, regards to perpendicular axis through center of screen to back, any point in screen is mapped to a coordinate(azimuth, elevation).

You can rotate the coordinate using info from gyro and from compass so that it can be compared with the azimuth, elevation of the moon to be located on the screen.

I will write actual calculation when I have time.

Elevation(altitude) can be get using elevationAtDate:inLocation.

Apparent elevation, which is corrected using atmospheric refraction and equatorial horizontal parallax, can be get using apparentElevationAtDate:inLocation