Skip to content

New functions to get the masses and semimajor axes of companions accurately #56

Open
cevawm wants to merge 24 commits intokima-org:mainfrom
cevawm:comp_mass_sma_funct
Open

New functions to get the masses and semimajor axes of companions accurately #56
cevawm wants to merge 24 commits intokima-org:mainfrom
cevawm:comp_mass_sma_funct

Conversation

@cevawm
Copy link
Copy Markdown

@cevawm cevawm commented Feb 6, 2026

I have added three new functions to analysis.py, for use with posteriors from the RVHGPMmodel:

get_planet_mass_and_semimajor_axis_accurate, which runs get_planet_mass_accurate and get_planet_semimajor_axis_accurate. These latter two functions calculate the mass and semimajor axis of a companion more accurately than the original get_planet_mass and get_planet_semimajor_axis functions, since they take into account the mass of the companion itself (instead of assuming that the companion mass is negligible compared to the host star's mass), as well as the mass of any inner companions, when calculating these two orbital parameters.

I have tested/bug checked these functions, and they appear to be robust. I applied an automatic PEP 8 formatting to the analysis.py file; be warned this may have changed some of the formatting in other functions in this file.

Most importantly, I ran these new functions on the posterior results from RVHGPMmodel fits to multiple targets, and the masses and semimajor axes are now clearly well aligned with results from orvara for the same targets.

cevawm and others added 22 commits February 3, 2026 13:39
…oring this error and reverting back to previous commit
…nan results correspond to those where sini = 0)
@cevawm cevawm changed the title New functions to get the mass and semimajor axes of companions accurately New functions to get the masse and semimajor axes of companions accurately Feb 6, 2026
@cevawm cevawm changed the title New functions to get the masse and semimajor axes of companions accurately New functions to get the masses and semimajor axes of companions accurately Feb 6, 2026
@cevawm
Copy link
Copy Markdown
Author

cevawm commented Feb 6, 2026

I just realized: these functions are only correct if the posterior samples reordering function applied to the posteriors beforehand places any/all "fake" companions' samples after all real companions' samples in KimaResults.posteriors, and if all real companions' samples are ordered correctly by orbital period.

If not, then 1.) the "fake" companions' masses may be included in the calculations as part of the "total inner mass" when calculating the mass and SMA of any real companions, and/or 2.) some outer real companions may be included as part of the "total inner mass" if they are placed before inner real companions in KimaResults.posteriors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant