ozzy.statistics
The statistics submodule encompasses functions that process particle data or otherwise synthesize data into lower-dimensional measures. A classic example is getting the centroid (mean transverse position) of a particle distribution.
charge_in_field_quadrants
§
charge_in_field_quadrants(
raw_ds,
fields_ds,
time_dim="t",
weight_var="q",
n0=None,
xi_var=None,
)
Calculate the amount of charge in different quadrants of the "field space". By quadrants we mean the four possible combinations of positive/negative longitudinal fields and positive/negative transverse fields.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Dataset
|
Dataset containing particle data. |
required |
|
Dataset
|
Dataset containing field data. Warning This function expects the |
required |
|
str
|
Name of the time dimension in the input datasets. Default is |
't'
|
|
str
|
Name of the variable representing particle weights or particle charge in |
'q'
|
|
float | None
|
Reference plasma density value, in \(\mathrm{cm}^{-3}\). If provided, the charge is converted to physical units. Default is None. |
None
|
|
str | None
|
Name of the variable representing the longitudinal axis. Required if |
None
|
Returns:
Name | Type | Description |
---|---|---|
charge_ds |
Dataset
|
Dataset containing the charge in different quadrants of the "field space". |
Raises:
Type | Description |
---|---|
ValueError
|
If the input datasets do not contain particle and grid data, respectively, or if |
field_space
§
field_space(raw_ds, fields_ds, spatial_dims=['x1', 'x2'])
Get values of fields in the cell where each particle is located (no interpolation is done).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Dataset
|
Dataset containing particle data. |
required |
|
Dataset
|
Dataset containing field data. |
required |
|
list[str]
|
List of spatial dimension names in the input datasets. Default is |
['x1', 'x2']
|
Returns:
Name | Type | Description |
---|---|---|
raw_ds |
Dataset
|
Dataset containing particle data with interpolated field values. |
Raises:
Type | Description |
---|---|
ValueError
|
If the input datasets contain a time dimension, or if the input datasets do not contain particle and grid data, respectively. |
Warning
This function assumes that the second element of spatial_dims
is the vertical dimension.