StateBase¶
- class sbpy.dynamics.state.StateBase(r: Quantity, v: Quantity, t: Quantity | Time, frame: FrameInputTypes | None = None)[source]¶
Bases:
ABCAbstract base class for dynamical state.
- Parameters:
- r
Quantity Position (x, y, z), shape = (3,) or (N, 3).
- v
Quantity Velocity (x, y, z), shape = (3,) or (N, 3).
- t
TimeorQuantity Time, a scalar or shape = (N,). Time as a
Quantitymay only be used with theArbitraryFramecoordinate frame.- frame
BaseCoordinateFrameclass or string, optional Reference frame for
randv. Default:ArbitraryFrame.
- r
Notes
State data is immutable.
Examples
>>> from astropy.time import Time >>> import astropy.units as u >>> from sbpy.dynamics import State >>> r = [1e9, 1e9, 0] * u.km >>> v = [0, 0, 10] * u.km / u.s >>> t = Time("2022-07-24", scale="tdb") >>> state = State(r, v, t)
Or, specify time relative to an arbitrary epoch:
>>> t = 327 * u.day >>> state = State(r, v, t)
Dynamical state.
- Parameters:
- r
Quantity Position (x, y, z), shape = (3,) or (N, 3).
- v
Quantity Velocity (x, y, z), shape = (3,) or (N, 3).
- t
TimeorQuantity Time, a scalar or shape = (N,). Time as a
Quantitymay only be used with theArbitraryFramecoordinate frame.- frame
BaseCoordinateFrameclass or string, optional Reference frame for
randv. Default:ArbitraryFrame.
- r
Notes
State data is immutable.
Examples
>>> from astropy.time import Time >>> import astropy.units as u >>> from sbpy.dynamics import State >>> r = [1e9, 1e9, 0] * u.km >>> v = [0, 0, 10] * u.km / u.s >>> t = Time("2022-07-24", scale="tdb") >>> state = State(r, v, t)
Or, specify time relative to an arbitrary epoch:
>>> t = 327 * u.day >>> state = State(r, v, t)
Attributes Summary
True if the time attribute is arbitrary.
Position vector.
Position in km, and velocity in km/s.
Time.
Velocity vector.
x component of the velocity vector.
y component of the velocity vector.
z component of the velocity vector.
x component of the position vector.
y component of the position vector.
z component of the position vector.
Methods Summary
Convert to a
SkyCoordobject.transform_to(frame)Transform state into another reference frame.
Attributes Documentation
- arbitrary_time¶
True if the time attribute is arbitrary.
- frame¶
- r¶
Position vector.
- rv¶
Position in km, and velocity in km/s.
- t¶
Time.
- v¶
Velocity vector.
- v_x¶
x component of the velocity vector.
- v_y¶
y component of the velocity vector.
- v_z¶
z component of the velocity vector.
- x¶
x component of the position vector.
- y¶
y component of the position vector.
- z¶
z component of the position vector.
Methods Documentation
- transform_to(frame: FrameInputTypes) Self[source]¶
Transform state into another reference frame.
- Parameters:
- framestring or
BaseCoordinateFrame Transform into this reference frame.
- framestring or
- Returns:
- stateState
The transformed state.