result.xresult¶
Module for encoding simulation results and processed data.
XResult
¶
Result of simulations.
A wrapper around xr.Dataset which adds unit support via dictionary lookups.
Initialize XResult.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xdataset
|
Dataset
|
Dataset with the simulation results. |
required |
uinfo
|
UnitsInformation | None
|
Units information for the variables in the dataset. |
None
|
dim_mean
¶
Get mean over all added dimensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Variable key. |
required |
Returns:
| Type | Description |
|---|---|
Quantity
|
Mean values with units. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the key does not exist in the result. |
dim_std
¶
Get standard deviation over all added dimensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Variable key. |
required |
Returns:
| Type | Description |
|---|---|
Quantity
|
Standard deviation values with units. |
dim_min
¶
Get minimum over all added dimensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Variable key. |
required |
Returns:
| Type | Description |
|---|---|
Quantity
|
Minimum values with units. |
dim_max
¶
Get maximum over all added dimensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Variable key. |
required |
Returns:
| Type | Description |
|---|---|
Quantity
|
Maximum values with units. |
from_dfs
classmethod
¶
Create XResult from DataFrames.
Structure is based on the underlying scans.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dfs
|
list[DataFrame]
|
DataFrames of the individual simulations. |
required |
scan
|
ScanSim | None
|
Scan defining the additional dimensions. |
None
|
uinfo
|
UnitsInformation | None
|
Units information. |
None
|
Returns:
| Type | Description |
|---|---|
XResult
|
XResult combining the DataFrames. |
to_netcdf
¶
Store results as netcdf.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path_nc
|
str | Path
|
Path to the netCDF file. |
required |
is_timecourse
¶
Check if timecourse.
Returns:
| Type | Description |
|---|---|
bool
|
True if the result is a single timecourse. |
to_mean_dataframe
¶
Convert to DataFrame with mean data.
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with the mean over all dimensions. |
to_dataframe
¶
Convert to DataFrame.
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with flattened data. |
to_tsv
¶
Write data to tsv.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path_tsv
|
str | Path
|
Path to the TSV file. |
required |