# Calculating Which Satellite Passes are Visible - Need help

I am a beginner Python programmer. I am trying to get the code in the article "Calculating which satellites are visible" to function without success. My plan is to identify satellites that are visible at night and take open shutter images of the sky to record their streaks using a RPI and RPI camera.

I entered the code.

import ephem


I assume I run the three functions at the end?

seconds_between(d1, d2)

datetime_from_time(tr)

get_next_pass(-74.01, 40.01, 10, "iss.tle")


I'm not sure what d1, d2 and tr are.

Is there a complete version of the code or next steps to get it running. TY!

• Can you provide a link to the article? Commented Oct 11, 2021 at 13:48
• @Jeff The same person who maintains PyEphem also created the new python package Skyfield which does this and many more things very nicely. You can just read the documentation there for the most up-to-date information. When I get to a computer I can write a short answer if somebody else doesn't do it first. For what you want to do I recommend just using one of the examples in Skyfield. RPi and PiCamera are a great combination for this! But it might be hard for some PyCamera packages to keep the shutter open for a whole minute.
– uhoh
Commented Oct 11, 2021 at 15:13
• How to expose for longer than 1/3 of a second with PiCamera HQ using picamera?
– uhoh
Commented Oct 11, 2021 at 15:13
• rhodesmill.org/skyfield/earth-satellites.html scroll down to "Finding when a satellite rises and sets" which uses satellite.find_events() and then "Find when a satellite is in sunlight" which uses satellite.at().is_sunlit() The third necessary test is a check the sky is sufficiently dark in your location at the time of the satellite pass. This is an excellent project to both learn more python (since Skyfield is so darn friendly and useful) and Raspbery Pi (for the same reasons).
– uhoh
Commented Oct 11, 2021 at 22:56