vectors/states/frames
Units used throughout kete are distance in au, and time in Days TDB scaled.
Coordinate frames match the coordinate frames used by cSPICE.
Representation of States, Vectors, and coordinate Frames.
- class kete.vector.CometElements(desig, epoch, eccentricity, inclination, peri_dist, peri_arg, peri_time, lon_of_ascending)
Cometary Elements class made accessible to python.
Angles must be in degrees, distances in AU.
- Parameters:
desig – The designations of the object.
epoch – The epoch time for the orbital elements.
eccentricity – The eccentricity of the orbit.
inclination – The inclination, must be in degrees.
peri_dist – The perihelion distance in AU.
peri_arg – The argument of perihelion, must be in degrees.
peri_time – The JD time of perihelion.
lon_of_ascending – The longitude of ascending node, in degrees.
- desig
Designation of the object.
- eccentric_anomaly
Eccentric Anomaly in degrees.
- eccentricity
Eccentricity of the orbit.
- epoch
Epoch of the elements in JD.
- static from_state(state)
Construct a new CometElements object from a State.
- Parameters:
State – State Object.
- inclination
Inclination of the orbit in degrees.
- lon_of_ascending
Longitude of the ascending node of the orbit in degrees.
- mean_anomaly
Mean Anomaly in degrees.
- mean_motion
Mean Motion of the orbit in degrees.
- orbital_period
Orbital Period in days, nan if non-elliptical.
- peri_arg
Argument of Perihelion of the orbit in degrees.
- peri_dist
Distance of Perihelion of the orbit in au.
- peri_time
Perihelion time of the orbit in JD.
- semi_major
Semi Major Axis of the orbit in au.
- state
Convert the orbital elements into a cartesian State.
- true_anomaly
True Anomaly in degrees.
- class kete.vector.Frames
Defined inertial frames supported by the python side of kete
- Ecliptic = Frames.Ecliptic
- Equatorial = Frames.Equatorial
- FK4 = Frames.FK4
- Galactic = Frames.Galactic
- Undefined = Frames.Undefined
- class kete.vector.SimultaneousStates(states, fov=None)
Representation of a collection of [State] at a single point in time.
The main value in this is that also includes an optional Field of View. If the FOV is provided, it is implied that the states which are present in this file were objects seen by the FOV.
In the case where the FOV is provided, it is expected that the states positions will include light delay, so an object which is ~1au away from the FOV observer will have a JD which is offset by about 8 minutes.
- center_id
The reference center NAIF ID for this state.
- fov
The FOV if it exists.
- frame
Coordinate Frame.
- jd
The time of the simultaneous states.
- static load(filename)
Load a single SimultaneousStates from a file.
- static load_list(filename)
Load a list from a binary file.
Note that this loads a list of SimultaneousStates, meaning it is a list of a list of States.
- static load_parquet(filename)
Load states from a parquet file.
- obs_vecs
If a FOV is present, calculate all vectors from the observer position to the position of the objects.
- ra_dec_with_rates
If a FOV is present, calculate the RA/Decs and their rates for all states in this object. This will automatically convert all frames to Equatorial.
4 numbers are returned for each object, [RA, DEC, RA’, DEC’], where rates are provided in degrees/day.
The returned RA’ rate is scaled by cos(dec) so that it is equivalent to a linear projection onto the observing plane.
- save(filename)
Save a single SimultaneousStates to a file.
- static save_list(vec, filename)
Save a list to a binary file.
Note that this saves a list of SimultaneousStates, meaning it is a list of a list of States.
- save_parquet(filename)
Save states as a parquet file.
- states
States contained within.
- class kete.vector.State(desig, jd, pos, vel, frame=None, center_id=10)
Representation of the state of an object at a specific moment in time.
- Parameters:
desig (str) – Name of the object, optional.
jd – The time of the state in TDB jd time, see
kete.Time
.pos – Position of the object with respect to the center ID in au.
vel – Velocity of the object with respect to the center ID in au / day.
frame – The frame of reference defining the position and velocity vectors.
center_id – The SPICE kernel ID which defines the central reference point, defaults to the Sun (10).
- as_ecliptic
Convert state to the Ecliptic Frame.
- as_equatorial
Convert state to the Equatorial Frame.
- as_fk4
Convert state to the FK4 Frame.
- as_galactic
Convert state to the Galactic Frame.
- center_id
Central ID of the object used as reference for the coordinate frame.
- change_center(naif_id)
Change the center ID of the state from the current state to the target state.
If the desired state is not a known NAIF id this will raise an exception.
- change_frame(frame)
Change the coordinate frame of the object to the target frame.
- Parameters:
frame (Frames) – New frame to change to.
- desig
Designation of the object if defined.
- elements
Cometary orbital elements of the state.
- frame
Frame of reference used to define the coordinate system.
- jd
JD of the object’s state in TDB scaled time.
- pos
Position of the object in AU with respect to the central object.
- vel
Velocity of the object in AU/Day.
- class kete.vector.Vector(raw, frame=None)
Vector class which is a vector along with a reference frame.
- Parameters:
raw (list) – 3 floats which define the direction of the vector.
frame – The frame of reference defining the coordinate frame of the vector, defaults to ecliptic.
- angle_between(other)
Compute the angle in degrees between two vectors in degrees. This will automatically make a frame change if necessary.
- as_ecliptic
Return the vector in the ecliptic frame, regardless of starting frame.
- as_equatorial
Return the vector in the equatorial frame, regardless of starting frame.
- as_fk4
Return the vector in the fk4 frame, regardless of starting frame.
- as_galactic
Return the vector in the galactic frame, regardless of starting frame.
- az
Azimuth in degrees from the X axis in the X-Y plane of the coordinate frame.
- change_frame(target_frame)
Return the vector in the target frame, regardless of starting frame.
- dec
Declination in degrees if the frame is Equatorial.
- property dec_dms
The declination, in degrees-arcminutes-arcseconds string format.
- el
Elevation in degrees from the X-Y plane of the coordinate frame. Values will be between -180 and 180
- frame
The Frame of reference.
- static from_el_az(el, az, r, frame)
Create a new Vector from the elevation and azimuthal angle in degrees.
- Parameters:
el (float) – Elevation above the X-Y plane of the frame. (Degrees)
az (float) – Azimuthal angle on the X-Y plane for the frame. (Degrees)
frame (Frames) – Frame of reference which define the coordinate axis.
r – Optional length of the vector, defaults to 1.
- static from_lat_lon(lat, lon, r=None)
Create a new Ecliptic Vector with the specified latitude/longitude.
- Parameters:
lat (float) – Latitude in the ecliptic frame. (Degrees)
lon (float) – Longitude in the ecliptic frame. (Degrees)
r – Optional length of the vector, defaults to 1.
- static from_ra_dec(ra, dec, r=None)
Create a new Equatorial Vector with the specified RA/DEC.
- Parameters:
ra (float) – Right Ascension in the equatorial frame. (Degrees)
dec (float) – Declination in the equatorial frame. (Degrees)
r – Optional length of the vector, defaults to 1.
- lat
Latitude in degrees if the frame is Ecliptic.
- lon
Longitude in degrees if the frame is Ecliptic.
- r
Length of the Vector
- ra
Right Ascension in degrees if the frame is Equatorial.
- property ra_hms
The right ascension, in hours-minutes-seconds string format.
- raw
The raw vector without the Frame.
- rotate_around(other, angle)
Rotate this vector around another vector by the provided angle.
- Parameters:
other (Vector) – The other vector to rotate around.
angle – The angle in degrees of the rotation.
- x
X coordinate in au.
- y
Y coordinate in au.
- z
Z coordinate in au.
- kete.vector.ecef_to_wgs_lat_lon(x, y, z)
Compute WCS84 Geodetic latitude/longitude/height from a ECEF position.
This returns the lat, lon, and height from the WGS84 oblate Earth.
- Parameters:
x – ECEF x position in km.
y – ECEF y position in km.
z – ECEF z position in km.
- kete.vector.wgs_lat_lon_to_ecef(lat, lon, h)
Compute a ECEF position from WCS84 Geodetic latitude/longitude/height.
This returns the X/Y/Z coordinates in km from the geocenter of the Earth.
- Parameters:
lat – Latitude in degrees.
lon – Longitude in degrees.
h – Height above the surface of the Earth in km.