def _pdist(p):
        """ Return PL or ECPL instance based on parameters p """
        index, ref, ampl, cutoff, beta = p[:5]
        if cutoff == 0.0:
            pdist = models.PowerLaw(
                ampl * 1e30 * u.Unit("1/eV"), ref * u.TeV, index
            )
        else:
            pdist = models.ExponentialCutoffPowerLaw(
                ampl * 1e30 * u.Unit("1/eV"),
                ref * u.TeV,
                index,
                cutoff * u.TeV,
                beta=beta,
            )
        return pdist
def _pdist ( p ) : index , ref , ampl , cutoff , beta = p [ : 5 ] if cutoff == 0.0 : pdist = models . PowerLaw ( ampl * 1e30 * u . Unit ( "1/eV" ) , ref * u . TeV , index ) else : pdist = models . ExponentialCutoffPowerLaw ( ampl * 1e30 * u . Unit ( "1/eV" ) , ref * u . TeV , index , cutoff * u . TeV , beta = beta , ) return pdist
Return PL or ECPL instance based on parameters p