Skip to content

add SkyCoord.position_angle and associated test - #2487

Merged
astrofrog merged 4 commits into
astropy:masterfrom
eteq:add-position-angle
May 15, 2014
Merged

astrofrog merged 4 commits into
astropy:masterfrom
eteq:add-position-angle

Conversation

@eteq

@eteq eteq commented May 14, 2014

Copy link
Copy Markdown
Member

This closes #2311 by adding a position_angle method to SkyCoord.

This is pretty straightforward, and #2311 was delayed to await #2422 , but this is still a new feature. So it depends on how strict we want to consider "feature freeze" for deciding if this is 0.4 vs 1.0 . Of course I'm biased as the author, so I'll leave it to @astrofrog to decide.

cc @richardgmcmahon @cdeil

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does assert = work for this case? I would think assert_allclose would be better to compare floats?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

unfortunately, assert_allclose is a bit awkward to use because it compares the values directly, which is wrong here because the resulting PA is in radians, not degrees. Of course there's ways around this, but they look a bit more awkward... And this passed fine for me locally. If the tests pass on all python versions, I think it's probably safe here, but if not I'll change it to use assert_allclose with the appropriate .to calls

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems to work on travis-ci and also passes on my Mac.
But assert == for floats is still a gamble and it's unlikely that this passes for others that have e.g. a 32 bit machine or an Intel compiler (they trade some precision at the EPS level in trigonometric functions in favour of speed) or ... I'd bet that I can make this fail somewhere if I try a few machines / compilers. :-)

@cdeil

cdeil commented May 14, 2014

Copy link
Copy Markdown
Member

Thanks for implementing this, @eteq .
👍

@eteq

eteq commented May 14, 2014

Copy link
Copy Markdown
Member Author

Alright, the commit I just pushed up I think should address all of @cdeil's comments.

@cdeil

cdeil commented May 14, 2014

Copy link
Copy Markdown
Member

Yes, all my comments have been addressed. I'd say this is ready for final review by someone else and a simple addition, so could still go in 0.4.

@eteq eteq added this to the v0.4.0 milestone May 15, 2014
@eteq

eteq commented May 15, 2014

Copy link
Copy Markdown
Member Author

Alright, I tentatively labeled it 0.4, but I'll leave it to @astrofrog to make the final call.

@astrofrog

Copy link
Copy Markdown
Member

Looks good to me!

astrofrog added a commit that referenced this pull request May 15, 2014
add SkyCoord.position_angle and associated test
@astrofrog
astrofrog merged commit 26c33f0 into astropy:master May 15, 2014
@eteq
eteq deleted the add-position-angle branch July 11, 2014 20:23
ktchrn pushed a commit to ktchrn/astropy that referenced this pull request Oct 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

position angle or bearing calculation

4 participants