Partition a light curve with the Bayesian Block algorithm
The functions implemented here are:
get_bb_partition to perform a BB partition. It requires a "fitness" function to perform an evaluation of the
likelihoods for a set of sequential cells. There are two such, using the number of counts, and the Kerr likelihood. See the Bayesian Block reference.
CountFitness(lc, p0=0.05) :: FitnessFunc
Adapted version of a astropy.stats.bayesian_blocks.FitnessFunc
Considerably modified to give the fitness function access to the cell data.
Implements the Event model using exposure instead of time.
LikelihoodFitness(lc, p0=0.05, npt=50) :: CountFitness
Fitness function that uses the full likelihood
doc_countfitness(fitness, light_curve_dict, source_name)
{class_name} test with source {source_name}
Create object: bbfitter = {class_name}(lc)
Object description: {bbfitter}
Then bbfitter({n}) returns the values
{values}
Finally, the partition algorithm, 'bbfitter.fit()' returns {cffit}
get_bb_partition(config, lc, fitness_class=LikelihoodFitness, p0=0.05, key=None, clear=False)
Perform Bayesian Block partition of the cells found in a light curve
- lc : input LightCurve object or DataFrame with fit cells
- fitness_class
return edges for partition