sarracen.disc.surface_density

sarracen.disc.surface_density(data: SarracenDataFrame, r_in: float | None = None, r_out: float | None = None, bins: int = 300, log: bool = False, geometry: str = 'cylindrical', origin: list | None = None, retbins: bool = False) ndarray | Tuple[ndarray, ndarray]

Calculates the 1D azimuthally-averaged surface density profile.

The surface density profile is computed by segmenting the particles into radial bins (rings) and dividing the total mass contained within each bin by the area of its respective ring.

Parameters:
  • data (SarracenDataFrame) – Particle data, in a SarracenDataFrame.

  • r_in (float, optional) – Inner radius of the disc. Defaults to the minimum r value.

  • r_out (float, optional) – Outer radius of the disc. Defaults to the maximum r value.

  • bins (int, optional) – Defines the number of equal-width bins in the range [r_in, r_out]. Default is 300.

  • log (bool, optional) – Whether to bin in log scale or not. Defaults to False.

  • geometry (str, optional) – Coordinate system to use to calculate the particle radii. Can be either spherical or cylindrical. Defaults to cylindrical.

  • origin (array-like, optional) – The x, y and z centre point around which to compute radii. Defaults to [0, 0, 0].

  • retbins (bool, optional) – Whether to return the midpoints of the bins or not. Defaults to False.

Returns:

  • array – A NumPy array of length bins containing the surface density profile.

  • array, optional – The midpoint values of each bin. Only returned if retbins=True.

Raises:

ValueError – If the geometry is not cylindrical or spherical.

Notes

The surface density averaging procedure for SPH is described in section 3.2.6 of Lodato & Price (2010) [1].

References