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¶
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:
Class to hold satellite TLE data, converting to positions as necessary |
|
Class to hold the positions of solar system bodies, including planets and their moons |
|
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¶
create_tracks() evaluates source positions at the imagery timestamps and uses its sensor to map the positions onto
pixels. The imagery must contain timestamps and have a sensor that can geolocate.
For a complete GUI workflow and source-specific loading options, see Known Sources.
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:
objectBase 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”]
- 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
- 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:
KnownSourcesClass to hold satellite TLE data, converting to positions as necessary
- satellites¶
An sgp4 (python package) SatrecArray of satellites
- Type:
SatrecArray
- 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
- class vista.known_sources.SolarSystemBodies[source]¶
Bases:
KnownSourcesClass to hold the positions of solar system bodies, including planets and their moons
Only implemented for major planets currently
- 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:
KnownSourcesClass 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