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

DM-5159: "Please use angle and Coord where possible" #37

Merged
merged 5 commits into from Mar 11, 2017
Merged

Conversation

wmwv
Copy link
Contributor

@wmwv wmwv commented Mar 10, 2017

No description provided.

Copy link
Contributor

@r-owen r-owen left a comment

Choose a reason for hiding this comment

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

I don't see any instances of Angle, Coord or SpherePoint in this pull request. I don't see how this pull request relates to the ticket, though the changes do seem to be improvements.

# dist = np.arccos(np.sin(dec1)*np.sin(dec2) + np.cos(dec1)*np.cos(dec2)*np.cos(ra1 - ra2))

# Could use afwCoord.angularSeparation()
# but (a) that hasn't been made accessible through the Python interface
Copy link
Contributor

Choose a reason for hiding this comment

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

It is available. So is SpherePoint.separation.

# Could use afwCoord.angularSeparation()
# but (a) that hasn't been made accessible through the Python interface
# and (b) I'm not sure that it would be faster than the numpy interface.
# dist = afwCoord.angularSeparation(ra1-ra2, dec1-dec2, np.cos(dec1), np.cos(dec2))
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest timing it. That should be easy to do and you might as well know. A realistic python test would take a Coord (or SpherePoint) for the average and a list of Coord (or SpherePoint) for the list of positions (In other words, don't time how long it t takes to build the list of coords) and use a list comprehension to compute dist

@wmwv wmwv merged commit b88097e into master Mar 11, 2017
@ktlim ktlim deleted the tickets/DM-5159 branch August 25, 2018 06:50
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

2 participants