Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Lunar Eclipses to Astronomical calculations #2190

Merged
merged 17 commits into from Jan 23, 2022
Merged

Add Lunar Eclipses to Astronomical calculations #2190

merged 17 commits into from Jan 23, 2022

Conversation

worachate001
Copy link
Member

@worachate001 worachate001 commented Jan 19, 2022

Description

This PR partially addresses #407 by adding the method to search for lunar eclipses during user-input time span.

It shows:

  • Date of time of greatest eclipse.
  • Saros series
  • Type of eclipses
  • Penumbral and umbral magnitudes at greatest eclipse

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update

How Has This Been Tested?

Test Configuration:

  • Operating system: Ubuntu 20.04
  • Graphics Card: NVidia Geforce RTX

Checklist:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (header file)
  • I have updated the respective chapter in the Stellarium User Guide
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@github-actions
Copy link

github-actions bot commented Jan 19, 2022

Great PR! Please pay attention to the following items before merging:

Files matching src/**/*.cpp:

  • Are possibly unused includes removed?

This is an automatically generated QA checklist based on modified files

@worachate001 worachate001 marked this pull request as ready for review January 20, 2022 00:33
@alex-w alex-w added this to To do in Astronomical calculations (AstroCalc) via automation Jan 20, 2022
@alex-w
Copy link
Member

alex-w commented Jan 20, 2022

I think the main tab should be named "Eclipses" and it should contains at least 2 "inner" tabs (similar to Graphs) - "Lunar eclipses" and "Solar eclipses". Probably "Solar eclipses" subtab in future may be splitted on 2 subtabs.

@worachate001 worachate001 marked this pull request as draft January 20, 2022 09:39
@worachate001
Copy link
Member Author

I got the idea, it will take some time to add solar eclipse calculations in the second tab. I think I should make it to be draft for now.

@alex-w
Copy link
Member

alex-w commented Jan 20, 2022

I got the idea, it will take some time to add solar eclipse calculations in the second tab. I think I should make it to be draft for now.

No need implement computation of solar eclipses right now in this branch, but prepared to compute it will be good step.

@alex-w
Copy link
Member

alex-w commented Jan 20, 2022

Apparently the shortest way to preparation the support of both types of eclipses will be renaming the main tab to "Eclipses" at this step.

@alex-w
Copy link
Member

alex-w commented Jan 20, 2022

I'm checked the work of tool with Astronomical Calendars and results is very good. Thank you!

So, the cosmetic fixes:

  1. The phases data should be aligned to right side for improve readability and no need 4 digits for accuracy - 3 digits is enough (we use 1 digit after dot for percentage info about phases in infostring also)
  2. The phase cannot be negative, so, all negative values should replaced by "dash" char (QChar(0x2014))

@alex-w alex-w added the wishlist Long-term ideas label Jan 20, 2022
@alex-w alex-w added this to the 0.22.0 milestone Jan 20, 2022
@worachate001 worachate001 marked this pull request as ready for review January 20, 2022 12:39
Copy link
Member

@alex-w alex-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much!

Astronomical calculations (AstroCalc) automation moved this from To do to In progress Jan 20, 2022
@alex-w
Copy link
Member

alex-w commented Jan 20, 2022

@gzotti I think it's ready to merge

src/gui/AstroCalcDialog.cpp Outdated Show resolved Hide resolved
@alex-w
Copy link
Member

alex-w commented Jan 22, 2022

@gzotti please review the changes. I got accuracy around 1 second for my location.

@worachate001 is it possible to add a Gamma column also?

1.2.6. Gamma
The quantity gamma is the minimum distance from the center of the Moon to the axis of Earth’s umbral shadow cone, in units of Earth’s equatorial radius. This distance is positive or negative, depending on whether the Moon passes north or south of the shadow cone axis.

Source: https://eclipse.gsfc.nasa.gov/5MCLE/5MCLE-Text10.pdf

@worachate001
Copy link
Member Author

Thanks for suggestions. While waiting for the reviews, I have been preparing the solar eclipse calculations and almost finish, it would be ready in a few days.

@gzotti
Copy link
Member

gzotti commented Jan 23, 2022

Something is still weird. Please look here and compare with the list above.
grafik
What am I doing wrong? ΔT algorithm is set to default.

@alex-w
Copy link
Member

alex-w commented Jan 23, 2022

@gzotti please share your config.ini file

ΔT algorithm is set to default and ΔT = 71.96 seconds (72 seconds on the NASA website). See for Barnaul location (UTC+00:00 and UTC+07:00 respectively):

