Known Sources Module

The known sources module provides functionality for loading and managing known sources such as stars, planets, satellites, and other objects. Tracks can be created by projecting these sources onto imagery.

Core Classes

known_sources.KnownSources

Base class for known sources like stars, planets, asteroids, satellites, etc.

The KnownSources class represents a collection of known sources with similar properties, with subclasses implementing features as necessary.

Subclasses

VISTA includes several types of KnownSources:

  • Satellites: Satellites loaded from TLE files and propagated using the sgp4 python package

  • Stars: Stars loaded via the astroquery package (currently supported catalogs are Hipparcos and Gaia) or via csv file.

  • SolarSystemBodies: Bodies within our solar system loaded via astropy. Currently contains only the major planets.

These are implemented in the following subclasses:

satellites.Satellites

Class to hold satellite TLE data, converting to positions as necessary

solar_system_bodies.SolarSystemBodies

Class to hold the positions of solar system bodies, including planets and their moons

stars.Stars

Class to hold star data, converting to positions as necessary

Basic Usage

Creating KnownSources

from vista.known_sources import Satellites, Stars

# Create a collection of satellites from a TLE file
sats = Satellites("My favorite satellites", "my_tle.txt")

# Create a collection of stars, from the Hipparcos catalog
stars = Stars("My favorite stars", "Hipparcos")

Creating Tracks

import numpy as np
from vista.imagery.imagery import Imagery
from vista.sensors.sensor import Sensor

sensor = Sensor(name="My Sensor")
images = np.random.randn(100, 256, 256).astype(np.float32)
frames = np.arange(100)

img = Imagery(name="Test", images=images, frames=frames, sensor=sensor)

# this will project the positions of the stars onto the imagery,
# determine which stars are in each frame, and create tracks from
# the resulting pixel positions over all the imagery's frames
tracks = stars.create_tracks(img)

Module Reference

Known Sources Class

Known sources module for VISTA

This module provides positions of known sources that might be in the images.

class vista.known_sources.KnownSources(name)[source]

Bases: object

Base class for known sources like stars, planets, asteroids, satellites, etc.

It is expected that subclasses are implemented which contain groups of self-similar sources loaded together, i.e. an array of satellites, an array of stars, etc.

Parameters:

name (str) – unique name of the group of sources, stored in KnownSources.name. Examples: “GAIA stars”, “APASS stars”, “LEO satellites”

source_types

list of source types. Examples: [“star”, “star”, “star”], [“satellite”, “GEO satellite”, “LEO satellite”]

Type:

list[str]

source_names

list of unique names for all the sources

Type:

list[str]

__init__(name)[source]
create_tracks(imagery)[source]

Create a list of Tracks for the sources for the provided imagery. Ignores positions which are off-frame or behind the Earth. Sources which reappear after passing behind the Earth will therefore have multiple tracks

Parameters:

imagery (Imagery) – The imagery we want to create tracks for

Returns:

tracks – list of Track objects

Return type:

list[Tracks]

get_geodetics(times)[source]

Return an EarthLocation containing the positions of the sources at the provided time(s). Subclasses should implement this function based on the source types and be sure to return the resulting EarthLocation in units of km

Parameters:

times (np.datetime64 | NDArray[np.datetime64] | astropy.time.Time) – Time or array of times for which to retrieve positions

Returns:

Astropy EarthLocation object containing geodetic coordinates in km

Return type:

EarthLocation

get_pixels(imagery, times)[source]

Return the pixel positions of the source for the provided imagery and time(s). Sources which are off-frame or behind the Earth have NaN locations

Parameters:
  • imagery (Imagery) – The imagery we want to project the source onto

  • times (np.datetime64, NDArray[np.datetime64], astropy.time.Time) – The time(s) to project at

Returns:

  • rows (NDArray) – Row coordinates of source positions in the frame(s)

  • cols (NDArray) – Column coordinates of source positions in the frame(s)

Return type:

Tuple[NDArray, NDArray]

class vista.known_sources.Satellites(name, file_path=None)[source]

Bases: KnownSources

Class to hold satellite TLE data, converting to positions as necessary

satellites

An sgp4 (python package) SatrecArray of satellites

Type:

SatrecArray

__init__(name, file_path=None)[source]

Create a Satellites object

Parameters:
  • name (str) – Name of the Satellites object (e.g. ‘LEO satellites’, ‘GEO satellites’, etc.)

  • file_path (str, optional) – File path to satellite TLE data. Data can optionally be loaded later with the load_tle_file function

get_geodetics(times)[source]

Return an EarthLocation containing the positions of the satellites at the provided times

Parameters:

times (np.datetime64 | NDArray[np.datetime64] | astropy.time.Time) – Time or array of times for which to retrieve positions

Returns:

Astropy EarthLocation object containing geodetic coordinates in km

Return type:

EarthLocation

load_tle_file(file_path)[source]

Parses a TLE file into a SatrecArray of unique objects

Parameters:

file_path (str) – File path to satellite TLE data

class vista.known_sources.SolarSystemBodies[source]

Bases: KnownSources

Class to hold the positions of solar system bodies, including planets and their moons

Only implemented for major planets currently

__init__()[source]

Create a SolarSystemBodies object

get_geodetics(times)[source]

Return an EarthLocation containing the positions of the solar system bodies at the provided times

Parameters:

times (np.datetime64 | NDArray[np.datetime64] | astropy.time.Time) – Time or array of times for which to retrieve positions

Returns:

Astropy EarthLocation object containing geodetic coordinates in km

Return type:

EarthLocation

class vista.known_sources.Stars(name, catalog=None, V_max=None, V_min=-10)[source]

Bases: KnownSources

Class to hold star data, converting to positions as necessary

stars

A SkyCoord containing an array of star positions

Type:

SkyCoord

V_magnitudes

An array containing the magnitudes of the stars. These are not necessarily in the V band, as every survey is slightly different, but when applicable it contains magnitudes in some ~visual band. E.g., Hipparcos Hp, Gaia G

Type:

NDArray

__init__(name, catalog=None, V_max=None, V_min=-10)[source]

Create a Stars object

Parameters:
  • name (str) – Name of the Stars object (e.g. ‘Hipparcos stars’, ‘Gaia stars’, etc.)

  • catalog (str, None) – Name of the catalog to query. If value is one of [“Hipparcos”, “Gaia”], it will query data from online. Otherwise, it is assumed to be the name of a csv file of star data that contains at least the columns [“ID”, “RA”, “Dec”, “V_mag”]. It may optionally also include the columns [“pmRA”, “pmDec”, “parallax”, “parallax_error”]. If any optional columns are not present, they are assumed to be zero. Units of RA and Dec must be degrees, pmRA and pmDec must be mas / year, and parallax and parallax error must be mas. It is assumed that the csv contains values at the J2000 epoch.

  • V_max (int, default=7) – Faintness limit (more positive = fainter)

  • V_min (int, default=-10) – Brightness limit (more negative = brighter)

get_geodetics(times)[source]

Return an EarthLocation containing the positions of the stars at the provided times

Parameters:

times (np.datetime64 | NDArray[np.datetime64] | astropy.time.Time) – Time or array of times for which to retrieve positions

Returns:

Astropy EarthLocation object containing geodetic coordinates in km

Return type:

EarthLocation