Question About "Angular Separation From Satellite" Detector

All

I recently had cause to play with the AngularSeparationFromSatellite detector, and I was wondering if it was possible that the math had accidentally been performed backwards. In the unit test AngularSeparationFromSatelliteDetectorTest::testCentralSunTransit(), when the code hits the requisite angle threshold of 10 deg, the positions of the relevant objects in ECI are as follows:

Sun: {113,860,438,991.12085; 90,638,739,947.96777; 39,295,688,385.25682}
Acatenango: {3,974,505.016056697; 4,732,962.172846461; 1,586,432.2869105348}
Satellite: {-4,561,348.540946262; -4,031,032.255374609; -3,456,778.802339459}

which makes it pretty clear that the satellite is on the opposite side of the world from both the sun and Acatenango. I think what’s happening is that this equation:

        final Vector3D primaryPos   = primaryObject  .getPosition(s.getDate(), s.getFrame());
        final Vector3D secondaryPos = secondaryObject.getPosition(s.getDate(), s.getFrame());
        final double separation = Vector3D.angle(primaryPos.subtract(sPosition),
                                                 secondaryPos.subtract(sPosition));

is indeed solving for an angle of 10 degrees, except since the origin of both vectors is the satellite object, what you’d really want to solve for is when the angle between the vectors is 170 degrees and the satellite is therefore between the sun and Acatenango.

Is this correct, or am I misreading the intent of the code?

Hi Brianna,

Maybe the test’s name or description is wrong or misleading, but I think the detector itself does what it’s supposed to do. It computes the angular separation of two targets as seen from the spacecraft and compares it to a critical value.

Cheers,
Romain.

No, I agree that in itself the detector is functioning correctly. I only ask because as a layperson, if I put in a threshold of 10 degrees, I would likely be looking for times when my satellite was close to the line of sight between the ground point and the sun. However, the way the code is set up now, the windows being solved for would indeed have an angle value of 10 degrees, but my satellite would be on the other side of the earth from the line between the ground point and the sun.