Calculation of Ground Station and Satellite Visibility Window

Hello everyone, I now have the orbital parameters of a satellite and the latitude, longitude, and altitude of a ground station. I want to calculate the time period when the satellite and the ground station are visible to each other. The minimum elevation angle for the ground station is 7 degrees, and the maximum communication distance is 3000 kilometers. Could you please advise me on how to implement this using code? Thank you very much.Here is my code, and I couldn’t find the correct Detector type.

    public static void getStation2SatWin(String line1, String line2, Station2SatWinReq winReq) {

        OneAxisEllipsoid earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_FLATTENING, FramesFactory.getTEME());
        AbsoluteDate startTime = new AbsoluteDate(winReq.getValidTime(), TimeScalesFactory.getUTC());
        AbsoluteDate endTime = new AbsoluteDate(winReq.getInvalidTime(), TimeScalesFactory.getUTC());

        final TLE tle = new TLE(line1, line2);

        final AttitudeProvider attitudeProvider = new LofOffset(FramesFactory.getTEME(), LOFType.VVLH);

        final SGP4 propagator = new SGP4(tle, attitudeProvider, winReq.getSatMass(), FramesFactory.getTEME());

        GeodeticPoint point = new GeodeticPoint(FastMath.toRadians(winReq.getLatitude()),
                FastMath.toRadians(winReq.getLongitude()),
                winReq.getAltitude());
        TopocentricFrame topocentricFrame = new TopocentricFrame(earth, point, "Gstation");


        EventsLogger logger = new EventsLogger();
        ElevationDetector detector = new ElevationDetector(topocentricFrame).withConstantElevation(FastMath.toRadians(winReq.getMinElevation()));
        final EventSlopeFilter<ElevationDetector> maxElevationDetector =
                new EventSlopeFilter<ElevationDetector>(detector, FilterType.TRIGGER_ONLY_DECREASING_EVENTS);
        propagator.addEventDetector(logger.monitorDetector(maxElevationDetector));
        propagator.propagate(startTime, endTime);

        for (EventsLogger.LoggedEvent e : logger.getLoggedEvents()) {
            SpacecraftState state = e.getState();
            Orbit orbit = state.getOrbit();
            Attitude attitude = state.getAttitude();
            System.out.println(attitude.getDate());
        }
    }

Hi @toonaiveckuu ,

The EventSlopeFilter doesn’t meet your needs, you need to use an EventPredicateFilter.
You’ll find useful information on how to use it in the following threads:

Thanks for the help, I’ll try

Has the issue been resolved? Could you please take a look at the source code for the visibility function?