Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
israelmcmc opened this issue May 9, 2024 · 0 comments

Comments

@israelmcmc
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant