pyrokinetics.pyroscan.PyroScanGKOutput#

class pyrokinetics.pyroscan.PyroScanGKOutput(dataset, norms=None)[source]#

Bases: DatasetWrapper

Parameters:

dataset (xr.Dataset)

__init__(dataset, norms=None)[source]#
Parameters:

dataset (Dataset)

Methods

__init__(dataset[, norms])

convert_physical_units(norms)

Replace physical units on data_vars and coords with the generic simulation units of norms.

from_netcdf(path, *args[, ...])

Initialise self.data from a netCDF file.

to(norms, *contexts)

to_netcdf(*args, **kwargs)

Serialise to netCDF.

unwrap()

Return the underlying xarray.Dataset.

Attributes

attrs

Redirects to underlying Xarray Dataset attrs.

coords

Redirects to underlying Xarray Dataset coords.

data

Property for managing the underlying Xarray Dataset.

data_vars

Redirects to underlying Xarray Dataset data_vars.

dims

Redirects to underlying Xarray Dataset dims.

sizes

Redirects to underlying Xarray Dataset sizes.

convert_physical_units(norms)[source]#

Replace physical units on data_vars and coords with the generic simulation units of norms. Needed before writing to netCDF so saved unit strings (e.g. nref_electron) are not tied to a particular pyro’s run-specific normalisation name.

Parameters:

norms (ConventionNormalisation)

to(norms, *contexts)[source]#
Parameters:

norms (ConventionNormalisation) – Normalisation convention to convert to

Return type:

GKOutput with units from norms

to_netcdf(*args, **kwargs)[source]#

Serialise to netCDF. Physical units are first converted to generic simulation units so the stored unit strings remain portable across pyro instances (which otherwise mint run-specific unit names).

Return type:

None

unwrap()[source]#

Return the underlying xarray.Dataset.