model.ClusterModel#

class model.ClusterModel(fields, properties=None, dm_virial=None, star_virial=None)[source]#

The model.ClusterModel class is a comprehensive representation of the cluster being modeled and can be used to generate accurate initial conditions. The class is predicated on a fixed number of sample radii in the cluster.

Parameters:
  • fields (dict of str: unyt.array.unyt_array) – The fields to attribute to the model.ClusterModel.

  • properties (dict) – Additional properties to pass into the model.ClusterModel instance. These are found in the model.ClusterModel.properties attribute. See the other parameters section for details on the available properties.

  • dm_virial (VirialEquilibrium, optional) – The virialization class to use for dark matter virialization. By default, it is None and will be set when necessary.

  • star_virial (VirialEquilibrium, optional) – The virialization class to use for stellar matter virialization. By default, it is None and will be set when necessary.

Notes

  • __getitem__ and __contains__ are aliased down to self.fields. There is no __setitem__, so index / key assignment cannot be done. use ClusterModel.set_field() instead.

Methods

__init__(fields[, properties, dm_virial, ...])

Initialize the model.ClusterModel instance.

check_dm_virial()

Equivalent to self.dm_virial.check_virial

check_hse()

Determine the deviation of the model from hydrostatic equilibrium.

check_star_virial()

Equivalent to self.star_virial.check_virial

correct([mode])

Correct the model.ClusterModel instance.

create_dataset(domain_dimensions[, ...])

find_field_at_radius(field, r)

Find the value of a field in the profiles at radius r.

find_radius_for_density(density)

Determine the radius at which the model reaches the specified density

from_arrays(fields[, stellar_density])

Initialize the model.ClusterModel from fields alone.

from_dens_and_entr(rmin, rmax, density, entropy)

Construct the model from density and entropy.

from_dens_and_tden(rmin, rmax, density, ...)

Construct a hydrostatic equilibrium model using gas density and total density profiles

from_dens_and_temp(rmin, rmax, density, ...)

Construct a hydrostatic equilibrium model using gas density and temperature profiles.

from_h5_file(filename[, r_min, r_max])

Initialize a model.ClusterModel instance from HDF5 file.

generate_dm_particles(num_particles[, ...])

Generate a set of dark matter particles in virial equilibrium.

generate_gas_particles(num_particles[, ...])

Generate a set of gas particles in hydrostatic equilibrium.

generate_star_particles(num_particles[, ...])

Generate a set of star particles in virial equilibrium.

generate_tracer_particles(num_particles[, ...])

Generate a set of tracer particles based on the gas distribution.

items()

Equivalent to self.fields.items()

keys()

Equivalent to self.fields.keys()

mass_in_radius(radius)

Determine the mass within a given radius.

no_gas(rmin, rmax, total_density[, ...])

Initialize a model.ClusterModel which is composed only of collisionless species.

panel_plot([fields, r_min, r_max, fig, ...])

Plot all of the selected fields in a grid of axes.

plot(field[, r_min, r_max, fig, ax, defaults])

Plot a field vs radius from this model using Matplotlib.

set_field(name, value)

Set a field with name name to value value, which is an unyt_array.

set_magnetic_field_from_beta(beta[, gaussian])

Set a magnetic field radial profile from a plasma beta parameter, assuming beta = p_th/p_B.

set_magnetic_field_from_density(B0[, eta, ...])

Set a magnetic field radial profile assuming it is proportional to some power of the density, usually 2/3.

set_rmax(r_max)

Truncate the model at a specified maximal radius.

values()

Equivalent to self.fields.values()

write_model_to_ascii(output_filename[, ...])

Write the equilibrium model to an ascii text file.

write_model_to_binary(output_filename[, ...])

Write the model to unformatted Fortran binary.

write_model_to_h5(output_filename[, in_cgs, ...])

Write the equilibrium model to an HDF5 file.

Attributes

default_fields

The default included fields that can be accessed.

dm_virial

The virial.VirialEquilibrium instance associated with the dark matter virialization process.

is_physical

Determines if the model.ClusterModel instance is physically realizable.

properties

The properties of the model.ClusterModel instance.

star_virial

The virial.VirialEquilibrium instance associated with the stellar virialization process.

fields

The fields associated with the Potential object.

num_elements

The number of elements in each field array.