Skip to content

Functions

earth_barycentric_velocity(dt)

Approximate Earth barycentric velocity in km/s (ICRS equatorial frame).

Uses a circular-orbit approximation. Accuracy ~0.5 km/s (~1.7%), sufficient for stellar aberration correction (~20" effect, ~0.3" error).

Parameters:

Name Type Description Default
dt datetime

Observation time as a datetime.datetime (UTC). The ~69 s offset between UTC and TT is negligible for this approximation.

required

Returns:

Type Description
list[float]

[vx, vy, vz] in km/s, ICRS equatorial frame. Pass directly to

list[float]

solve_from_centroids(observer_velocity_km_s=...).

Example::

from datetime import datetime
v = tetra3rs.earth_barycentric_velocity(datetime(2025, 7, 10))
result = db.solve_from_centroids(centroids, ..., observer_velocity_km_s=v)

undistort_centroids(centroids, distortion)

Apply distortion correction to a list of centroids (distorted → ideal).

Returns a new list with corrected positions; brightness and covariance are preserved.

Parameters:

Name Type Description Default
centroids list[Centroid]

List of Centroid objects.

required
distortion Union[RadialDistortion, PolynomialDistortion]

A RadialDistortion model.

required

Returns:

Type Description
list[Centroid]

A new list of Centroid objects with undistorted positions.

distort_centroids(centroids, distortion)

Apply forward distortion to a list of centroids (ideal → distorted).

Returns a new list with distorted positions; brightness and covariance are preserved.

Parameters:

Name Type Description Default
centroids list[Centroid]

List of Centroid objects.

required
distortion Union[RadialDistortion, PolynomialDistortion]

A RadialDistortion model.

required

Returns:

Type Description
list[Centroid]

A new list of Centroid objects with distorted positions.