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

Should frames and coordinates have a distance atttribute? #11114

Open
mhvk opened this issue Dec 1, 2020 · 2 comments
Open

Should frames and coordinates have a distance atttribute? #11114

mhvk opened this issue Dec 1, 2020 · 2 comments

Comments

@mhvk
Copy link
Contributor

mhvk commented Dec 1, 2020

Right now, they only have it if their representation is spherical, but it would seem generally useful.

A side benefit would be that this new property could guarantee a Distance instance, thus removing the need to explicitly set anything with units of length in SphericalRepresentation to a distance.

@astrojuanlu
Copy link
Member

If I understand correctly, you suggest moving the validation of Distance from SphericalRepresentation to BaseCoordinateFrame and SkyCoord somehow?

@mhvk
Copy link
Contributor Author

mhvk commented Dec 1, 2020

Even now the only real validation it does is checking values are not negative, so I'm not sure how much we lose there.

My proposal was mostly for the output side: right now, you can easily do frame.distance.kpc and having a distance property would mean this remains true even if the underlying SphericalRepresentation has a Quantity for the distance.

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

No branches or pull requests

2 participants