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

Modelling motions of binary star system #4095

Merged
merged 11 commits into from
Mar 3, 2025
Merged

Conversation

henrysky
Copy link
Contributor

I have added support to model motions of binary star system as seen on the sky and their 6D astrometry (RA, DEC, PMRA, PMDEC, PLX, RV).

So far I have only manually added Alpha Centauri A/B, Sirius A/B and 61 Cygni A/B. In order to model a binary system we need:

  • $e$ - Eccentricity
  • $a$ - Semi-major axis
  • $\Omega$ - Longitude of the ascending node
  • $\omega$ - Argument of periapsis
  • $i$ - Inclination
  • $P$ - Period
  • $T$ - Periastron epoch
  • Barycenter RA/DEC, PMRA/PMDEC, PLX, RV
  • Barycenter data epoch
  • HIP or Gaia ID of primary and secondary stars
  • Primary and secondary star masses

At least for Alpha Centauri A/B and Sirius A/B, the motion on the sky as well as radial velocity matched really well to past observations (https://iopscience.iop.org/article/10.3847/1538-3881/abfaff/pdf, https://arxiv.org/pdf/1703.10625).

If there are other binary systems you want to model, I can try to find all the required orbital parameters and add them manually before we figure it out a way to model a large amount of binary stars if possible.

Fixes #353

Screenshots (if appropriate):

An example of Sirius A/B with parallax disabled to avoid confusion:

Untitled.mov

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
  • Housekeeping

How Has This Been Tested?

Test Configuration:

  • Operating system: MacOS 15.2
  • Graphics Card: Apple M3

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

Copy link

github-actions bot commented Jan 23, 2025

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

Files matching src/**/*.cpp:

  • Are possibly unused includes removed?

Files matching guide/**:

  • Did you remember to update screenshots to match new updates?
  • Did you remember to grammar check in changed part of documentation?

This is an automatically generated QA checklist based on modified files.

@gzotti
Copy link
Member

gzotti commented Jan 23, 2025

Great stuff! But probably #4076 should be 100% fixed before adding this.

γ Vir is another nice double. For a catalog, this looks promising: http://www.astro.gsu.edu/wds/orb6.html

@alex-w
Copy link
Member

alex-w commented Jan 23, 2025

Great stuff! But probably #4076 should be 100% fixed before adding this.

γ Vir is another nice double. For a catalog, this looks promising: http://www.astro.gsu.edu/wds/orb6.html

Damn, I don't have access to WDS catalog anymore O_o

Yes, adding full support WDS catalog is possible now and probably it should be adding via 2 files - one file for known orbital elements of binaries (multiple systems) and one file for cross identification and informational data (likewise a currect HIP subset of WDS).

@Atque
Copy link
Contributor

Atque commented Jan 23, 2025

Great work! However, proper motions seem odd now (possibly not calculated for the barycenter of the star system). Compare 61 Cyg in 21,000 AD between this branch and master:

henrysky:binary
stellarium-315

Stellarium:master
stellarium-314

@henrysky
Copy link
Contributor Author

Great work! However, proper motions seem odd now (possibly not calculated for the barycenter of the star system). Compare 61 Cyg in 21,000 AD between this branch and master:

Thanks for noticing the inconsistency! Motion of the barycenter is taken into account already but a problem on normalized vector caused the error in position. Now I have fixed the issue and added γ Vir.

@Atque
Copy link
Contributor

Atque commented Jan 24, 2025

I see some discrepancies with 61 Cyg. Compare the HiPS layer, with the plate in question probably taken around 1990-01-01 (based on the position of 61 Cyg in master):

henrysky-binary
stellarium-317

stellarium-master
stellarium-318

Maybe weird parameters for the stellar orbits?

@alex-w alex-w added the subsystem: catalogs The issue is related to supported catalogs of planetarium... label Jan 24, 2025
@Atque
Copy link
Contributor

Atque commented Jan 27, 2025

I've seen some stars that should be modelled as double stars (I'm not sure if they have defined orbits, though). I simply based this on looking at what stars fly apart in the future or past.

  • Alula Australis - ξ UMa - HIP 55203
  • Rotanev - β Del - HIP 101769
  • Achird - η Cas - HIP 3821
  • Mesarthim - γ Ari - HIP 8832
  • Mizar - ζ UMa - HIP 65378
  • Sheliak - β Lyr - HIP 92420
  • ε1 Lyr - HIP 91919
  • ε2 Lyr - HIP 91926
  • Acamar - θ1 Eri - HIP 13847
  • β Tuc - HIP 2484
  • Achird - η Cas - HIP 3821
  • β Mus - HIP 62322
  • Acrux - α1 Cru - HIP 60718
  • Dalim - α For - HIP 14879
  • γ2 Vol - HIP 34481
  • Alya - θ1 Ser - HIP 92946
  • γ Lep - HIP 27072
  • ψ Vel - HIP 46651
  • ζ1 Aqr - HIP110960
  • ρ Oph - HIP 88601

@henrysky
Copy link
Contributor Author

henrysky commented Jan 30, 2025

Maybe weird parameters for the stellar orbits?

I have fixed the parameters so 61 Cyg should match the HiPS layer now.

I've seen some stars that should be modelled as double stars (I'm not sure if they have defined orbits, though). I simply based this on looking at what stars fly apart in the future or past.

Thanks for the list. I have processed the items till Acamar - θ1 Eri - HIP 13847, I will keep working on the remaining items. I have checked all items in the list. As far as I can see, the following binary system won't be added:

  • Alula Australis (HIP 55203) - the companion does not exist in the catalog
  • Mizar (HIP 65378) - there is no Mizar A and B orbital solution only Aa-Ab and Ba-Bb but Mizar Ab and Mizar Bb not resolved in the catalog
  • Sheliak (HIP 92420) - there is no β Lyr A and B orbital solution only Aa-Ab but β Lyr Ab not resolved in the catalog
  • Acamar (HIP 13847) - there is no orbital solution
  • β Tuc (HIP 2484) - there is no orbital solution between A and B
  • Acrux (HIP 60718) - there is no orbital solution between A and B
  • γ2 Vol (HIP 34481) - there is no orbital solution between A and B
  • Alya (HIP 92946) - there is no orbital solution between A and B
  • γ Lep (HIP 27072) - there is no orbital solution between A and B
  • ζ1 Aqr (HIP 110960) - the companion does not exist in the catalog

@Atque
Copy link
Contributor

Atque commented Jan 31, 2025

Would it be possible to visualize the orbit, just like planet orbits? And maybe even have markers on it (point of visual/actual apo-/periastron, perhaps markings for dates)?

@alex-w
Copy link
Member

alex-w commented Feb 4, 2025

This is maybe helpful:

Maybe adding some catalog of orbital data will be good solution (reading data from this catalog and use it for computations)?

@gzotti
Copy link
Member

gzotti commented Feb 27, 2025

Maybe adding some catalog of orbital data will be good solution (reading data from this catalog and use it for computations)?

Yes, definitely. Even if the list is short now, but inlining every star like that is not elegant. Of course, an extended list means suppressing their "standard" entries in the default star catalog.

@henrysky
Copy link
Contributor Author

Maybe adding some catalog of orbital data will be good solution (reading data from this catalog and use it for computations)?

Yes, definitely. Even if the list is short now, but inlining every star like that is not elegant. Of course, an extended list means suppressing their "standard" entries in the default star catalog.

I've made some progress on putting the list in a separate data file! I don't have much time tonight to test but I think the binary stars are still working properly.

@gzotti
Copy link
Member

gzotti commented Feb 28, 2025

Great. It really looks fabulous, and I hope this can still go into 25.1 if finished soon. (Needs to be done before RC1!)
The orbit plot idea is also nice but can come later.

@Atque
Copy link
Contributor

Atque commented Mar 1, 2025

With the latest commits to stellarium-master, Zeta Herculis once again has a stationary component. Same with Sabik. So if these parameters are easily found, they ought to be added. Especially Zeta Herculis looks ugly already a few thousand years from the present.

@alex-w
Copy link
Member

alex-w commented Mar 2, 2025

@alex-w There is a new level 7 catalog here: https://www.astro.utoronto.ca/~hleung/shared/stellarium_new_catalog/1march2025/. Reason: HIP 55987 has been removed from level 7 because it is already included in level 0-4 for being a star with HIP id (even tho it has vmag dimmer than 15).

OK, I've uploading new part of catalog on GH at the moment

P.S. @henrysky, I moved you into core team 2 days ago - you can push fixes and small changes direct into master and you can upload parts of catalogs direct on GH page now

@Atque
Copy link
Contributor

Atque commented Mar 2, 2025

Zeta Herculis's and Sabik's companion stars have been dealt with by adding them into the list of binary star system orbital data file.

Neat! I found Castor also has a stationary component. Other than that, I have not found any others.

@henrysky
Copy link
Contributor Author

henrysky commented Mar 3, 2025

Castor has been added and I think this PR is ready to be reviewed and merged.

There is still one problem where for example, search * 61 Cyg which points to a custom object instead of the actual star in the catalog (not a new issue but an existing issue). Fixing this by querying children/parents will fix #3181 too but I Don't have much time in the next two weeks so leave that to the future and aim merging this to 25.1

@henrysky henrysky marked this pull request as ready for review March 3, 2025 03:52
@alex-w alex-w added this to the 25.1 milestone Mar 3, 2025
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.

Great work!

@gzotti
Copy link
Member

gzotti commented Mar 3, 2025

I wonder why 61 Cyg B carries the labels like "Bessel's star". Should be either the whole system, or just the brighter component A, right?
EDIT: Yes, indeed REF8 lists A's HR and HD numbers bearing the proper names. And Ref8 should be given as reference to "Piazzi's flying star". Shall I just modify all SCs with that? And is there a way to just "find" 61 Cyg without the custom object?

@alex-w
Copy link
Member

alex-w commented Mar 3, 2025

Shall I just modify all SCs with that?

yes, IMHO

And is there a way to just "find" 61 Cyg without the custom object?

Inner dictionary for double stars

double dec = 0.;
getBinaryOrbit(epoch, v, ra, dec, plx, pmra, pmdec, rv);
}

Copy link
Member

Choose a reason for hiding this comment

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

Can you please add some literature documentation here, where you found the algorithms? Maybe Explanatory Supplement (which ed), some other book dedicated on double stars? Or did you do all the math yourself from scratch?

Copy link
Contributor Author

@henrysky henrysky Mar 3, 2025

Choose a reason for hiding this comment

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

I end up just do most of the math myself from definitions of these orbital elements. From the definitions, one can compute the 2D orbit of the secondary star in the reference frame of the primary and then rotate the 2D orbital plane to 3D orbit as seen on the sky and then apply proper motion to the barycenter of the binary star. No fancy algorithms used here.

Copy link
Member

Choose a reason for hiding this comment

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

Well, maybe not really fancy and can be done by oneself, but I had expected you followed some textbook, so congratulations.

Copy link
Contributor Author

@henrysky henrysky Mar 3, 2025

Choose a reason for hiding this comment

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

Ah ok, let me google to see if there is any good material on those. I forget which resources I use as I indeed have looked up what those orbital elements mean exactly.

Copy link
Member

@gzotti gzotti left a comment

Choose a reason for hiding this comment

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

Apart from a bibliography note which I just feel should be there and should not cost much time to add, I won't object a merge. The result just looks awesome, congratulations! When finalizing SUG changes I may edit a bit, but thanks also for these edits and additions.

@henrysky
Copy link
Contributor Author

henrysky commented Mar 3, 2025

And is there a way to just "find" 61 Cyg without the custom object?

You can use TAP query on SIMBAD to query parents/children, for example querying * 61 Cyg children: https://simbad.cds.unistra.fr/simbad/sim-tap/sync?request=doQuery&lang=adql&format=tsv&query=SELECT%20DISTINCT%20basic.main_id,%20basic.ra,%20basic.dec%20FROM%20(SELECT%20oidref%20FROM%20ident%20WHERE%20id=%27*%2061%20Cyg%27)%20AS%20name,%20basic%20JOIN%20h_link%20ON%20basic.oid%20=%20h_link.child%20WHERE%20h_link.parent%20=%20name.oidref which correspond to this query

SELECT DISTINCT basic.main_id, basic.ra, basic.dec
FROM (SELECT oidref FROM ident WHERE id='* 61 Cyg') AS name, basic 
JOIN h_link ON basic.oid = h_link.child WHERE h_link.parent = name.oidref

And parent of exoplanet KOI-4878.01 by querying https://simbad.cds.unistra.fr/simbad/sim-tap/sync?request=doQuery&lang=adql&format=tsv&query=SELECT%20DISTINCT%20basic.main_id,%20basic.ra,%20basic.dec%20FROM%20(SELECT%20oidref%20FROM%20ident%20WHERE%20id%20=%20%27KOI-4878.01%27)%20AS%20name,%20basic%20JOIN%20h_link%20ON%20basic.oid%20=%20h_link.parent%20WHERE%20h_link.child%20=%20name.oidref which correspond to this query

SELECT DISTINCT basic.main_id, basic.ra, basic.dec
FROM (SELECT oidref FROM ident WHERE id = 'KOI-4878.01') AS name, basic 
JOIN h_link ON basic.oid = h_link.parent WHERE h_link.child = name.oidref

I don't think it can be done by SIMBAD scripting. Or as Alex mentioned just do a dictionary to quickly fix known ones.

@alex-w alex-w merged commit 79f0b74 into Stellarium:master Mar 3, 2025
17 checks passed
@gzotti
Copy link
Member

gzotti commented Mar 3, 2025

I don't mean our casual users should be asked to do SQL queries. They would want to enter "61 Cyg" and expect to find what is now returned only when you know you have to search for "61 Cyg A", i.e., HIP 104214, not a custom object. @alex-w said "Inner dictionary for double stars", but that is still vague. Which file to add "61 Cyg"?

@alex-w
Copy link
Member

alex-w commented Mar 3, 2025

I don't mean our casual users should be asked to do SQL queries. They would want to enter "61 Cyg" and expect to find what is now returned only when you know you have to search for "61 Cyg A", i.e., HIP 104214, not a custom object. @alex-w said "Inner dictionary for double stars", but that is still vague. Which file to add "61 Cyg"?

This file is not exist yet. I've proposed one of solution to resolve objects like multiple stars - select first component when short form of designation is used.

@henrysky
Copy link
Contributor Author

henrysky commented Mar 3, 2025

I don't mean our casual users should be asked to do SQL queries.

I meant to say currently Stellarium is using SIMABD scripting interface to query object name (see #3980 that I improve a while ago). So if an object name is resolved and not in stellarium, it is possible that we use TAP query to check if their parent/child is in Stellarium for user (I Don't mean for user to do SQL queries themselves).

@gzotti
Copy link
Member

gzotti commented Mar 3, 2025

A working but dirty way would be to handle a handful of such commonplace star names like 61 Cyg as proper name in the current skyculture. (I think this was a year ago?)

@alex-w
Copy link
Member

alex-w commented Mar 4, 2025

A working but dirty way would be to handle a handful of such commonplace star names like 61 Cyg as proper name in the current skyculture. (I think this was a year ago?)

Why? Just editing stars/hip_gaia3/name.fab file to adding short form of designations for component A

@gzotti
Copy link
Member

gzotti commented Mar 4, 2025

OK if that works. Just you said above such "inner dictionary" file does not exist. Is it OK to assign two names ("61 Cyg" and "61 Cyg A") to one star here?

@alex-w
Copy link
Member

alex-w commented Mar 4, 2025

OK if that works. Just you said above such "inner dictionary" file does not exist. Is it OK to assign two names ("61 Cyg" and "61 Cyg A") to one star here?

It is in master already - just check it (I've added short designations for double stars today) :)

@gzotti
Copy link
Member

gzotti commented Mar 4, 2025

OK, I switched off SIMBAD lookup. But I was lazy, typing "61 cyg" is not enough. "61 Cyg" worked. maybe search should compare any capitalisation here.

@alex-w
Copy link
Member

alex-w commented Mar 4, 2025

OK, I switched off SIMBAD lookup. But I was lazy, typing "61 cyg" is not enough. "61 Cyg" worked. maybe search should compare any capitalisation here.

No. How you will resolve j Cen and J Cen for example?

@gzotti
Copy link
Member

gzotti commented Mar 4, 2025

Another find: Compare location of 61 Cyg in 2MASS HiPS. I thought that was taken around 2000? @henrysky is proper motion off? In the DSS, 61Cyg fits to 1975, when the DSS plates are from 1983-2006.
Groombridge 1830 fits to the Survey dates, also Barnard's and Kapteyn's stars, so maybe something is just off with 61 Cyg's data?

@gzotti
Copy link
Member

gzotti commented Mar 4, 2025

OK, I switched off SIMBAD lookup. But I was lazy, typing "61 cyg" is not enough. "61 Cyg" worked. maybe search should compare any capitalisation here.

No. How you will resolve j Cen and J Cen for example?

Good point. You could just offer both to choose from, though.

@alex-w alex-w added the state: published The fix has been published for testing in weekly binary package label Mar 9, 2025
Copy link

github-actions bot commented Mar 9, 2025

Hello @henrysky!

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

@alex-w alex-w removed the state: published The fix has been published for testing in weekly binary package label Mar 23, 2025
Copy link

Hello @henrysky!

Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subsystem: catalogs The issue is related to supported catalogs of planetarium...
Development

Successfully merging this pull request may close these issues.

Binary Star : Mean Proper Motions and True Motions
4 participants