pythonpippackagesatellite

Python can't run SOIT: Satellite Overpass Identification Tool


I need to build a database with daily Terra and Aqua satellite overpass times for a point of interest.

The period is from 1/1/2001 to 12/31/2021. The location is lat: -32.510 ; lon: -55.800

I am a newcomer to working with satellite imagery. I have spent a lot of time searching for that information without success. It is very frustrating that despite having powerful tools to manage satellite data, this basic information is not easily accessible.

I have found this Python program: SOIT: Satellite Overpass Identification Tool. https://zenodo.org/record/6475619

According to the README file of the program:

Requirements:

  1. Download the latest version of Python (Python3). This program was developed in PyCharm and is publicly available for Mac, Linux, or PC here. Alternatively, you can run the program from the terminal of any machine with a Python 3 installation. You will also need the following packages: requests, json, configparser, numpy, csv, math, Skyfield. You can install them easily by running the following command in the terminal: <pip3 install (package name)>. For example, to install Skyfield: .
  2. Create an account at Space-Track.org (open-source).
  3. Make sure to have a stable internet connection.

After creating an account on Space-Track.org and downloading the two program files, I open PowerShell prompt, navigate to the program directory, and load the libraries using: python3 -m pip install (package)

With JSON, math, and CSV, I have the following message (eg:json):

python3 -m pip install json
ERROR: Could not find a version that satisfies the requirement json (from versions: none)
ERROR: No matching distribution found for json

When searching on Google, the answer provided is: Python has a built-in JSON module. If that's what you're looking for. Just import in your script or shell.

I am trying to use "import," and I receive:

The term 'import' is not recognized as the name of a cmdlet, function, script file,
or executable program. Please check if you typed the name correctly or, 
if you included a file path, make sure that the path is correct and try again.

I have tried running the program bypassing the last part, and I get the following message:

PS C:\Users\corre\anaconda3\envs\Overpass\overpassprg> python3 pass_time_v2.py
Traceback (most recent call last):
  File "C:\Users\corre\anaconda3\envs\Overpass\overpassprg\pass_time_v2.py", line 429, in <module>
    main()
  File "C:\Users\corre\anaconda3\envs\Overpass\overpassprg\pass_time_v2.py", line 265, in main
    aqua_closest = closest_time.split(' ')[3]
                   ~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

EDIT 05/26/2023:

The SLTrack.ini file was completed in this way:

[configuration]
username = martinfrancia@fagro.edu.uy
password = overpassanahi8camilo3

start date = 01/01/2001
end date = 12/31/2021

latitude of interest = -32.510
longitude of interest = -55.800

I need this data; how can it be so complicated? Feel free to suggest another approach


Solution

  • From Nick O Dell's comments, with the help of GPTChat4, the problem can be corrected as follows: Replace:

    aqua_closest = closest_time.split(' ')[3]
    

    With:

    closest_time_split = closest_time.split(' ')
    aqua_closest = closest_time_split[3] if len(closest_time_split) >= 4 else 'unknown'
    

    The same for Terra would be:

    Replace:

    terra_closest = closest_time.split(' ')[3]
    

    With:

    closest_time_split = closest_time.split(' ')
    terra_closest = closest_time_split[3] if len(closest_time_split) >= 4 else 'unknown'
    

    When the satellite passes only once per day, this correction replaces the error with the value "unknown." In my case, I was able to obtain a database from 2001 to 2021. Thank you, Nick O Dell. I couldn't have done it without your help.