Use/goal of obstime for fixed frames is not 100% clear.
馃悶 Problem
import astropy.time
import astropy.units as u
from poliastro import frames
from poliastro import bodies
import numpy as np
obstime = astropy.time.Time.now() + astropy.time.TimeDelta(np.arange(60 * 24 * 10) * 60 * u.s)
start_time = obstime[0]
testloc = frames.fixed.MarsFixed(10 * u.deg, 20 * u.deg, distance=bodies.Mars.R, obstime=start_time)
testloc.transform_to(frames.MarsICRS)
This piece of code returns:
<MarsICRS Coordinate (obstime=J2000.000): (ra, dec, distance) in (deg, deg, AU)
(193.84796915, -4.78614788, 1.63061226)>
Which is incorrect since get_body_barycentric_posvel has been performed with testloc.obstime and the rotational elements have been evaluated at testloc.obstime as well.
馃挕 Possible solutions
Solution 1:
fixed_coo to equatorial_frame to stay consistent.Currently it makes sense to me to just overwrite the obstime of the new frame with the obstime of the FixedFrame since the transform_to method is not performing any propagation but merely transforming coordinate systems without touching the time value.
Actually, solution 1 is the correct one, even if in inertial frames the obstime does not change the coordinates it may be preserved for future calculations.
Good report @noc0lour, labeling this as a bug!
Looking at how this is handled in astropy:
I will send a PR pulling the fixed frames in line with the astropy frames.