Hello, I am trying to design a code that determined the visibility windows of a target location, including the FOV of its sensor. I designed the code according to another forum page (credits to writer Field of View Sat Event Detector Example), where the code is lower in that page. However, as I increase the FOV the start/end times remains the same until 70deg, when the duration time beings to decrease. This clearly makes no sense, the duration should be increasing even at 1deg FOV. Below is my code, any help would be greatly appreciated.
// orbit creation
Vector3D position = new Vector3D(-6142438.668, 3492467.560, -25767.25680);
Vector3D velocity = new Vector3D(505.8479685, 942.7809215, 7435.922231);
PVCoordinates pvCoordinates = new PVCoordinates(position,velocity);
AbsoluteDate initialDate = new AbsoluteDate(2004, 01, 01, 23, 30, 00.000, TimeScalesFactory.getUTC());
Frame inertialFrame = FramesFactory.getEME2000();
double mu = Constants.WGS84_EARTH_MU;
Orbit initialOrbit = new KeplerianOrbit(pvCoordinates, inertialFrame, initialDate, mu);
// ground station declaration
double longitude = FastMath.toRadians(30.);
double latitude = FastMath.toRadians(25.);
double altitude = 0;
GeodeticPoint geoPoint = new GeodeticPoint(latitude, longitude, altitude);
Frame earthFrame = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
BodyShape earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, earthFrame);
TopocentricFrame gpsFrame = new TopocentricFrame(earth, geoPoint, "location_one");
// set FOV for camera
FieldOfView fov = new CircularFieldOfView(Vector3D.PLUS_K, FastMath.toRadians(70), FastMath.toRadians(0));
final FieldOfViewDetector fd = new FieldOfViewDetector(gpsFrame, fov);
final ElevationDetector ed = new ElevationDetector(gpsFrame).withConstantElevation(0.);
// create detector
final BooleanDetector detector = BooleanDetector.andCombine(ed,fd).withMaxCheck(10.).withHandler(new EventHandler<BooleanDetector>(){
private AbsoluteDate start;
@Override
public Action eventOccurred(SpacecraftState s, BooleanDetector detector, boolean increasing) throws OrekitException{
if(increasing){
final GeodeticPoint satelliteAsGeodeticPoint = earth.transform(s.getPVCoordinates().getPosition(), s.getFrame(), s.getDate());
start = s.getDate();
System.out.format("ENTERED AREA: date: %s Satellite Coordinates: {latitude: %f3.9, longitude: %f3.9, altitude: %f km}\n",
start,
FastMath.toDegrees(satelliteAsGeodeticPoint.getLatitude()),
FastMath.toDegrees(satelliteAsGeodeticPoint.getLongitude()),
(satelliteAsGeodeticPoint.getAltitude() / 1000));
return Action.CONTINUE;
} else {
final double duration = s.getDate().durationFrom(start);
System.out.format("EXITING AREA: date: %s Pass duration: %f\n", s.getDate(), duration);
return Action.CONTINUE;
}
}
});
Propagator propagator = new KeplerianPropagator(initialOrbit, mu);
propagator.addEventDetector(detector);
SpacecraftState finalState = propagator.propagate(new AbsoluteDate(initialDate, 10000.));