Hey!

I’m trying to use the FieldOfViewDetector and need to make a FieldOfView object. So, am trying to create a CircularFieldOfView, but am a bit confused on the constructor:

CircularFieldOfView(Vector3D center, double halfAperture, double margin)

HalfAperature and margin make sense as simply radian inputs, but I can’t seem to get center to work. What would be the easiest way to get Vector3D center through an attitude provider.

Here’s my current code:
Constants.WGS84_EARTH_FLATTENING,
ITRF)
tle = TLE(“1 44235U 19029A 20178.66667824 .02170155 00000-0 40488-1 0 9998”,
“2 44235 00.0000 163.9509 0005249 306.3756 83.0170 15.45172567 61683”)
propogator = TLEPropagator.selectExtrapolator(tle)
propogator.setAttitudeProvider(attitudeProvider)

fov = CircularFieldOfView(???,0.05,0)

fov_detector = FieldOfViewDetector(propogator, fov)

Also, I’m a bit confused how to access the spacecraft frame–do I get that frame from LocalOrbitalFrame or is it somehow imbedded in the propagator?

The field of view is fixed with respect to the spacecraft, and the spacecraft orientation is defined by the attitude.

One example would be to have a spacecraft with an attitude such that the Z axis of the spacecraft points towards the Earth, the Y axis is opposite to orbital momentum, and the X axis is therefore in the orbital plane, roughly in the velocity direction (exactly along the velocity if the orbit is perfectly circular). Then, on this spacecraft, you could have a telescope observing ground. The center of the corresponding field of view would by the spacecraft Z axis (i.e. coordinates (0, 0, 1)). This is what we call a FoV defined in spacecraft frame.

When Orekit computes visibilities through this field of view, it does combine the field of view in spacecraft frame and the attitude (which defines how the spacecraft frame is oriented with respect to the universe). This allows the FoV to be fixed wrt spacecraft (as it is really bolted to the body of the spacecraft) but rotating wrt Earth as the spacecraft moves.

So the spacecraft frame is really a conventional frame from spacecraft blueprints.

Please note that TLE propagator performs the propagation in TEME frame. Therefore maybe it could better if you use `propagator.getFrame()` instead of `FramesFactory.getEME2000()`.

Bryan

Another information, you are using a `NadirPointing` which is used for pointing to the vertical of the ground point under satellite. Therefore, when you initialize the `FieldOfView` detector you can define a `TopocentricFrame`, representing the ground station, instead of the propagator. Here a Java example on how to define a `TopocentricFrame`:

``````final GeodeticPoint point = new GeodeticPoint(FastMath.toRadians(43.2), FastMath.toRadians(1.0), 100.);
final TopocentricFrame topo = new TopocentricFrame(earth, point, "topo");
``````

Your detector can be initialized like that:

`fov_detector = FieldOfViewDetector(topo, fov)`

Hey @luc and @bcazabonne,

Thank you both so much for the help–really think orekit is a very cool open source program that a lot of universities and small sats clubs are trying to use, and this forum makes it really easy to slowly learn it. Quick followup, though on this question…

So I got my field of view detector to almost work, but it is giving the visibility of the point at the opposite side of the earth (see picture). Any advice on why it’s giving the point opposite to my ground station point? Here’s a summary of my code:

``````attitudeProvider = NadirPointing(FramesFactory.getTEME(), earth)
propogator_fov = TLEPropagator.selectExtrapolator(tle, attitudeProvider, 4.)

groundstation_frame = TopocentricFrame(earth, target, "groundstation")
fov_detector = FieldOfViewDetector(groundstation_frame, fov).withHandler(ContinueOnEvent())
``````

It’s very strange to me that the g function is negative for the orbit over the opposite side of the earth (as if it’s looking through the earth) as you can see in this picture where the ground station is at (0,180) but the detector returns times over (0,0).

Please note that when you initialize a GeodeticPoint, longitude is normalized between ±π . Furthermore, the latitude is normalized between ±π/2

Bryan

This is an well known unfortunate side effect. The `g` function is computed by looking at the line that joins the spacecraft to the target point with respect to the field of view. The target point is just a point, the detector does not really know it is on an opaque central body and it can be seen only from “above”. So yes, the detector sees through the Earth.

This unfortunate effect can easily be removed by using a boolean combination of two detectors. What you want is to have both the target point in the FoV and the spacecraft as seen from the target point above the horizon. So you can set up two raw detectors, one `FieldOfViewDetector` and one `ElevationDetector`, combine them using boolean operations which works for detectors that have a semantic of positive/negative `g` function associated with some `active/inactive` feature. You have to know the meaning of the various `g` functions to perform the proper boolean operation. The `FieldOfViewDetector` function `g` is negative when the target is visible and positive when the target is not visible. The `ElevationDetector` function `g` is positive when the spacecraft is visible (above horizon, taking into account elevation masks and refraction if you want) and negative when the spacecraft is not visible. If you want your combined detector to behave like the `ElevationDetector` (i.e. being positive when target is visible), then you should use the following combination:

``````EventDetector combined = BooleanDetector.andCombine(BooleanDetector.notCombine(fovDetector),
elevationDetector);
``````

and register this combined detector to your propagator. The combined detector will trigger an `increasing` event at visibility start and a `decreasing` event at visibility end.

As your satellite is nadir pointing, and the field of view half aperture is small, then the satellite will first raise above horizon but the target will be outside of the field of view, then as the satellite becomes closer to target it will enter field of view and at that time both conditions would be met and the visibility start will be triggered. Then the satellite will go away and as soon as the target goes outside of field of view the visibility end will be triggered despite the satellite is still above horizon. Then the satellite will go below horizon but not event will be triggered. One half orbit later, when the satellite will be on the opposite side of the Earth, the target point will enter again the field of view (the detector “sees through” the Earth), but as the second detector will not be active (satellite is below horizon at that time), then no event will be triggered.