Skip to content

Convert coordinates to multiple spacecraft frames (different attitude) #1

@israelmcmc

Description

@israelmcmc

While you can convert and array of coordinates based on a single attitude:

c = SkyCoord(l = [45,50]*u.deg, b = [45,10]*u.deg, frame = "galactic")

xp_with_frame = SkyCoord(l=0*u.deg, b=0*u.deg, frame='galactic')
yp_with_frame = SkyCoord(l=90*u.deg, b=0*u.deg, frame='galactic')

attitude = Attitude.from_axes(x=xp_with_frame, y=yp_with_frame, frame = 'galactic')

c.transform_to(SpacecraftFrame(attitude = attitude))

If the attitude is also an array it will fail:

c = SkyCoord(l = 45*u.deg, b = 45*u.deg, frame = "galactic")

xp_with_frame = SkyCoord(l=[0,10]*u.deg, b=[0,0]*u.deg, frame='galactic')
yp_with_frame = SkyCoord(l=[90,100]*u.deg, b=[0,0]*u.deg, frame='galactic')

attitude = Attitude.from_axes(x=xp_with_frame, y=yp_with_frame, frame = 'galactic')

c.transform_to(SpacecraftFrame(attitude = attitude))

This kind of conversion will be very common, by I wonder how to handle it with astropy. transform_to converts to a single frame, which is defined by an attitude (in order to make the conversion possible). I guess it should convert to an attitude-less SC frame?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions