Question Regarding Measurement Builder: AngularAzElBuilder

Hello Orekit Community!

I’ve been playing around with measurements.generation methods recently. I’ve generated measurements using PVBuilder and compared my syntetically generated PV with TLE generated PV. And results are quite nice.

Then I used similar logic and methods to create AngularAzElBuilder (and AngularRaDecBuilder). However the results are somewhat odd, however I adjust my parameters, syntetic AzEl data deviates from TLE generated AzEl data significantly, which indicates an error in my implementation.

Here is the code snipped I’ve been using to generate AzEl data:

sigma          = 1e-5                                                # Standart deviation
azElError      = [sigma, sigma]                                          
azElBaseWeight = [1.0, 1.0]

covariance     = MatrixUtils.createRealDiagonalMatrix([sigma**2,     # Covariance matrix
                                                       sigma**2, 
                                                       sigma**2, 
                                                       sigma**2, 
                                                       sigma**2, 
                                                       sigma**2])

# Create random correlated vector
random_vector = CorrelatedRandomVectorGenerator(covariance, 1.0e-10, 
                                                GaussianRandomGenerator(MersenneTwister()))

# Make the generator
generator   = Generator()  
obs_sat   = ObservableSatellite(0)
generator.addPropagator(propagator)
azelBuilder = AngularAzElBuilder(random_vector, ground_station, azElError, azElBaseWeight, obs_sat)
generator.addScheduler(ContinuousScheduler(azelBuilder, FixedStepSelector(dt, TimeScalesFactory.getUTC())))           

# Measurement data is generated
measurement_data = generator.generate(date_start, date_end)      

AZEL_generated_eci_df = pd.DataFrame()

for measurements in measurement_data:
    castedMeasurements = AngularAzEl.cast_(measurements)      # Casting measurements into Az-El

    AZEL_generated_eci_df = pd.concat([AZEL_generated_eci_df, orekitAZEL2dataframe(castedMeasurements, castedMeasurements.getDate())])

AZEL_generated_eci_df.reset_index(drop=True, inplace=True)
print('\033[1m'+'AZEL_generated_eci_df '+'\033[0m')
print(AZEL_generated_eci_df.to_string())

Then I have the following to generate AzEl from the TLE:

AZEL_tle_eci_df = pd.DataFrame()

date_current = AZEL_generated_eci_df['DateTimeUTC'][0]
propagator.propagate(date_current)

while date_current.compareTo(date_end) <= 0: 
    datetime_current = absolutedate_to_datetime(date_current)   
    
    PV_tle_eci = propagator.getPVCoordinates(date_current, ECI)
    pos = PV_tle_eci.getPosition()
    
    az, el, r = cartesian_to_azel(pos.getX(), pos.getY(), pos.getZ())
    az = radians(az)
    el = radians(el)
    azel = AngularAzEl(ground_station, date_current, [az, el], azElError, azElBaseWeight, obs_sat)
    
    AZEL_tle_eci_df = pd.concat([AZEL_tle_eci_df, orekitAZEL2dataframe(azel, datetime_current)])
    
    date_current = date_current.shiftedBy(dt)

    
AZEL_tle_eci_df.reset_index(drop=True, inplace=True)
print('\033[1m'+'AZEL_tle_eci_df '+'\033[0m')
display(AZEL_tle_eci_df) 

I am also using a definition which transforms PV to AzEl. I am attaching the code to the topic (sorry if code is a bit messy :slight_smile: )

Notice once again that the procedure I implement here is almost same with the one I use in PVBuilder. Should I use something different or am I missing something?

Any discussion is very well appreciated :blush:

Have a great day!

Kind regards,
Baris

AZ-EL_Measurement_Generation.ipynb (4.0 MB)

Hi @Echulion,

From what I understand of your code, with the TLE you convert the propagated position directly into AzEl angles, so these angles are defined in your ECI inertial frame, whereas the angles generated with the AngularAzElBuilder are expressed in the topocentric frame of the measuring station, which must make a big difference!

The problem doesn’t arise with generated PVs, which are expressed in the propagator frame of reference.

1 Like

Hello @pascal.parraud

Thank you for your suggestion. I’ve give it a thought and coded it. Currently my code converts the generated Ra-Dec angles from topocentric frame to ECI frame. Yet results did not improve, there is still a big difference.

I am sharing the code in case someone wants to take a look at it and give some feedback. I don’t know where might be the problem.

RA-DEC_Measurement_Generation.ipynb (4.0 MB)

:thinking: