sarracen.disc.scale_height
- sarracen.disc.scale_height(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 scale height, H/R, of the disc.
The scale height, H/R, is computed by segmenting the particles into radial bins (rings) and calculating the angular momentum profile of the disc. Each particle takes the dot product of its position vector with the angular momentum vector of its corresponding bin. The standard deviation of this result per bin yields the scale height profile of the disc, which is divided by the midpoint radius of each bin.
- 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 scale height, H, profile.
array, optional – The midpoint values of each bin. Only returned if retbins=True.
- Raises:
ValueError – If the geometry is not cylindrical or spherical.
See also
angular_momentum()Calculate the disc angular momentum profile.