Accretion discs

Analysis for accretion discs.

plonk.analysis.discs.eccentricity(snap, central_body=None, ignore_accreted=False)

Calculate the eccentricity.

Parameters
  • snap (SnapLike) – The Snap object.

  • central_body (optional) – A dictionary with the mass, position, and velocity (as Pint quantities) of the central body around which the particles are orbiting. If None, attempt to read from snap.properties[‘central_body’].

  • ignore_accreted (optional) – Ignore accreted particles. Default is False.

Returns

The eccentricity on the particles.

Return type

Quantity

plonk.analysis.discs.inclination(snap, central_body=None, ignore_accreted=False)

Calculate the inclination.

Parameters
  • snap (SnapLike) – The Snap object.

  • central_body (optional) – A dictionary with the mass, position, and velocity (as Pint quantities) of the central body around which the particles are orbiting. If None, attempt to read from snap.properties[‘central_body’].

  • ignore_accreted (optional) – Ignore accreted particles. Default is False.

Returns

The inclination on the particles.

Return type

Quantity

plonk.analysis.discs.inclination_angle(snap)

Calculate the disc inclination.

The inclination is calculated by taking the angle between the angular momentum vector and the z-axis, with the angular momentum calculated with respect to the center of mass.

Parameters

snap (SnapLike) – The Snap object.

Returns

The disc inclination.

Return type

Quantity

plonk.analysis.discs.keplerian_frequency(snap, central_body=None, ignore_accreted=False)

Calculate the Keplerian orbital frequency.

Parameters
  • snap (SnapLike) – The Snap object.

  • central_body (optional) – A dictionary with the mass, position, and velocity (as Pint quantities) of the central body around which the particles are orbiting. If None, attempt to read from snap.properties[‘central_body’].

  • ignore_accreted (optional) – Ignore accreted particles. Default is False.

Returns

The Keplerian frequency on the particles.

Return type

Quantity

plonk.analysis.discs.position_angle(snap)

Calculate the disc position angle.

The position angle is taken from the x-axis in the xy-plane. It defines a unit vector around which the snap is inclined.

Parameters

snap (SnapLike) – The Snap object.

Returns

The disc position angle.

Return type

Quantity

plonk.analysis.discs.rotate_edge_on(snap, sinks=False)

Rotate to edge-on with the angular momentum vector.

I.e. rotate such that the angular momentum points in the y-direction.

Parameters
  • snap (SnapLike) – The Snap object.

  • sinks (optional) – Include sink particles specified by a list of indices, or a bool indicating all sinks or no sinks. Default is True (all sinks).

Returns

The rotated Snap.

Return type

Snap

plonk.analysis.discs.rotate_face_on(snap, sinks=False)

Rotate to face-on with the angular momentum vector.

I.e. rotate such that the angular momentum points in the z-direction.

Parameters
  • snap (SnapLike) – The Snap object.

  • sinks (optional) – Include sink particles specified by a list of indices, or a bool indicating all sinks or no sinks. Default is True (all sinks).

Returns

The rotated Snap.

Return type

Snap

plonk.analysis.discs.semi_major_axis(snap, central_body=None, ignore_accreted=False)

Calculate the semi-major axis.

Parameters
  • snap (SnapLike) – The Snap object.

  • central_body (optional) – A dictionary with the mass, position, and velocity (as Pint quantities) of the central body around which the particles are orbiting. If None, attempt to read from snap.properties[‘central_body’].

  • ignore_accreted (optional) – Ignore accreted particles. Default is False.

Returns

The semi-major axis on the particles.

Return type

Quantity

plonk.analysis.discs.stokes_number(snap, central_body=None, ignore_accreted=False)

Calculate the Stokes number.

Parameters
  • snap (SnapLike) – The Snap object.

  • central_body (optional) – A dictionary with the mass, position, and velocity (as Pint quantities) of the central body around which the particles are orbiting. If None, attempt to read from snap.properties[‘central_body’].

  • ignore_accreted (optional) – Ignore accreted particles. Default is False.

Returns

The Stokes number on the particles.

Return type

Quantity

plonk.analysis.discs.unit_normal(snap, sinks=False)

Calculate unit normal to plane of rotation.

I.e. calculate a unit angular momentum vector.

Parameters
  • snap (SnapLike) – The Snap object.

  • sinks (optional) – Include sink particles specified by a list of indices, or a bool indicating all sinks or no sinks. Default is True (all sinks).

Returns

A unit angular momentum vector.

Return type

ndarray