Repository navigation
Added new attributes to the frame classes for easier access to velocity data - #6869
Conversation
|
Hi there @adrn 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃. Everything looks good from my point of view! 👍 If there are any issues with this message, please report them here. |
eteq
left a comment
There was a problem hiding this comment.
Mostly good, but a few clarifications to suggest in the docs and the error messages
| always have ``.velocity``, ``.proper_motion``, and ``.radial_velocity`` | ||
| properties that provide shorthands to the full-space Cartesian velocity as | ||
| a ``CartesianDifferential``, the 2D proper motion as a ``Quantity``, and the | ||
| radial or line-of-sigh velocity as a ``Quantity``. [#6869] |
There was a problem hiding this comment.
line-of-sigh sounds like a lot of code I write regularly... But I think you meant line-of-sight.
| try: | ||
| v = self.cartesian.differentials['s'] | ||
| except Exception as e: | ||
| raise ValueError('Could not retrieve a Cartesian velocity. Your ' |
There was a problem hiding this comment.
I think this error is a bit confusing. I can have a coordinate with only PMs and no radial velocity and no distance and this will still work fine (and it should). Maybe instead "Your frame data must include velocity information for this to work"?
| def velocity(self): | ||
| """ | ||
| Shorthand for the Cartesian velocity as a `CartesianDifferential` | ||
| object. |
There was a problem hiding this comment.
Perhaps also note that it is equivalent to self.cartesian.differentials['s']? I think this is a likely route users will take to starting to understand the necessary complexity of the differential stuff.
And maybe also "velocity" -> "space motion"? but that's not a big deal either way.
|
OK I made the suggested changes and fixed the obvious test failures. |
a41ce98 to
8b17912
Compare
[ci skip]
This adds three new attributes to the frame classes to provide access to the cartesian velocity data (
frame.velocityis equivalent toframe.cartesian.data.differentials['s']), the 2D proper motion data (rather than the two components separately viaframe.pm_...,frame.pm_...), and the radial velocity.Fixes #6854