Spice#
- class stixcore.ephemeris.manager.Spice(meta_kernel_pathes)[source]#
Bases:
SpiceKernelLoaderWrapper to spice functions.
Convert between spacecraft elapsed times (SCET), UTC strings and datetime objects. Obtain spacecraft position and orientation, convert to and from instrument coordinate system
Examples
>>> from stixcore.ephemeris.manager import Spice >>> import stixcore.data.test >>> converted = Spice.instance.scet_to_datetime('625237315:44104') >>> str(converted) '2019-10-24 13:01:50.672974+00:00'
>>> from datetime import datetime >>> from stixcore.ephemeris.manager import Spice >>> import stixcore.data.test >>> x, y, z = Spice.instance.get_position(date=datetime(2020, 10, 1), frame='SOLO_HEE') >>> x, y, z (<Quantity -92089164.00717261 km>, <Quantity 1.05385302e+08 km>, <Quantity 44917232.72028707 km>)
Methods Summary
convert_to_inst(coords)Convert the given coordinates to the instrument frame
datetime_to_scet(adatetime)Convert datetime to SCET.
get_auxiliary_positional_data(*, date)get_fits_headers(*, start_time, average_time)get_orientation(date, frame)Get the orientation or roll, pith and yaw of STIX (ILS or OPT).
get_position(*, date, frame)Get the position of SolarOrbiter at the given date in the given coordinate frame.
get_sun_disc_size(*, date)scet_to_datetime(scet)Convert SCET to datetime.
scet_to_utc(scet)Convert SCET to UTC time string in ISO format.
utc_to_scet(utc)Convert UTC ISO format to SCET time strings.
Methods Documentation
- convert_to_inst(coords)[source]#
Convert the given coordinates to the instrument frame
- Parameters:
coords (
astropy.coordinate.SkyCoord) – The coordinates to transform to the instrument frameframe (
str, optional) – The instrument coordinate frame (ILS or OPT)
- Returns:
tuple – x and y coordinates
- datetime_to_scet(adatetime)[source]#
Convert datetime to SCET.
- Parameters:
adatetime (
datetime.datetimeorastropy.time.Time) – Time to convert to SCET- Returns:
str– SCET of datetime encoded as spacecraft clock string
- get_orientation(date, frame)[source]#
Get the orientation or roll, pith and yaw of STIX (ILS or OPT).
- Parameters:
date (
datetime.datetime) – Date at which to obtain orientation informationframe (
str) – Name of the coordinate frame
- Returns:
tuple – Roll, pitch and yaw of the spacecraft
- get_position(*, date, frame)[source]#
Get the position of SolarOrbiter at the given date in the given coordinate frame.
- Parameters:
date (
datetime.datetime) – Date at which to obtain positionframe (
str) – Name of the coordinate frame (‘IAU_SUN’, ‘SOLO_HEE’)
- Returns:
tuple – The x, y, and z components of the spacecraft position
- scet_to_datetime(scet)[source]#
Convert SCET to datetime.
- Parameters:
scet (
str,int,float) – SCET time as number or spacecraft clock string e.g.1.0or'625237315:44104'- Returns:
datetime.datetime– Datetime of SCET