gcfit.core.Model#

class gcfit.core.Model(W0, M, rh, g=1.5, delta=0.45, ra=100000000.0, a1=1.3, a2=2.3, a3=2.3, BHret=1.0, d=5, s2=0.0, F=1.0, *, observations=None, age=None, FeH=None, m_breaks=[0.1, 0.5, 1.0, 100], nbins=[5, 5, 20], tracer_masses=None, tcc=0.0, NS_ret=0.1, BH_ret_int=1.0, natal_kicks=True, esc_rate=0.0, vesc=90.0, meanmassdef='global', ode_maxstep=10000000000.0, ode_rtol=1e-07)#

Wrapper class around a LIMEPY model, including mass function evolution.

Multimass globular cluster model implemented as a subclass around a limepy.limepy model, as defined by the input parameters, while including support for initial mass function evolution (through ssptools), units (through astropy.Quantity), tracer masses and enhanced metadata and mass results.

The cluster mass function is evolved from it’s initial mass function using fixed integration settings alongside the cluster’s age, metallicity, escape velocity and mass-loss rates and fractions, either as given during initilization or as defined in the metadata of a given Observations. The resulting mass bins are arranged correctly, and have any possibly required (by the Observations) or desired tracer masses added, before being used to solve the Limepy distribution function.

The first 13 arguments are the main model parameters, which are used by the FittableModel as well. Most other arguments provide more fine control over the mass evolution algorithm and DF ODE solver.

Note carefully the units required in some of the parameters here, which may not be the same as in other classes (such as FittableModel). Quantity objects, from astropy, can also be given in most cases to ensure the units are handled correctly.

Parameters:
W0float or astropy.Quantity

The (dimensionless) central potential. Used as a boundary condition for solving Poisson’s equation and defines how centrally concentrated the model is.

Mfloat or astropy.Quantity

The total mass of the system, in all mass components, in Msun.

rhfloat or astropy.Quantity

The system half-mass radius, in parsecs.

gfloat, optional

The truncation parameter, which controls the sharpness of the outer density truncation of the model. No finite models exist outside 0 <= g < 3.5. Defaults to 1.5.

deltafloat, optional

Sets the mass dependance of the velocity scale for each mass component. Increased value of delta (usually up to ~0.5) indicate an increased degree of mass segregation present in the system. Defaults to 0.45.

rafloat or astropy.Quantity, optional

The (dimensionless) anisotropy-radius, which determines the amount of anisotropy in the system, with higher ra values indicating more isotropy. This quantity is scaled based on the given rh in physical units.

a1float, optional

The low-mass IMF exponent (representing masses between m_breaks[0:2]). Defaults to 1.3, matching Kroupa (2001).

a2float, optional

The intermediate-mass IMF exponent (representing masses between m_breaks[1:3]). Defaults to 2.3, matching Kroupa (2001).

a3float, optional

The high-mass IMF exponent (representing masses between m_breaks[2:4]). Defaults to 2.3, matching Kroupa (2001).

BHretfloat, optional

The black hole retention fraction, representing the percentage (between 0 and 100) of black holes retained after dynamical ejections and natal kicks.

dfloat or astropy.Quantity, optional

Distance to the cluster, from Earth, in kiloparsecs. Mainly used for any conversions between observational (angular) and model (linear) units, and thus mostly only required for comparing with observations. Defaults to an arbitrary distance of 5 kpc.

s2float, optional

Nuisance parameter applied as an additional unknown uncertainty to all number density profiles, allowing for small deviations between the outer parts of the model and observations. Only used for comparing with observations, not required otherwise Defaults to 0.

Ffloat, optional

Nuisance parameter applied as an additional scaling (F >= 1) factor on the uncertainty in all mass function profiles, encapsulating possible additional sources of error. Only used for comparing with observations, not required otherwise. Defaults to 1.

observationsObservations, optional

The Observations instance corresponding to this cluster. While not necessary for solving a model which is not meant for comparison to the data, a number of optional parameters can be read from the metadata of a given Observations instance, such as age and metallicity, and thus would not need to be provided here.

