Fellow astrodynamicists,

I am looking to generate ground tracks for a visible satellite given a TLE and date range. My current method uses the ElevationDetector and ElevationExtremumDetector, resulting only getting the ground track points for the start of the contact, the maximum, and the end of the contact window.

It looks roughly like:

```
station = GeodeticPoint(
radians(latAnalysis[indexGs]),
radians(lonAnalysis[indexGs]),
float(altAnalysis[indexGs]),
)
stationFrame = TopocentricFrame(earth, station, "Esrange")
logger = EventsLogger()
elevationDetector = ElevationDetector(stationFrame).withConstantElevation(minElevation).withThreshold(1.0e-6).withHandler(ContinueOnEvent())
loggerElDetector = logger.monitorDetector(elevationDetector)
maxDetector = ElevationExtremumDetector(stationFrame).withThreshold(1.0e-6).withHandler(ContinueOnEvent())
loggerMaxDetector = logger.monitorDetector(maxDetector)
# This is where the magic happens. OreKit does orbit propagation and logs the events for
# elevation and max elevation
propagator = TLEPropagator.selectExtrapolator(satelliteTLE)
propagator.addEventDetector(loggerElDetector)
propagator.addEventDetector(loggerMaxDetector)
propagator.propagate(startDate, endDate)
oreKitEvents = logger.getLoggedEvents()
###############d###############
# Post Process Orekit Results #
###############################
pvList = []
elevationList = []
timeList = []
startTime = []
stopTime = []
accessTime = []
maxElevation = []
index = 0
lengthEvents = 0
numContact = 0
# This method detects when the satellite is at 5 deg el, its elevation extreme (can be negative)
# For post-process I determine the time at the 5 deg el crossings and the maximum elevation > 0
for oreKitEvent in oreKitEvents:
eventState = oreKitEvent.getState()
pv = eventState.getPVCoordinates() # .getPosition()
# print(pv)
# pvList.append(pv)
# This might be for PV when satellite is detected by the ground station (above elevation threshold)
groundPoint = earth.transform(pv.position, inertialFrame, pv.date)
print(f"{degrees(groundPoint.longitude)},{degrees(groundPoint.latitude)}")
elevation = degrees(
stationFrame.getElevation(
eventState.getPVCoordinates().getPosition(),
eventState.getFrame(),
eventState.getDate(),
)
)
elevationList.append(elevation)
timeList.append(eventState.getDate())
lengthEvents += 1
print("elevationList:")
print(elevationList)
for elevationListItem in elevationList:
if index != 0 and index < lengthEvents - 1 and int(elevationListItem) > degrees(minElevation):
startTimeTemp = timeList[index - 1]
startTime.append(str(startTimeTemp))
stopTimeTemp = timeList[index + 1]
stopTime.append(str(stopTimeTemp))
accessTimeTemp = round(stopTimeTemp.durationFrom(startTimeTemp) / 60, 2)
accessTime.append(accessTimeTemp)
maxElevationTemp = round(elevationList[index], 2)
maxElevation.append(maxElevationTemp)
numContact += 1
index += 1
```

The post-processing for finding start/stop times of that contact window isn’t the best, but it works.

My next thought was to follow the orekit_map.ipynb example:

```
startDate = AbsoluteDate(2012, 1, 26, 11, 0, 00.000, utc)
# Overall duration in seconds for extrapolation
duration = 24 * 60 * 60
step_time = 10
# Time array in orekit AbsoluteDate format
t = [startDate.shiftedBy(float(dt)) \
for dt in np.arange(0, duration, step_time)]
pv = [eck_prop.propagate(tt).getPVCoordinates() for tt in t]
p = [tpv.getPosition() for tpv in pv]
.
.
.
lat = np.degrees([gp.getLatitude() for gp in subpoint])
lon = np.degrees([gp.getLongitude() for gp in subpoint])
```

I’d like to create a TimeArray with a variable step_time. Is there a way to create the TimeArray with just a start data, end date, and step_time (dt)?

Is there a clever way to get the ground point for the duration of the orbit and detect when elevations are above a threshold? Maybe it’s a combination of using the propagator and the events logger?