API#

class lkspacecraft.KeplerSpacecraft[source]#

Bases: Spacecraft

A class representing the Kepler spacecraft.

This class extends the Spacecraft base class and includes spacecraft-specific configurations and calculations, such as correcting for timing errors unique to the Kepler mission.

spacecraft_code#

The SPICE NAIF ID code for the Kepler spacecraft.

Type:

int

get_barycentric_time_correction(time, ra, dec)[source]#

Returns the barycentric time correction in days for observations of a target, applying mission-specific timing corrections.

Initializes the Spacecraft object and loads SPICE kernels.

This method clears any previously loaded SPICE kernels, loads the kernels specified in the Meta.txt file, and determines the start and end times of the kernel data.

Parameters:

test_mode (bool) – Whether to use the test kernels. Test kernels are small, truncated kernels for each spacecraft valid over a short time range. If you use this mode, lkspacecraft will not connect to the internet, download new kernels, or used cached kernels. Use this mode if you want to test lkspacecraft as a dependency in your package.

Raises:

Exception – If there is an issue loading the SPICE kernels or retrieving the kernel time coverage.

get_barycentric_time_correction(time: Time, ra: float | ndarray[Any, dtype[_ScalarType_co]], dec: float | ndarray[Any, dtype[_ScalarType_co]]) ndarray[Any, dtype[_ScalarType_co]][source]#

Returns the barycentric time correction in days for observations of a particular target specified by RA and Dec.

Note that time here must be time in spacecraft time, in UTC format. This means that for SPOC data this should be the time without the SPOC barycentric correction applied.

Note this also corrects the timing error in the Kepler TIME column, see https://archive.stsci.edu/kepler/timing_error.html

get_differential_velocity_aberrated_positions(time: Time, ra: float, dec: float, ra0: float, dec0: float) ndarray[Any, dtype[_ScalarType_co]]#

Returns the RA and Dec after differential velocity aberration has been applied.

This is the effect of velocity aberration, accounting for the fact that the spacecraft tracks a given point in the sky. All stars undergo velocity aberration. During observation, the spacecraft tracks stars, therefore accounting for the bulk of this motion. This function enables you to calculate the differential velocity aberration from the spacecraft pointing.

Note that time here must be time in spacecraft time, in UTC format.

get_spacecraft_light_travel_time(time: Time, observer='SOLAR SYSTEM BARYCENTER') ndarray[Any, dtype[_ScalarType_co]]#

Returns the one-way light travel time in seconds for all time w.r.t the observer.

get_spacecraft_position(time: Time, observer='SOLAR SYSTEM BARYCENTER') ndarray[Any, dtype[_ScalarType_co]]#

Returns the position vector (x, y, z) in [km] for all time w.r.t the observer.

get_spacecraft_velocity(time: Time, observer='SOLAR SYSTEM BARYCENTER') ndarray[Any, dtype[_ScalarType_co]]#

Returns the position vector (vx, vy, vz) in [km/s] for all time w.r.t the observer.

get_velocity_aberrated_positions(time: Time, ra: float, dec: float) ndarray[Any, dtype[_ScalarType_co]]#

Returns the RA and Dec after velocity aberration has been applied.

Note that time here must be time in spacecraft time, in UTC format.

spacecraft_code = -227#
time_offset = 2454833#
class lkspacecraft.TESSSpacecraft[source]#

Bases: Spacecraft

A class representing the TESS spacecraft.

This class extends the Spacecraft base class and includes spacecraft-specific configurations, such as the unique SPICE NAIF ID code for the TESS mission.

spacecraft_code#

The SPICE NAIF ID code for the TESS spacecraft.

Type:

int

Initializes the Spacecraft object and loads SPICE kernels.

This method clears any previously loaded SPICE kernels, loads the kernels specified in the Meta.txt file, and determines the start and end times of the kernel data.

Parameters:

test_mode (bool) – Whether to use the test kernels. Test kernels are small, truncated kernels for each spacecraft valid over a short time range. If you use this mode, lkspacecraft will not connect to the internet, download new kernels, or used cached kernels. Use this mode if you want to test lkspacecraft as a dependency in your package.

Raises:

Exception – If there is an issue loading the SPICE kernels or retrieving the kernel time coverage.

get_barycentric_time_correction(time: Time, ra: float | ndarray[Any, dtype[_ScalarType_co]], dec: float | ndarray[Any, dtype[_ScalarType_co]]) ndarray[Any, dtype[_ScalarType_co]]#

Returns the barycentric time correction in days for observations of a particular target specified by RA and Dec.

Note that time here must be time in spacecraft time, in UTC format. This means that for SPOC data this should be the time without the SPOC barycentric correction applied.

get_differential_velocity_aberrated_positions(time: Time, ra: float, dec: float, ra0: float, dec0: float) ndarray[Any, dtype[_ScalarType_co]]#

Returns the RA and Dec after differential velocity aberration has been applied.

This is the effect of velocity aberration, accounting for the fact that the spacecraft tracks a given point in the sky. All stars undergo velocity aberration. During observation, the spacecraft tracks stars, therefore accounting for the bulk of this motion. This function enables you to calculate the differential velocity aberration from the spacecraft pointing.

Note that time here must be time in spacecraft time, in UTC format.

get_spacecraft_light_travel_time(time: Time, observer='SOLAR SYSTEM BARYCENTER') ndarray[Any, dtype[_ScalarType_co]]#

Returns the one-way light travel time in seconds for all time w.r.t the observer.

get_spacecraft_position(time: Time, observer='SOLAR SYSTEM BARYCENTER') ndarray[Any, dtype[_ScalarType_co]]#

Returns the position vector (x, y, z) in [km] for all time w.r.t the observer.

get_spacecraft_velocity(time: Time, observer='SOLAR SYSTEM BARYCENTER') ndarray[Any, dtype[_ScalarType_co]]#

Returns the position vector (vx, vy, vz) in [km/s] for all time w.r.t the observer.

get_velocity_aberrated_positions(time: Time, ra: float, dec: float) ndarray[Any, dtype[_ScalarType_co]]#

Returns the RA and Dec after velocity aberration has been applied.

Note that time here must be time in spacecraft time, in UTC format.

spacecraft_code = -95#
time_offset = 2457000#