Skip to content

SkyCoord using frames not in the transform graph #5882

Closed

Description

@mhvk

As noted by @eteq, in principle it should be possible to use SkyCoord with frames not in the transform graph, and still have access to their frame attributes, i.e., the following tests should pass:

def test_transformless_frame():
    """
    Checks the behavior of SkyCoord's with a frame that isn't in the transform
    graph
    """
    class TestFrame(BaseCoordinateFrame):
        fattr = FrameAttribute()
        default_representation = SphericalRepresentation

    tf = TestFrame(1*u.deg, 2*u.deg, fattr='sillywalks')
    sc = SkyCoord(tf)
    assert tf.fattr == sc.fattr

    sc2 = SkyCoord(3*u.deg, 4*u.deg, fattr='sillywalks2', frame=TestFrame)
    assert sc2.frame.fattr == sc2.fattr

Activity

  1. eteq commented on Mar 18, 2017

    @eteq
    Member

    (FYI, commit 3688d56 at https://github.com/eteq/astropy/tree/skycoord-attributes has the test for this, and it should be easily cherry-pick-able if desired)

  2. adrn commented on Dec 3, 2018

    @adrn
    Member

    This actually does seem to work now. Not sure where it was fixed, but...reopen if you disagree!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions