DoubleDihedraFieldOfView Usage

Hey Guys,

I have a use case for the DoubleDihedraFieldOfView where I am given the definition of the rectangle like this:

Lower Left Az + El
Upper Left Az + El
Upper Right Az + El
Lower Right Az + El

I’ve then taken these values and computed the necessary boresite vector as well as the dihedra angles in this manner:

double boresiteAz = Math.toRadians((lowerLeftAzLimit + upperRightAzLimit) / 2.0);
double boresiteEl = Math.toRadians((lowerLeftElLimit + upperRightElLimit) / 2.0);
Vector3D boresite = azElToCartesian(boresiteAz, boresiteEl);

Vector3D azAxis = Vector3D.PLUS_I;
Vector3D elAxis = Vector3D.PLUS_J;

double azHalfAngle = boresiteAz - minAz;
double elHalfAngle = boresiteEl - minEl;

DoubleDihedraFieldOfView ddfov = new DoubleDihedraFieldOfView(boresite, azAxis, elHalfAngle, elAxis, azHalfAngle, 0);

In some cases my azimuth range goes beyond the 180 degree range that is allowed by the FoV provider, and so I’ve tried creating two separate fields of view where I split the azimuth limits down the middle and then create two adjacent rectangles (processed the same way as above, but with the new azimuth limits) - see below:

    private DoubleDihedraFieldOfView computeRectangularFOV(double boresiteAz, double boresiteEl, double minAz, double minEl){

        Vector3D boresite = azElToCartesian(boresiteAz, boresiteEl);

        Vector3D azAxis = Vector3D.PLUS_I;
        Vector3D elAxis = Vector3D.PLUS_J;

        double azHalfAngle = boresiteAz - minAz;
        double elHalfAngle = boresiteEl - minEl;

        return new DoubleDihedraFieldOfView(boresite, azAxis, elHalfAngle, elAxis, azHalfAngle, 0);
    }

    private List<DoubleDihedraFieldOfView> computeRectangularFOVs() {

        List<DoubleDihedraFieldOfView> fovs = new ArrayList<>();

        double azRng = Math.abs(upperRightAzLimit - lowerLeftAzLimit);
        if (azRng > 180.0){

            double boresiteEl = Math.toRadians((lowerLeftElLimit + upperRightElLimit) / 2.0);
            double minEl = Math.toRadians(lowerLeftElLimit);

            double minAz1 = Math.toRadians(lowerLeftAzLimit);
            double maxAz1 = Math.toRadians((lowerLeftAzLimit + upperRightAzLimit) / 2.0);
            double boresiteAz1 = (minAz1 + maxAz1) / 2.0;
            fovs.add(computeRectangularFOV(boresiteAz1, boresiteEl, minAz1, minEl));

            double minAz2 = maxAz1;
            double maxAz2 = Math.toRadians(upperRightAzLimit);
            double boresiteAz2 = (minAz2 + maxAz2) / 2.0;
            fovs.add(computeRectangularFOV(boresiteAz2, boresiteEl, minAz2, minEl));
        } else{
            double minEl = Math.toRadians(lowerLeftElLimit);
            double minAz = Math.toRadians(lowerLeftAzLimit);
            double boresiteAz = Math.toRadians((lowerLeftAzLimit + upperRightAzLimit) / 2.0);
            double boresiteEl = Math.toRadians((lowerLeftElLimit + upperRightElLimit) / 2.0);
            fovs.add(computeRectangularFOV(boresiteAz, boresiteEl, minAz, minEl));
        }   

        return fovs;
    }

My problem is when I use the DoubleDihedraFoV in a GroundFieldOfViewDetector, there are no generated LoggedEvents. I have tried using the Propagation tutorial example both with a CircularFieldOfView and the DoubleDihedraFieldofView, and the Circular one generates the expected entry/exit LoggedEvents, but Double Dihedra version didn’t when given identical field of regard definitions (i.e. 0-90 elevation, 0-360 azimuth), where it split the FOR into two 180 degree swaths. My example below uses a custom container class, SensorLimits, containing the code i listed just above this.

     SensorLimits lims = new SensorLimits(sta1Frame, 0., 350., 0., 90.);
        for (FieldOfView fov : lims.getFoV()) {
            GroundFieldOfViewDetector sta1Visi = new GroundFieldOfViewDetector(sta1Frame, fov)
                    .withHandler((s, d, increasing) -> {
                        return Action.CONTINUE;
                    });                    
            prop.addEventDetector(logger.monitorDetector(sta1Visi));
        }

In the end, I propagate for a day and then pull the EventLogged list from the propagator and print out anything that is entering or exiting the FoV, which is producing nothing when using the DoubleDihedra method. My question is, am I even using this FoV correctly and if so, can you see any reason why it might not be triggering entry/exit events?

I figured out what I think is the issue: I had followed another post about DoubleDihedralFieldOfView and must’ve gotten confused about the half angles. When I switched them, I started getting the detections I expected. That said, I’m still curious if this is the recommended way to handle fields of regard that are not quite 360 degrees in azimuth but are larger than 180 degrees.

1 Like