Likelihood#
- class asteca.Likelihood(my_cluster: Cluster, lkl_name: str = 'plr', bin_method: str = 'knuth')#
Bases:
object
Define a
Likelihood
object.This object is used to assess how similar your observed cluster is, stored in a
asteca.Cluster
object, compared to a given synthetic cluster, generated by theasteca.Synthetic.generate()
method.- Parameters:
my_cluster (Cluster) –
asteca.Cluster
object with the loaded data for the observed clusterlkl_name (str) – Currently only the Poisson likelihood ratio (
plr
) defined in Tremmel et al. (2013) is accepted, defaults toplr
bin_method (str) – Bin method used to split the color-magnitude diagram into cells (Hess diagram); one of:
knuth, blocks, scott, freedman or fixed
. See Choosing Histogram Bins in astropy documentation for details on theknuth, blocks, scott, freedman
methods. The methodfixed
uses (15, 10) bins in magnitude and color(s) respectively. Defaults toknuth
- Raises:
ValueError – If any of the attributes is not recognized as a valid option
Methods Summary
get
(synth_clust)Evaluate the selected likelihood function.
Methods Documentation
- get(synth_clust: ndarray) float #
Evaluate the selected likelihood function.
- Parameters:
synth_clust (np.ndarray) – Array containing the synthetic cluster data. The shape of this array is assumed to be be:
[magnitude, color1, (color2)]
, wheremagnitude
andcolor
are arrays with the synthetic magnitude and color photometric data (color2
is the optional second color defined) If the array contains any extra columns beyond these they will be ignored.- Raises:
ValueError – If the likelihood function is not recognized
- Returns:
Likelihood value
- Return type:
float