LoadPart.spectrum#

pyPLUTO.LoadPart.spectrum(self, var=None, scale='lin', check: bool = True, **kwargs) list[ndarray][source]#

Compute the spectrum of a given particle variable.

Parameters:
- density: bool, default False

If True, the histogram is normalized.

- nbins: int

The number of bins wanted for the histogram.

- scale: {‘lin’,’log’}, default ‘lin’

The scale of the histogram, linear or logarithmic.

- var: np.ndarray

The chosen variable for the histogram.

- vmin: float

The minimum value of the chosen variable.

- vmax: float

The maximum value of the chosen variable.

—-
Returns:
  • bins: np.ndarray

    The x1 array of the histogram.

  • hist: np.ndarray

    The x2 array of the histogram.

Examples

  • Example #1: Compute the spectrum of the particles velocity

    >>> import pyPLUTO as pp
    >>> D = pp.LoadPart(0)
    >>> v2 = D.vx1**2 + D.vx2**2 + D.vx3**2
    >>> pp.spectrum(v2, scale="log")