You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Should frames and coordinates have a distance atttribute? #11114
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.
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.
Hmm, I had forgotten I raised this issue -- @FelipeMeiga - thanks for reviving it!. Looking at it again, I am not really sure it was a good idea in the first place -- the present system is at least consistent in just making the attributes of the representation available, and @ayshih's comment makes clear that even .distance is not that unique a name. So, let me just close the issue.
Activity
astrojuanlu commentedon Dec 1, 2020
If I understand correctly, you suggest moving the validation of
DistancefromSphericalRepresentationtoBaseCoordinateFrameandSkyCoordsomehow?mhvk commentedon 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.kpcand having adistanceproperty would mean this remains true even if the underlyingSphericalRepresentationhas aQuantityfor the distance.FelipeMeiga commentedon May 20, 2025
Hi, im new to the project and would like to contribute, can i work on this issue? Do you guys have a preferred solution to this?
ayshih commentedon May 21, 2025
I'll point out that some SunPy frames rename that spherical component to
radius. So, I wonder:.distancebe available in addition to.radius?.distancebe available or.radius?mhvk commentedon May 21, 2025
Hmm, I had forgotten I raised this issue -- @FelipeMeiga - thanks for reviving it!. Looking at it again, I am not really sure it was a good idea in the first place -- the present system is at least consistent in just making the attributes of the representation available, and @ayshih's comment makes clear that even
.distanceis not that unique a name. So, let me just close the issue.