Skip to content

SkyCoord(frame=other.frame) doesn't copy all frame attributes #5749

@dmopalmer

Description

@dmopalmer

This may be a bug, or it may work-as-designed in which case I have a feature request.

When you have a SkyCoord, there is no interface defined to make another SkyCoord with the same frame attributes. In particular, the frame= argument copies some attributes, such as equinox, but not others, such as obstime.

co1 = SkyCoord(10, 20, unit=u.deg, frame=FK5, equinox='B1950', obstime=Time('2017-01-01T00:00'))
co2 = SkyCoord(15, 20, unit=u.deg, frame=co1.frame)

print(co1, co2,sep='\n')
print("obstime: co1:{}, co2:{}".format(co1.obstime, co2.obstime))

giving:

<SkyCoord (FK5: equinox=B1950.000): (ra, dec) in deg    ( 10.,  20.)>
<SkyCoord (FK5: equinox=B1950.000): (ra, dec) in deg    ( 15.,  20.)>
obstime: co1:2017-01-01T00:00:00.000, co2:None

So if this is a bug, then this Issue is a bug report. If this is not a bug, then I request an argument flag that tells the __init__ to copy all the frame attributes, instead of an undocumented subset of them. (This was touched upon in the discussion of #5702)

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