swiftest.Simulation.modify_body#
- Simulation.modify_body(name=None, id=None, a=None, e=None, inc=None, capom=None, omega=None, capm=None, rh=None, vh=None, mass=None, Gmass=None, radius=None, rhill=None, rot=None, Ip=None, rotphase=None, j2rp2=None, j4rp4=None, c_lm=None, align_to_central_body_rotation=False, framenum=-1, **kwargs)[source]#
Modifies an existing body in the internal Dataset given a new value of either the orbital elements or cartesian state vectors, or the physical property of the body (mass, radius, etc).
Input all angles in degrees and dimensions in the units defined in the current Simulation instance. Currently, this will only modify the last entry of the body in the time dimension. This method will update the data attribute with the modified body or bodies added to the existing Dataset.
- Parameters:
name (str or array-like of str, optional) – Name or names of bodies to modify.
id (int or array-like of int, optional) – Id value or values of bodies to modify. Only one of name or id may be passed, but not both.
a (float or array-like of float, optional) – semimajor axis for param[‘IN_FORM’] == “EL”
e (float or array-like of float, optional) – eccentricity for param[‘IN_FORM’] == “EL”
inc (float or array-like of float, optional) – inclination for param[‘IN_FORM’] == “EL”
capom (float or array-like of float, optional) – longitude of ascending node for param[‘IN_FORM’] == “EL”
omega (float or array-like of float, optional) – argument of periapsis for param[‘IN_FORM’] == “EL”
capm (float or array-like of float, optional) – mean anomaly for param[‘IN_FORM’] == “EL”
rh ((n,3) array-like of float, optional) – Position vector array.
vh ((n,3) array-like of float, optional) – Velocity vector array.
mass (float or array-like of float, optional) – mass values if these are massive bodies (only one of mass or Gmass can be passed)
Gmass (float or array-like of float, optional) – G*mass values if these are massive bodies (only one of mass or Gmass can be passed)
radius (float or array-like of float, optional) – Radius values if these are massive bodies
rhill (float or array-like of float, optional) – Hill’s radius values if these are massive bodies
rot ((3) or (n,3) array-like of float, optional) – Rotation rate vectors if these are massive bodies with rotation enabled.
Ip ((3) or (n,3) array-like of float, optional) – Principal axes moments of inertia vectors if these are massive bodies with rotation enabled.
rotphase (float, optional) – rotation phase angle in degreesif these are massive bodies with rotation enabled
j2rp2 (float, optional) – Non-normalized J2 values (e.g. J2*R**2, where R is the body radius) if this is a central body (only one of J2 or c_lm can be passed)
j4rp4 (float, optional) – Non-normalized J4 values (e.g. J4*R**4, where R is the body radius) if this is a central body (only one of J4 or c_lm can be passed)
c_lm ((2,l_max+1,l_max+1) array-like of float, optional) – Spherical harmonics coefficients if this is a central body (only one of J2/J4 or c_lm can be passed)
align_to_central_body_rotation (bool, default False) – If True, the cartesian coordinates will be aligned to the rotation pole of the central body. This is only valid for when rotation is enabled.
framenum (int, default -1) – Frame number to modify. If -1, the last frame is modified.
- Returns:
None – Sets the data and init_cond instance variables each with a SwiftestDataset containing the body or bodies that were added