add the grav field

This commit is contained in:
rstiskalek 2022-11-30 13:41:35 +00:00
parent 6aa3721c83
commit 5435781e8d

View File

@ -199,6 +199,28 @@ class DensityField:
return MASL.tidal_tensor(delta, self.box._omega_m, self.box._aexp, return MASL.tidal_tensor(delta, self.box._omega_m, self.box._aexp,
"CIC") "CIC")
def gravitational_field(self, grid, verbose=True):
"""
Calculate the gravitational tensor field. Note that this method is
only defined in fork of `Pylians`.
Parameters
----------
grid : int
The grid size.
verbose : float, optional
A verbosity flag. By default `True`.
Returns
-------
grav_field_tensor : :py:class:`MAS_library.grav_field_tensor`
Tidal tensor object, whose attributes `grav_field_tensor.gi`
contain the relevant tensor components.
"""
delta = self.overdensity_field(grid, verbose)
return MASL.grav_field_tensor(
delta, self.box._omega_m, self.box._aexp, "CIC")
def smooth_field(self, field, scale, threads=1): def smooth_field(self, field, scale, threads=1):
""" """
Smooth a field with a Gaussian filter. Smooth a field with a Gaussian filter.