예제 #1
0
    def evaluate(self, x, F, piv, index, a, b):

        if isinstance(x, astropy_units.Quantity):
            index_ = index.value
            F_ = F.value
            piv_ = piv.value
            x_ = x.value
            a_ = a.value
            b_ = b.value

            yunit_ = self.y_unit
            xunit_ = self.x_unit

        else:
            yunit_ = 1.0
            xunit_ = 1.0
            F_, piv_, x_, index_, a_, b_ = F, piv, x, index, a, b

        intflux = nb_func.plf_eval(piv_, index_, a_, b_)

        norm = (F_ / (intflux) ) * erg2keV

        out = nb_func.plaw_eval(x_, 1., index_, piv_)

        return norm * out * yunit_
예제 #2
0
    def evaluate(self, x, K, piv, index):

        if isinstance(x, astropy_units.Quantity):
            index_ = index.value
            K_ = K.value
            piv_ = piv.value
            x_ = x.value

            unit_ = self.y_unit

        else:
            unit_ = 1.0
            K_, piv_, x_, index_ = K, piv, x, index

        result = nb_func.plaw_eval(x_, K_, index_, piv_)

        return result * unit_
예제 #3
0
    def evaluate(self, x, F, index, a, b):

        if isinstance(x, astropy_units.Quantity):
            index_ = index.value
            F_ = F.value
            a_ = a.value
            b_ = b.value
            x_ = x.value

            yunit_ = self.y_unit
            xunit_ = self.x_unit

        else:
            yunit_ = 1.0
            xunit_ = 1.0
            F_,  x_, index_, a_, b_ = F, x, index, a, b

        gp1 = index_ + 1

        norm = F_ * gp1 / (((b_)**gp1 - (a_)**gp1)  ) 

        return  norm * nb_func.plaw_eval(x_, F_, index_, 1.) * yunit_