nbodykit.source.mesh.field

Classes

FieldMesh(field) A MeshSource initialized from an in-memory Field object, either a pmesh.pm.RealField or pmesh.pm.ComplexField.
class nbodykit.source.mesh.field.FieldMesh(field)[source]

A MeshSource initialized from an in-memory Field object, either a pmesh.pm.RealField or pmesh.pm.ComplexField.

Note

The original field object is never modified by this source.

Parameters:
  • field (RealField, ComplexField) – the pmesh Field object, either of real or complex type
  • Nmesh (int, 3-vector of int, optional) – the desired number of cells per size on the mesh. If this is different than the Nmesh of the input Field, the Field will be re-sampled

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 a copy of the (possibly re-sampled) input ComplexField
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 a copy of the (possibly re-sampled) input RealField
view() Return a “view” of the MeshSource, in the spirit of numpy’s ndarray view.
to_complex_field()[source]

Return a copy of the (possibly re-sampled) input ComplexField

to_real_field()[source]

Return a copy of the (possibly re-sampled) input RealField