agefloat or astropy.Quantity, optional

The current age of the system, in Gyrs. This age is used by the mass evolution algorithm to determine which of the initial stars, as defined by the IMF, will have evolved into remnants by the present day. If no observations are given, this quantity must be supplied, otherwise an attempt will be made to read the age from the observations.

FeHfloat, optional

The cluster metallicity, in solar fraction [Fe/H]. This is used by the mass evolution algorithm to determine the final masses of the remnants formed over the evolution of the cluster. If no observations are given, this quantity must be supplied, otherwise an attempt will be made to read the metallicity from the observations.

m_breaks(4,) numpy.ndarray or astropy.Quantity, optional

The IMF break-masses (including outer bounds) in Msun, defining the mass ranges of each IMF exponent. Defaults to [0.1, 0.5, 1.0, 100].

nbins(3,) numpy.ndarray of int, optional

Number of mass bins in each regime of the IMF, as defined by m_breaks. This number of bins will be log-spaced between each of the break masses. Defaults to [5, 5, 20].

tracer_masseslist of float, optional

A list of tracer (individual) masses to add to the model, each with a negligible total mass. These will be added on top of any tracer masses possibly required by the observations. Defaults to adding no tracer mass bins, except those in a given observations.

tccfloat, optional

Core collapse time, in years. Defaults to 0, effectively being ignored.

NS_retfloat, optional

Neutron star retention fraction (0 to 1). Defaults to 0.1 (10%).

BH_ret_intfloat, optional

Initial black hole retention fraction (0 to 1). Defaults to 1 (100%).

natal_kicksbool, optional

Whether to account for natal kicks in the BH dynamical retention. Defaults to True.

esc_ratefloat or callable, optional

Represents rate of change of stars over time due to tidal ejections (and other escape mechanisms). Regulates low-mass object depletion (ejection) due to dynamical evolution. See ssptools.EvolvedMF for more information. Likely should not be used unless you know what you’re doing. Defaults to 0.

vescfloat or astropy.Quantity, optional

Initial cluster escape velocity, in km/s, for use in the computation of the effects of BH natal kick. Defaults to 90 km/s. Stored as vesc0.

meanmassdef{‘global’, ‘central’}, optional

Definition of the mean mass \(\bar{m}\) used to define the dimensionless mass of each component (\(\mu_j = m_j/\bar{m}\)). See Eqn. 26 of Gieles & Zocchi (2015) for more details. Defaults to ‘global’, i.e. the unweighted mean mass of all stars over the entire system.

ode_maxstepfloat, optional

Maximum step size for the limepy ODE integrator. Defaults to 1e10.

ode_rtolfloat, optional

Relative tolerance parameter for the limepy ODE integrator. Defaults to 1e-7.

Attributes:
mjastropy.Quantity

Array containing the individual mass in all mass bins, including both stars and remnants, at the given age.

Mjastropy.Quantity

Array containing the total mass in all mass bins, including both stars and remnants, at the given age.

Njastropy.Quantity

Array containing the total number in all mass bins, including both stars and remnants, at the given age.

mbin_widthsastropy.Quantity

The width of each mass bin, in Msun.

nmsint

The number of mass bins containing main sequence stars. The first nms mass bins will be the star bins (i.e. mj[:nms-1])

nmrint

The number of mass bins containing remnants. The proceeding nmr mass bins will be the remnant bins (i.e. mj[nms-1:nms + nmr])

star_typesnumpy.ndarray

Array of 2-character strings representing the type of object in each mass bin (MS, WD, NS, BH).

{MS,BH,NS,WD}collections.namedtuple

Named tuple (_attributes) containing the mean bin mass (mj), total bin mass (Mj), total bin number (Nj), average mass (mavg), system and surface density profiles (rhoj, Sigmaj), mass fraction (f) and half-mass radius (rh), for all main sequence (MS), black hole (BH), neutron star (NS) and white dwarf (WD) object types. Essentially provides easy access to these quantities for each of the different object types as defined by the star_types array.

