postgkyl.average¶
- postgkyl.average(data, dims, *, weight=None, inplace=False, tag=None, label=None)¶
int f w dx^dims / int w dx^dimsover the directions indims.- Parameters:
data – gkyl-backed (native modal) dataset in the modal value_form.
dims – iterable of 0-based direction indices to average over (repeat
--dimsat the CLI, e.g.--dims 0 --dims 1).weight – optional gkyl-backed dataset in the modal value_form, same
num_dims/basis_type/poly_orderasdataand exactly one field (gkyl_array_averagetakes no field-index argument) – the plain average (dividing by volume) is computed when omitted.inplace – Mutate and return
datafor partial averaging only.tag – Optional tag for a partial-average dataset.
label – Optional label for a partial-average dataset.
- Returns:
A float (one field) or NumPy array (multiple fields) containing the physical mean when every direction is averaged out. Otherwise a native modal dataset over the surviving dimensions. Dataset-only options
inplace,tag, andlabelapply only to partial averaging.- Raises:
ValueError –
data(orweight) is NumPy-backed or non-modal, is missing basis metadata, orweight’s grid/basis doesn’t matchdata’s, or dataset-only options are used for a full average.