Skip to content

SkyCoord using frames not in the transform graph #5882

@mhvk

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

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