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 get_star_relative_angles() function and create tests for get relative angle functions #227

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

dyahalomi
Copy link
Contributor

@dyahalomi dyahalomi commented Sep 8, 2021

I wrote code and tests as we discussed for the get_star_relative_angles() function. I couldn't find any existing tests for the get_relative_angles() function for the relative angles of the planet, so I wrote tests for that existing function as well and included it in the same test function.

One other thing I noticed is that in the get_relative_angles() function, it currently calls the "get_position()" function rather than "get_planet_position()" function. I don't think that this would make any changes if I am understanding the code correctly, but it may be better to switch this for clarity. Let me know if you would like me to submit another pull request with this change.

Hopefully this works! Thanks and let me know if I need to change anything!

@dfm
Copy link
Member

dfm commented Sep 9, 2021

Thanks Daniel! It looks like there's currently a syntax error - make sure that you can import the package and run the tests!

@dyahalomi
Copy link
Contributor Author

I am getting myself a little confused about what the star’s position angle should be relative to the planet’s position angle and wanted to make sure I am doing this correctly.

Originally, I thought the stars position angle should be identical to the planet’s position angle. This is what the code currently outputs when I change the _get_position(-self.a) call to be _get_position(-self.a_star) in defining the function, and this is one of the tests that I built into the code. However, I am no longer convinced that the star’s position angle shouldn't be 180 degrees away from the planet’s position angle. The confusing bit here is that the position angles are relative to different things...

Looking at the description of the get_relative_angles() function, it states that it will return "The separation (arcseconds) and position angle (radians, measured east of north) of the planet relative to the star.

The new function I have written, get_star_relative_angles() returns ""The separation (arcseconds) and position angle (radians, measured east of north) of the star relative to the barycentric frame.”

I am getting confused trying to think of how the planets position angle compared to the star and the stars position angle compared to the barycentric frame should relate — so wanted to make sure that I had it right.

If I am wrong, and the position angles should be separated by 180 degrees, changing the call to be _get_position(+self.a_star) in defining the new function should solve the problem.

@dfm
Copy link
Member

dfm commented Sep 13, 2021

@iancze: I feel like you'll have thoughts about this...?

@iancze
Copy link
Collaborator

iancze commented Sep 14, 2021

If we don't have them already, then I'd suggest starting with some tests guaranteeing that everything is correct in the Barycentric frame (X, Y, Z). It should be, but it would be good to ensure that this is the case for multi-planet systems.

Then, as you mentioned, the question is really relative to what? Usually, the relative angle is most useful when comparing models to data (along with a radius), since astrometric datasets are usually reported as separation and position angle of the target (e.g., planet or companion star) relative to the primary star (much easier to measure than system barycenter!), and not as Delta R.A. and Delta Dec. Of course, the relative separation between the planet and star is going to be different than relative separation between the planet and the barycenter. For most orbits, I don't think it's the case that relative angle between planet and star would be the same as relative angle between planet and barycenter.

I think this is one area where additional documentation and perhaps another orbital elements figure (e.g., #225) could help, too.

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.

None yet

3 participants