Skip to content

orbit.to_galpy_orbit method may produce incorrect tangential velocity direction due to sign convention difference in cylindrical coordinates #592

Description

@JianguoHe

Hi,

I encountered a potential issue when using the to_galpy_orbit method to convert a gala orbit to a galpy orbit.

In gala, the cylindrical coordinate system follows a right‑handed convention:
(R, phi, z) with vT = R * dphi/dt (positive in the direction of increasing phi).

In galpy, on the other hand, the cylindrical system appears to be left‑handed (or uses an opposite sign convention for the tangential velocity).

When I convert an orbit using the built‑in method, the resulting tangential velocity component (vT) in galpy has the opposite sign compared to what I expect. Explicitly multiplying the gala tangential velocity by -1 before passing it to the galpy constructor yields the correct orbital behaviour.

I believe the to_galpy_orbit method should automatically apply the necessary sign flip to vT to account for the difference in coordinate handedness between the two packages.

Thank you for maintaining gala!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions