nbodykit.source.mesh.bigfile

Classes

BigFileMesh(path, dataset[, comm]) A MeshSource object that reads a mesh from disk using bigfile.
class nbodykit.source.mesh.bigfile.BigFileMesh(path, dataset, comm=None, **kwargs)[source]

A MeshSource object that reads a mesh from disk using bigfile.

This can read meshes that have been stored with the save() function of MeshSource objects.

Parameters:
  • path (str) – the name of the file to load
  • dataset (str) – the name of the dataset in the Bigfile holding the grid
  • comm (MPI.Communicator) – the MPI communicator
  • **kwargs – extra meta-data to be stored in the attrs dict

Attributes

actions A list of actions to apply to the density field when interpolating to the mesh.
attrs A dictionary storing relevant meta-data about the CatalogSource.

Methods

apply(func[, kind, mode]) Return a view of the mesh, with actions updated to
paint([mode, Nmesh]) Paint the density on the mesh and apply any transformation functions specified in actions.
preview([axes, Nmesh, root]) Gather the mesh into as a numpy array, with (reduced) resolution.
save(output[, dataset, mode]) Save the mesh as a BigFileMesh on disk, either in real or complex space.
to_complex_field() Return the ComplexField stored on disk.
to_field([mode, out]) Return the mesh as a pmesh Field object, either in Fourier space or configuration space, based on mode.
to_real_field() Return the RealField stored on disk.
view() Return a “view” of the MeshSource, in the spirit of numpy’s ndarray view.
to_complex_field()[source]

Return the ComplexField stored on disk.

Note

The mesh stored on disk must be stored with mode=complex

Returns:real – an array-like object holding the mesh loaded from disk in Fourier space
Return type:pmesh.pm.ComplexField
to_real_field()[source]

Return the RealField stored on disk.

Note

The mesh stored on disk must be stored with mode=real

Returns:real – an array-like object holding the mesh loaded from disk in configuration space
Return type:pmesh.pm.RealField