I am having some trouble trying to get an example of generating Ra/Dec measurement pairs working. I am using Orekit 13.0 from the python wrapper. I get the following error when executing the last line of the code:
InvalidArgsError: (<class ‘org.orekit.estimation.measurements.generation.AngularRaDecBuilder’>, ‘build’, (<AbsoluteDate: 2024-05-20T17:00:00.000Z>, <SpacecraftState: SpacecraftState{orbit=Cartesian parameters: {P(7000000.0, 0.0, 0.0), V(0.0, 7000.0, 1000.0)}, attitude=org.orekit.attitudes.Attitude@411c6d44, mass=1000.0, additional={}, additionalDot={}}>))
My code is below. Any pointers on what I am doing wrong would be appreciated. Thanks
import orekit
from orekit.pyhelpers import setup_orekit_curdir
import math
from org.orekit.frames import FramesFactory
from org.hipparchus.linear import Array2DRowRealMatrix
from org.orekit.time import TimeScalesFactory, AbsoluteDate
from org.orekit.estimation.measurements.generation import AngularRaDecBuilder
from org.hipparchus.random import CorrelatedRandomVectorGenerator
from org.hipparchus.random import GaussianRandomGenerator, MersenneTwister
import org.orekit.propagation as propagation
from org.orekit.estimation.measurements import ObservableSatellite, GroundStation
import org.orekit.utils as utils
import org.hipparchus.geometry.euclidean.threed as threed
import org.orekit.orbits as orbits
from org.orekit.utils import IERSConventions, Constants
from org.orekit.bodies import OneAxisEllipsoid, GeodeticPoint
from org.orekit.frames import TopocentricFrame
orekit.initVM()
f=r"C:\Users\gcastle\orekit-data"
setup_orekit_curdir(filename=f)
frame = FramesFactory.getEME2000()
#----------------------------------------------------------------
Define ground station within reference frame
#----------------------------------------------------------------
earth = OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS,
Constants.WGS84_EARTH_FLATTENING,
FramesFactory.getITRF(IERSConventions.IERS_2010, True))
longitude = math.radians(149.069793)
latitude = math.radians(-31.27344)
altitude = 1115.0
station_position = GeodeticPoint(latitude, longitude, altitude)
station_frame = TopocentricFrame(earth, station_position, “Esrange”)
ground_station = GroundStation(station_frame)
ground_station.getClockOffsetDriver().setSelected(True)
ground_station.getClockOffsetDriver().setValue(0.0)
ground_station.getClockDriftDriver().setSelected(True)
ground_station.getClockDriftDriver().setValue(0.0)
observable_satellite = ObservableSatellite(0) # instantiate a satellite
#-----------------------------------------------------------------------------
Define some covariance and random numbers for Ra/Dec measurement generation
#-----------------------------------------------------------------------------
covarianceRaDec = Array2DRowRealMatrix(2, 2)
for i in range(2):
covarianceRaDec.setEntry(i, i, 1.0**2)
sigmaRaDec = [1.e-5,1.e-5]
baseWeight = [1.0,1.0]
random_generator = GaussianRandomGenerator(MersenneTwister())
convergence_threshold = 1e-10
crvg = CorrelatedRandomVectorGenerator(covarianceRaDec, convergence_threshold, random_generator)
#-----------------------------------------------------------------------------
Set up inputs to simulate a Ra/Dec pair at a specific time
#-----------------------------------------------------------------------------
gcrf = FramesFactory.getGCRF()
absDate = AbsoluteDate(“2024-05-20T17:00:00.0”, TimeScalesFactory.getUTC())
pva = utils.TimeStampedPVCoordinates(absDate,
threed.Vector3D([float(7000000), float(0), float(0)]),
threed.Vector3D([float(0), float(7000), float(1000)]),
threed.Vector3D([float(0), float(-8), float(0)]))
state = propagation.SpacecraftState(orbits.CartesianOrbit(pva, gcrf, absDate, Constants.WGS84_EARTH_MU));
radecbuilder = AngularRaDecBuilder(crvg, ground_station, frame,
sigmaRaDec, baseWeight, observable_satellite)
measurement = radecbuilder.build(absDate,state)