rastropy.Quantity

The projected radial distances, in pc, from the centre of the cluster, defining the domain used in all other model profiles.

phi, phijastropy.Quantity

System (total, per mass bin) potential as a function of distance from the centre of the cluster.

rho, rhojastropy.Quantity

System (total, per mass bin) density as a function of distance from the centre of the cluster.

vescastropy.Quantity

Escape velocity of the system (at the present day) as a function of distance from the centre of the cluster, as given by \(\sqrt{2 |\phi(r)|}\).

v2, v2jastropy.Quantity

System (total, per mass bin) mean-square velocity as a function of distance from the centre of the cluster.

v2r, v2rj, v2t, v2tjastropy.Quantity

Radial and Tangential components of the (total, per mass bin) mean-square velocity, in the plane of the sky, as a function of distance from the centre of the cluster.

r0, rh, rv, rt, ra, rhpastropy.Quantity

The total (King, half-mass, virial, truncation, anisotropy, projected half-mass) radius of the cluster.

r0j, rhj, raj, rhpjastropy.Quantity

The per mass bin (King, half-mass, anisotropy, projected half-mass) radius of the cluster.

See also

limepy

Distribution-function model base of this class.

Methods

__init__(W0, M, rh[, g, delta, ra, a1, a2, ...])

canonical(W0, M, rh[, imf])

Initialize with an IMF defined by a canonical IMF formulation.

df(*arg)

Returns the value of the normalised DF at a given position in phase space, can only be called after solving Poisson's equation

get_Paz(az_data, R_data, jns)

Computes probability of line of sight acceleration at projected R : P(az|R)

get_visualizer()

Return a analysis.ModelVisualizer instance based on this model.

interp_phi(r)

Returns interpolated potential at r, works on scalar and arrays

isotropic(W0, M, rh, **kw)

Initialize the model with max ra, leading to an isotropic model.

king(W0, M, rh, **kw)

Initialize a King (1966) Model (g=1 and isotropic).

legendre_Ul(l, theta)

michieking(W0, M, rh, **kw)

Initialize a Michie-King (1963) Model (g=1 and anisotropic).

sample(*args, **kwargs)

Return a SampledModel instance based on this model.

wilson(W0, M, rh, **kw)

Initialize a Wilson (1975) Model (g=2 and isotropic).

woolley(W0, M, rh, **kw)

Initialize a Woolley (1954) Model (g=0 and isotropic).

classmethod canonical(W0, M, rh, imf='kroupa', **kw)#

Initialize with an IMF defined by a canonical IMF formulation.

Initializes a base Model with specific IMF break masses and power law slopes, corresponding to a given IMF choice.

The available IMFs are Kroupa (2002), Salpeter (1955) and Baumgardt et al. (2023).

Parameters:
W0float or astropy.Quantity

The (dimensionless) central potential.

Mfloat or astropy.Quantity

The total mass of the system, in all mass components, in Msun.

rhfloat or astropy.Quantity

The system half-mass radius, in parsecs.

imf{“kroupa”, “salpeter”, “baumgardt”}, optional

The canonical IMF to use.

get_visualizer()#

Return a analysis.ModelVisualizer instance based on this model.

classmethod isotropic(W0, M, rh, **kw)#

Initialize the model with max ra, leading to an isotropic model.

classmethod king(W0, M, rh, **kw)#

Initialize a King (1966) Model (g=1 and isotropic).

classmethod michieking(W0, M, rh, **kw)#

Initialize a Michie-King (1963) Model (g=1 and anisotropic).

sample(*args, **kwargs)#

Return a SampledModel instance based on this model.

classmethod wilson(W0, M, rh, **kw)#

Initialize a Wilson (1975) Model (g=2 and isotropic).

classmethod woolley(W0, M, rh, **kw)#

Initialize a Woolley (1954) Model (g=0 and isotropic).