Provides the utilities required to load NBF files from Pegasus++.

This module provides: - PegasusNBFData: A class for holding the data loaded from a NBF file - _load_nbf: A function for loading NBF files

class pegasustools.loading_nbf.PegasusNBFData(file_path)

Bases: object

Holds all the data loaded when loading a NBF file.

It stores all the header data into private variables that are accessible via getters and stores the data arrays in a dictionary named data which is indexed via the variable field names in the NBF file.

Parameters:

file_path (Path)

property big_endian: bool

Get the endianness of the NBF file.

Returns:

The endianness of the NBF file. True if the data is big endian, False otherwise.

Return type:

bool

property list_of_variables: list[str]

Get the list of variables in the NBF file.

Returns:

The list of variables in the NBF file.

Return type:

list[str]

property mesh_params: dict[str, float32 | int]

Get the mesh parameters in the NBF file.

Returns:

The mesh parameters in the NBF file.

Return type:

dict[str, np.float32 | int]

property meshblock_params: dict[str, int]

Get the mesh block parameters in the NBF file.

Returns:

The mesh block parameters in the NBF file.

Return type:

dict[str, int]

property num_meshblocks: int

Get the number of mesh blocks in the NBF file.

Returns:

The number of mesh blocks in the NBF file.

Return type:

int

property num_variables: int

Get the number of variables in the NBF file.

Returns:

The number of variables/fields in the NBF file.

Return type:

int

property time: float64

Get the simulation time of the NBF file.

Returns:

The time in the NBF file

Return type:

np.float64