Hello everyone !
I am trying to use the EventDetector MagneticFieldDetector, to detect the frontier crossing of the south atlantic anomaly.
But, the MagneticFieldDetector does not return any events… I tested with different limit values and still nothing.
I have also no idea what to put in the limit parameter, in the documentation, it says: limit - the threshold value of magnetic field at see level, ok but what is the unit?
I just checked with this value (32000nT), and still no event detection.
Maybe I use an incorrect model WMM.COF, but I just download it from the NOAA website (2020. version). And I don’t have any error on that…
ra = 500 * 1000 # Apogee
rp = 400 * 1000 # Perigee
i = radians(87.0) # inclination
omega = radians(20.0) # perigee argument
raan = radians(10.0) # right ascension of ascending node
lv = radians(0.0) # True anomaly
epochDate = AbsoluteDate(2020, 1, 1, 0, 0, 00.000, utc)
initial_date = epochDate
a = (rp + ra + 2 * Constants.WGS84_EARTH_EQUATORIAL_RADIUS) / 2.0
e = 1.0 - (rp + Constants.WGS84_EARTH_EQUATORIAL_RADIUS) / a
## Inertial frame where the satellite is defined
inertialFrame = FramesFactory.getEME2000()
## Orbit construction as Keplerian
initialOrbit = KeplerianOrbit(a, e, i, omega, raan, lv,
PositionAngle.TRUE,
inertialFrame, epochDate, Constants.WGS84_EARTH_MU)
propagator = KeplerianPropagator(initialOrbit)
ITRF = FramesFactory.getITRF(IERSConventions.IERS_2010, True)
earth = OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS,
Constants.WGS84_EARTH_FLATTENING,
ITRF)
mag_detector = MagneticFieldDetector(60.0, 0.1, 32000.0E-9, GeoMagneticFieldFactory.FieldModel.WMM, earth, True).withHandler(ContinueOnEvent())
logger = EventsLogger()
logged_detector = logger.monitorDetector(mag_detector)
propagator.addEventDetector(logged_detector)
state = propagator.propagate(initial_date, initial_date.shiftedBy(3600.0 * 24))
print(state.getDate())
events = logger.getLoggedEvents()
print(events.size())
start_time = None
result = pd.DataFrame()
for event in logger.getLoggedEvents():
if event.isIncreasing():
start_time = event.getState().getDate()
elif start_time:
stop_time = event.getState().getDate()
result = result.append({"Start":absolutedate_to_datetime(start_time),
"Stop":absolutedate_to_datetime(stop_time),
"VisibilityDuration": stop_time.durationFrom(start_time)/60},
ignore_index=True)
start_time = None
print(result)
I think that instead of just changing the Javadoc, we should also change the unit in
order to be consistent with other choices in Orekit: i.e. to use SI units only.
This is an incompatible change (change a value by a factor 1billion), so it cannot be done before version 12.0.
Changing just the Javadoc could be done in the 11.X series, but perhaps adding a warning this unit will change.