stellarium-000
stellarium-001

@gzotti
Copy link
Member

gzotti commented Jan 23, 2022

config.ini.txt
(renamed for github)

@alex-w
Copy link
Member

alex-w commented Jan 23, 2022

config.ini.txt
(renamed for github)

ΔT = 72.73 seconds with your config.ini file... WTF?!? And n-dot value is -23.8000 - why?

@Atque
Copy link
Contributor

Atque commented Jan 23, 2022

@gzotti your config says that aberration is off. Could that be the reason?

@alex-w
Copy link
Member

alex-w commented Jan 23, 2022

@gzotti your config says that aberration is off. Could that be the reason?

Yes, of course! After enabling aberration:

stellarium-000

@gzotti
Copy link
Member

gzotti commented Jan 23, 2022

@Atque, many thanks! Indeed. On one of my other tasks I had switched that off and was able to overlook it...

I also just checked with WSL. (Its default config.ini). It shows your values. So I welcome this addition, @worachate001 many thanks!

@alex-w
Copy link
Member

alex-w commented Jan 23, 2022

@worachate001 I'll merge it now and I'll add changes from my comments in the master after merge.

@alex-w alex-w merged commit 77c17fd into Stellarium:master Jan 23, 2022
Astronomical calculations (AstroCalc) automation moved this from In progress to Done Jan 23, 2022
@worachate001
Copy link
Member Author

I just woke up in the morning here, so I missed everything. Thanks for additional improvements.

@worachate001 worachate001 deleted the LunarEclipseCalc branch January 24, 2022 00:07
@alex-w alex-w added the state: fixed The bug has been fixed label Jan 24, 2022
@github-actions
Copy link

Hello @worachate001! Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@worachate001
Copy link
Member Author

I have noticed that the time of greatest eclipse magnitude is always 1-2 seconds ahead of official time for every eclipses!. So it must be systematic errors -- the Moon is a little ahead of the location where it should be.

Is it possible that this may caused by the fact that aberration is not currently applied to the Moon?

@Atque
Copy link
Contributor

Atque commented Jan 26, 2022

@worachate001 It could be that Stellarium currently does not support diurnal aberration. I have noticed that lunar occultations are also off by 1 or 2 seconds when comparing to e.g. Cartes du Ciel (which takes diurnal aberration into account).

@alex-w
Copy link
Member

alex-w commented Jan 26, 2022

Please see issue #2050

@worachate001
Copy link
Member Author

In this window, no change of coordinates for the Moon when checked and uncheck. But for the Sun and planets, they changes. Is it normal?

aberration

@gzotti
Copy link
Member

gzotti commented Jan 26, 2022

We have discussed that in summer. See #1626 . It seems that for the Moon aberration may be included in the ephemeris already.

I have modified the lunar position somewhat to reflect the difference between center of figure and center of gravity.
See EphemWrapper.cpp line 418. This explains exactly those 1-2 seconds, but should improve accuracy.

If diurnal aberration is noticeable in stellar occultations by the moon by more than 1 second or so, it may be worth considering. But it is not in my priority list.

@worachate001
Copy link
Member Author

@gzotti Thank you for explanation. Modifying the Moon's position that way is really explain the differences. I have read that Astronomical Almanac is using this method but Fred Espenak decided to ignore it in his Catalog of Lunar Eclipses.

@gzotti
Copy link
Member

gzotti commented Jan 26, 2022

Usually a difference of 2 seconds should not pose a problem in long-time eclipse canons, given uncertainties in ΔT. We would need a couple of (or rather a few thousand) securely timed (observed, not precomputed!) lunar occultations (intros and exits) to understand the limits of the current solution in Stellarium. I do not know the real figure offset between a perfect sphere and our tessellated (triangulated) polygonal Moon. See also discussion in #1959. Again, occultations are not my primary interest, but if somebody finds a solution for #1959, this would also be welcome of course. Anybody in IOTA reading this and and want to help? Of course, we have no model for the Lunar rim, so a difference with real-world conditions will likely persist. (I don't know if the (normal vector) displacement map can be interpreted and rendered in terms of real geometry to make the lunar rim appear jagged with the correct mountain silhouette. Or whether we can add a third texture with actual altitudes and let the GPU do geometrical displacement calculations (if this is at all possible in a fragment shader? Then a GPU could render highly accurate spherical primitives with displacement, even without any tessellation! But I expect overlapping results in some areas.))

@alex-w alex-w removed the state: fixed The bug has been fixed label Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wishlist Long-term ideas
Development

Successfully merging this pull request may close these issues.

None yet

4 participants