Skip to main content

Simple module for ephemeris download and parse

Project description

spacetrack_files

This module allows you to download and parse Starlink ephemeris files.

Setup

Simply add this module via pip

pip install spacetrack_files

Using

You can:

  • Download any available public files from SpaceTrack
  • Parse Starlink ephemeris

Downloading public files

Downloading public files from SpaceTrack

Script below retrieves all public files and downloads them.

import os
from spacetrack_files.api import SpaceTrackApi

api = SpaceTrackApi('your_username', 'your_password')
dirs = api.getDirsList()

base_download_path = '.'

for download_path in dirs:
    if not os.path.exists(download_path):
        os.mkdir(download_path)

    fs = api.getDirsWithFiles()
    downloading_files = fs[download_path]

    for file in downloading_files:
        file_download_path = os.path.join(base_download_path, download_path, file)
        if os.path.exists(file_download_path):
            continue
        api.downloadFile(file, file_download_path)

Parsing Starlink ephemeris

It's as simple as this:

from spacetrack_files.files import EphemerisFile

# DO NOT RENAME FILE
eph = EphemerisFile('MEME_54190_STARLINK-5281_2210828_Operational_1375864140_UNCLASSIFIED.txt') 

Keep in mind: module's using filename to parse satellite name, NORAD ID, classification and operational status. Thus do not rename file.

Ephemeris structure:

@dataclass
class Ephemeris:
    epoch_j2000: str
    epoch: datetime
    position: np.array
    speed: np.array
    corr_values: np.array

Variables position and speed are 3-dim vectors. corr_values is matrix 3x7.

You can also get ephemeris in DataFrame format:

df = eph.to_dataframe()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spacetrack_files-0.0.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spacetrack_files-0.0.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file spacetrack_files-0.0.3.tar.gz.

File metadata

  • Download URL: spacetrack_files-0.0.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for spacetrack_files-0.0.3.tar.gz
Algorithm Hash digest
SHA256 6881bcf785610a0e64ea9e633f36778294897b9bdb75704e15bbc03d134ad807
MD5 26370fa6b5e5a487331fdcb1e1d9e1c2
BLAKE2b-256 1f6f119eed81a07268cc710c51e64600b47612281f2c0841b0b5c783926f7965

See more details on using hashes here.

File details

Details for the file spacetrack_files-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for spacetrack_files-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 83cdc3da79d7392bcfad8eecbce616bd6ed3f473a8a6c637081ddb3e25ad16cb
MD5 ec75180f69d8836dacd539d5b9883333
BLAKE2b-256 352f4b298cf1c791ae9ac960dbfb78cf5738faddbd3a6d603f917a111c262b20

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page