How to get angular values from measurements.generation.Generator()

Hello!! I am creating measurements using measurements.generation.Generator().

from org.orekit.estimation.measurements.generation import GatheringSubscriber
subscriber = GatheringSubscriber()

myStartDate = AbsoluteDate("2024-05-20T17:00:00.0", TimeScalesFactory.getUTC())
myEndDate   = AbsoluteDate("2024-05-20T17:20:00.0", TimeScalesFactory.getUTC())

generated = generator.generate(myStartDate, myEndDate)
meas = subscriber.getGeneratedMeasurements()

meas_list = list(meas)

When I try to output RA and DEC values I get this error:
In: meas_list[0].getObservedValue()
Out: AttributeError: ‘Object’ object has no attribute ‘getObservedValue’

How can I convert/cast Java object to AngularRaDec to avoid the error??

I would also like to know, why does not measurements generation work without subscriber??

Note that since 12.0, the Generator.generate method doesn’t return any objects anymore (the return type is void). This change was introduced when solving issue 1111.
The previous API was cumbersome when dealing with very large number of measurements, for example when using a full GNSS constellation with tens of satellites, tens or even hundreds of ground stations, numerous observables on a few different signal frequencies, at a high rate and for a long time. We can achieve millions of measurements, so gathering them all in one big list to finally spit out a few hundreds different Rinex files was not practicable.
The GatheringSubscriber was just one way to reproduce the former behaviour (i.e. building a full list), despite the API was changed to publish/subscribe.

Beware that in order to fix issue 1350, which will be published with version 13.0 and is already available in branch issue-1350, the GatheringSubscriber.getGeneratedMeasurements method will return a sorted set of EstimatedMeasurementBase<?> and not a sorted set of ObservedMeasurement<?>. You will be able to retrieve the observed measurements from the estimated meassurements.

I guess the missing getObservedValue is due to a missing cast as it considers you have an Object and not an ObservedMeasurement (if you are using a published version or the develop branch but not the issue-1350 branch).

Hi @daiana and @luc ,

As @luc said, the cast is need in python.

In current released version, v12, ObservedMeasurement.cast_(meas_list[0]).getObservedValue() or AngularRaDec.cast_(meas_list[0]).getObservedValue()