pythonvelocityastropyskyfield

Satellite velocity from km/s to arcsec


I can't change the current satellite velocity from km/s units to arcsec units. This is a snippet of my code:

from astropy import units as u


def check_the_satellites_current_velocity(self, available_satellites):
    satellites_velocity = {}
    for satellite in available_satellites:
        self.choose_satellite_by_name(satellite)
        pos = (self.satellite - self.bluffton).at(self.t)
        _, _, the_range, _, _, range_rate = pos.frame_latlon_and_rates(self.bluffton)
        # satellites_velocity[satellite] = array2string(range_rate.km_per_s, precision=2)
        satellites_velocity[satellite] = array2string(range_rate.to(u.arcsec), precision=5)
    return satellites_velocity

The commented line works fine. I have the value in km/s. But I can't convert to arcsec units. I think my import is wrong. I have tried on few ways and no results.

There is a skyfield documentation: https://rhodesmill.org/skyfield/api-units.html

When I run this code I have error:

astropy.units.core.UnitConversionError: 'AU / d' (speed/velocity) and 'arcsec' (angle) are not convertible

How I can get the satellite velocity in arcsec units?


Solution

  • The method you're using frame_latlon_and_rates already returns latitudinal and longitudinal angular velocities which you're ignoring.