I have the celestial coordinates of the center of telescope image, the telescope's field of view (in seconds), the start time of taking photo (full date), and the exposure time (in seconds). And I want to know how many Starlink satellites can get into the image frame. I cannot figure out how to calculate this correctly. I don't understand the celestial coordinates very well. I tried to use Skyfield api, geocentric coordinates and assume that the telescope is pointing up. But it is too long and isn't working correctly...
This is what I tried to do so far.
import skyfield.timelib
from skyfield.api import Topos, load
from datetime import timedelta
def satnum(start_time, exposition, eq_cords, field_of_view):
"""Counts number of satellites
Arguments
---------
:param start_time: skyfield.timelib.Time object
:param exposition: int
:param eq_cords: list of floats
:param field_of_view: int
Returns
-------
:return: int
Examples
--------
import satnum
start_time = [2020, 12, 14, 18, 00, 00]
exposition = 15
eq_cords = [4741.1, -2257.7, 4505.7]
field_of_view = 45
satnum.satnum(start_time, exposition, eq_cords, field_of_view)
0
"""
url = "https://celestrak.com/NORAD/elements/starlink.txt"
satellites = load.tle_file(url)
sat_counter = 0
ts = load.timescale()
eq_cords = Topos(*eq_cords)
for satellite in satellites:
difference = satellite - eq_cords
for n in range(exposition):
time = ts.utc(start_time.utc_datetime() + timedelta(seconds=n))
topocentric = difference.at(time)
altaz = topocentric.altaz()
if altaz[0].degrees >= 90 - (field_of_view/2)/60:
sat_counter += 1
break
return sat_counter
I'd be appreciate any ideas.