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 Solar Eclipses to Astronomical calculations #2218

Merged
merged 16 commits into from
Jan 30, 2022
Merged

Add Solar Eclipses to Astronomical calculations #2218

merged 16 commits into from
Jan 30, 2022

Conversation

worachate001
Copy link
Member

@worachate001 worachate001 commented Jan 29, 2022

Description

This PR will fix issue #407 by adding the method to search for all solar eclipses during user-input timespan.

The calculations are divided into two tabs.

First tab for generic information of all solar eclipses:

  • Date and time of greatest eclipse
  • Saros
  • Type of eclipses
  • Gamma
  • Magnitude at greatest eclipse
  • Geographic coordinates of greatest eclipse
  • Altitude of the Sun at greatest eclipse
  • Path Width of umbra/antumbra
  • Central duration of totality/annularity
  • Double click the event will go to the location and time of greatest eclipse (need help to handle it properly when location changed -- already fixed, thanks to @alex-w)

Second tab for information of solar eclipses visible at current location

  • Date of eclipse
  • Time of each contacts and maximum eclipse
  • Magnitude of maximum eclipse
  • Duration of totality/annularity if the eclipse is total/annular
  • Double click the event will go to the time of maximum eclipse

Notes:

  • I'm still testing the tool with many situations to search for possible bug.
  • Lunar eclipse calculations are also improved by removing unnecessary steps.

Screenshots (if appropriate):

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 29, 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

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.

Thanks for adding new features!

I see problem: in the tab "All Solar Eclipses" after double click the info about location is not changes - this is wrong!

@alex-w alex-w added this to the 0.22.0 milestone Jan 29, 2022
@alex-w alex-w added the feature Entirely new feature label Jan 29, 2022
@worachate001
Copy link
Member Author

Thanks for adding new features!

I see problem: in the tab "All Solar Eclipses" after double click the info about location is not changes - this is wrong!

Yes, I need your help about that. The location changed, but not the info.

@alex-w
Copy link
Member

alex-w commented Jan 29, 2022

Yes, I need your help about that. The location changed, but not the info.

In AstroCalcDialog::selectCurrentSolarEclipse:

StelLocation loc = core->getCurrentLocation();
loc.latitude = lat;
loc.longitude = lon;
loc.altitude = 10; // 10 meters above sea level
loc.name = ""; // Or some good name
core->moveObserverTo(loc, 0.);

if (objectMgr->findAndSelect(name)) // "name" has English only name

Calling core->getCurrentLocation(); is not needed, but define the location of course need

@alex-w
Copy link
Member

alex-w commented Jan 29, 2022

I guess the first column (Date and Time) should be in UTC for tab "All Solar Eclipses". @gzotti?

@gzotti
Copy link
Member

gzotti commented Jan 29, 2022

I am in a workshop and cannot look at it closely. My natural feeling is it should be user time zone. But I don't see the GUI context now. Can answer in 6 hours.

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

alex-w commented Jan 29, 2022

I am in a workshop and cannot look at it closely. My natural feeling is it should be user time zone. But I don't see the GUI context now. Can answer in 6 hours.

So, it should be as is - thanks!

@alex-w
Copy link
Member

alex-w commented Jan 29, 2022

I have question for “Altitude” column - probably this data calculated due it presented on NASA eclipses website - why it rounded to whole?

@worachate001
Copy link
Member Author

I have question for “Altitude” column - probably this data calculated due it presented on NASA eclipses website - why it rounded to whole?

It's altitude with no refraction, so they are not very accurate. Altitude is useful because you will know that the Sun is high or low above the horizon during the eclipse.

@alex-w
Copy link
Member

alex-w commented Jan 29, 2022

I'm afraid that in selectCurrentSolarEclipse there should be something like:

StelLocation loc;
loc.latitude = lat;
loc.longitude = lon;
loc.altitude = 10; // 10 meters above sea level
loc.name = q_(“Greatest eclipse’s point”);
loc.planetName = "Earth”;
loc.ianaTimeZone = “LMST”;
core->moveObserverTo(loc, 0.);

@worachate001
Copy link
Member Author

I will note that in some dates, especially annular eclipse with short duration, you can see that there is a little difference between position of the Moon and Sun at the place of greatest eclipse. I'm still looking for the reason behind it (maybe about the Besselian elements).

@alex-w
Copy link
Member

alex-w commented Jan 29, 2022

Maybe column “Saros Number” should be identical for all subtabs and just “Saros”?

@worachate001
Copy link
Member Author

Maybe column “Saros Number” should be identical for all subtabs and just “Saros”?

I agree, thinking about that too.

@alex-w
Copy link
Member

alex-w commented Jan 29, 2022

Please add translatable tooltips for data in columns

@worachate001
Copy link
Member Author

Please add translatable tooltips for data in columns

Thank you for suggestion, I'm adding some of them

@alex-w
Copy link
Member

alex-w commented Jan 29, 2022

Maybe synchronize dates in the input fields for Solar eclipses will good idea, e.g. if user changes the startup date for tab "All Solar Eclipses", then set it as a startup date in the tab "Local Solar Eclipses" also?

@gzotti?

@gzotti
Copy link
Member

gzotti commented Jan 29, 2022

Great addition, thank you! However, I really want to also have good documentation of our sources. Presumably you did not invent the way of computing from scratch, right? Did you use some algorithm that is available in the literature? Please follow usual standards, at least author, book title, publisher and year. And ISBN/DOI or URL for a modern source where available.

src/gui/AstroCalcDialog.cpp Outdated Show resolved Hide resolved
src/gui/AstroCalcDialog.cpp Outdated Show resolved Hide resolved
src/gui/AstroCalcDialog.cpp Outdated Show resolved Hide resolved
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.

Thanks!

@alex-w alex-w merged commit 7ab6d82 into Stellarium:master Jan 30, 2022
@worachate001 worachate001 deleted the SolarEclipseCalc branch January 30, 2022 08:10
@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Entirely new feature
Development

Successfully merging this pull request may close these issues.

3 participants