API reference¶
EXPtools.visuals
¶
- EXPtools.visuals.make_basis_plot(basis, savefile=None, nsnap='mean', y=0.92, dpi=200)¶
Plots the potential of the basis functions for different values of l and n.
- Parameters:
basis (object) – object containing the basis functions for the simulation savefile (str, optional): name of the file to save the plot as nsnap (str, optional): description of the snapshot being plotted
y (float (optional) – vertical position of the main title
dpi (int (optional)) – resolution of the plot in dots per inch
- Returns:
None
- Return type:
None
- EXPtools.visuals.find_field(basis, coefficients, time=0, xyz=(0, 0, 0), property='dens', include_monopole=True)¶
Finds the value of the specified property of the field at the given position.
- Parameters:
basis (object) – Object containing the basis functions for the simulation.
coefficients (oject) – Object containing the coefficients for the simulation.
time (float (optional)) – The time at which to evaluate the field. Default is 0.
xyz (tuple or list (optional)) – The (x, y, z) position at which to evaluate the field. Default is (0, 0, 0).
property (str (optional)) – The property of the field to evaluate. Can be ‘dens’, ‘pot’, or ‘force’. Default is ‘dens’.
include_monopole (bool (optional)) – Whether to return the monopole contribution to the property only. Default is True.
- Returns:
field – The value of the specified property of the field at the given position. If property is ‘force’, a list of three values is returned representing the force vector in (x, y, z) directions.
- Return type:
float or list
- Raises:
ValueError – If the property argument is not ‘dens’, ‘pot’, or ‘force’.:
- EXPtools.visuals.spherical_avg_prop(basis, coefficients, time=0, radius=array([1.00000000e-01, 6.15959596e+00, 1.22191919e+01, 1.82787879e+01, 2.43383838e+01, 3.03979798e+01, 3.64575758e+01, 4.25171717e+01, 4.85767677e+01, 5.46363636e+01, 6.06959596e+01, 6.67555556e+01, 7.28151515e+01, 7.88747475e+01, 8.49343434e+01, 9.09939394e+01, 9.70535354e+01, 1.03113131e+02, 1.09172727e+02, 1.15232323e+02, 1.21291919e+02, 1.27351515e+02, 1.33411111e+02, 1.39470707e+02, 1.45530303e+02, 1.51589899e+02, 1.57649495e+02, 1.63709091e+02, 1.69768687e+02, 1.75828283e+02, 1.81887879e+02, 1.87947475e+02, 1.94007071e+02, 2.00066667e+02, 2.06126263e+02, 2.12185859e+02, 2.18245455e+02, 2.24305051e+02, 2.30364646e+02, 2.36424242e+02, 2.42483838e+02, 2.48543434e+02, 2.54603030e+02, 2.60662626e+02, 2.66722222e+02, 2.72781818e+02, 2.78841414e+02, 2.84901010e+02, 2.90960606e+02, 2.97020202e+02, 3.03079798e+02, 3.09139394e+02, 3.15198990e+02, 3.21258586e+02, 3.27318182e+02, 3.33377778e+02, 3.39437374e+02, 3.45496970e+02, 3.51556566e+02, 3.57616162e+02, 3.63675758e+02, 3.69735354e+02, 3.75794949e+02, 3.81854545e+02, 3.87914141e+02, 3.93973737e+02, 4.00033333e+02, 4.06092929e+02, 4.12152525e+02, 4.18212121e+02, 4.24271717e+02, 4.30331313e+02, 4.36390909e+02, 4.42450505e+02, 4.48510101e+02, 4.54569697e+02, 4.60629293e+02, 4.66688889e+02, 4.72748485e+02, 4.78808081e+02, 4.84867677e+02, 4.90927273e+02, 4.96986869e+02, 5.03046465e+02, 5.09106061e+02, 5.15165657e+02, 5.21225253e+02, 5.27284848e+02, 5.33344444e+02, 5.39404040e+02, 5.45463636e+02, 5.51523232e+02, 5.57582828e+02, 5.63642424e+02, 5.69702020e+02, 5.75761616e+02, 5.81821212e+02, 5.87880808e+02, 5.93940404e+02, 6.00000000e+02]), property='dens')¶
Computes the spherically averaged value of the specified property of the field over the given radii.
- Parameters:
basis (object) – bject containing the basis functions for the simulation.
coefficients (object) – bject containing the coefficients for the simulation.
time (float (optional)) – The time at which to evaluate the field. Default is 0.
radius (ndarray (optional)) – An array of radii over which to compute the spherically averaged property. Default is an array of 100 values logarithmically spaced between 0.1 and 600.
property (str (optional)) – The property of the field to evaluate. Can be ‘dens’, ‘pot’, or ‘force’. Default is ‘dens’.
- Returns:
field_r (Array) – An array of spherically averaged values of the specified field over the given radii.
radius (array) – Radius at where the field is evaluated
Raises
ValueError – If the property argument is not ‘dens’, ‘pot’, or ‘force’.
EXPtools.utils
¶
- class EXPtools.utils.halo.ICHernquist(size)¶
Class to sample the positions of a Hernquist halo