sarracen.disc.azimuthal_average
- sarracen.disc.azimuthal_average(data: SarracenDataFrame, target: str, 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 profile for a target quantity.
The profile is computed by segmenting the particles into radial bins (rings) and taking the mean of the target quantity from the particles within each bin.
- Parameters:
data (SarracenDataFrame) – Particle data, in a SarracenDataFrame.
target (str) – Column label of the target smoothing data.
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 averaged profile.
array, optional – The midpoint values of each bin. Only returned if retbins=True.
- Raises:
ValueError – If the geometry is not cylindrical or spherical.