COSILike (3ML plugin)

ThreeML plugin

class cosipy.threeml.COSILike(*args: Any, **kwargs: Any)[source]

COSI 3ML plugin.

Parameters:
  • name (str) – Plugin name e.g. “cosi”. Needs to have a distinct name with respect to other plugins in the same analysis

  • dr (str) – Path to full detector response

  • data (histpy.Histogram) – Binned data. Note: Eventually this should be a cosipy data class

  • bkg (histpy.Histogram) – Binned background model. Note: Eventually this should be a cosipy data class

  • sc_orientation (cosipy.spacecraftfile.SpacecraftFile) – Contains the information of the orientation: timestamps (astropy.Time) and attitudes (scoord.Attitude) that describe the spacecraft for the duration of the data included in the analysis

  • nuisance_param (astromodels.core.parameter.Parameter, optional) – Background parameter

  • coordsys (str, optional) – Coordinate system (‘galactic’ or ‘spacecraftframe’) to perform fit in, which should match coordinate system of data and background. This only needs to be specified if the binned data and background do not have a coordinate system attached to them

  • precomputed_psr_file (str, optional) – Full path to precomputed point source response in Galactic coordinates

set_model(model)[source]

Set the model to be used in the joint minimization.

Parameters:

model (astromodels.core.model.Model) – Any model supported by astromodels

get_log_like()[source]

Calculate the log-likelihood.

Returns:

log_like – Value of the log-likelihood

Return type:

float

inner_fit()[source]

Required for 3ML fit.

set_inner_minimization(flag: bool)[source]

Turn on the minimization of the internal COSI (nuisance) parameters.

Parameters:

flag (bool) – Turns on and off the minimization of the internal parameters