Esempio n. 1
0
 def __init__(self, name="Bremsstrahlung"):
     self.name = name
     self.n0 = Parameter(
         name, "n0", 1, min=0, max=1e20, frozen=True, units="1/cm3"
     )
     self.weight_ee = Parameter(
         name, "weight_ee", 1.088, min=0, max=10, frozen=True
     )
     self.weight_ep = Parameter(
         name, "weight_ep", 1.263, min=0, max=10, frozen=True
     )
     # add ECPL params
     super(Bremsstrahlung, self).__init__(name=name)
     # Initialize model
     ArithmeticModel.__init__(
         self,
         name,
         (
             self.index,
             self.ref,
             self.ampl,
             self.cutoff,
             self.beta,
             self.n0,
             self.weight_ee,
             self.weight_ep,
             self.distance,
             self.verbose,
         ),
     )
     self._use_caching = True
     self.cache = 10
Esempio n. 2
0
 def __init__(self, name='IC'):
     self.TFIR = Parameter(name, 'TFIR', 30, min=0, frozen=True, units='K')
     self.uFIR = Parameter(name,
                           'uFIR',
                           0.0,
                           min=0,
                           frozen=True,
                           units='eV/cm3'
                          )  # , 0.2eV/cm3 typical in outer disk
     self.TNIR = Parameter(name, 'TNIR', 3000, min=0, frozen=True, units='K')
     self.uNIR = Parameter(name,
                           'uNIR',
                           0.0,
                           min=0,
                           frozen=True,
                           units='eV/cm3'
                          )  # , 0.2eV/cm3 typical in outer disk
     # add ECPL params
     super(InverseCompton, self).__init__(name=name)
     # Initialize model
     ArithmeticModel.__init__(self, name,
                              (self.index, self.ref, self.ampl, self.cutoff,
                               self.beta, self.TFIR, self.uFIR, self.TNIR,
                               self.uNIR, self.distance, self.verbose))
     self._use_caching = True
     self.cache = 10
Esempio n. 3
0
 def __init__(self, name='normbeta1d'):
     self.pos = Parameter(name, 'pos', 0)
     self.width = Parameter(name, 'width', 1, tinyval, hard_min=tinyval)
     self.index = Parameter(name, 'index', 2.5, 0.5, 1000, 0.5)
     self.ampl = Parameter(name, 'ampl', 1, 0)
     ArithmeticModel.__init__(self, name,
                              (self.pos, self.width, self.index, self.ampl))
Esempio n. 4
0
 def __init__(self, name='edge'):
     self.space = Parameter(name, 'space', 0, 0, 1, 0, 1,
                            '0 - energy | 1 - wave')
     self.thresh = Parameter(name, 'thresh', 1, 0, hard_min=0)
     self.abs = Parameter(name, 'abs', 1, 0)
     ArithmeticModel.__init__(self, name,
                              (self.space, self.thresh, self.abs))
Esempio n. 5
0
 def __init__(self, name='linebroad'):
     self.ampl = Parameter(name, 'ampl', 1, 0, hard_min=0)
     self.rest = Parameter(name, 'rest', 1000, tinyval, hard_min=tinyval)
     self.vsini = Parameter(name, 'vsini', tinyval, tinyval,
                            hard_min=tinyval)
     ArithmeticModel.__init__(self, name,
                              (self.ampl, self.rest, self.vsini))
Esempio n. 6
0
    def __init__(self, name='brokenpowerlaw'):
        self.refer = Parameter(name, 'refer', 5000., tinyval, hard_min=tinyval, frozen=True, units="angstroms")
        self.ampl = Parameter(name, 'ampl', 1., tinyval, hard_min=tinyval, units="angstroms")
        self.index1 = Parameter(name, 'index1', 0.1, -10.0, 10.0)
        self.index2 = Parameter(name, 'index2', -0.1, -10.0, 10.0)

        ArithmeticModel.__init__(self, name, (self.refer, self.ampl, self.index1, self.index2))
Esempio n. 7
0
 def __init__(self, name='beta1d'):
     self.r0 = Parameter(name, 'r0', 1, tinyval, hard_min=tinyval)
     self.beta = Parameter(name, 'beta', 1, 1e-05, 10, 1e-05, 10)
     self.xpos = Parameter(name, 'xpos', 0, 0, frozen=True)
     self.ampl = Parameter(name, 'ampl', 1, 0)
     ArithmeticModel.__init__(self, name,
                              (self.r0, self.beta, self.xpos, self.ampl))
Esempio n. 8
0
    def __init__(self, name='recombination'):
        self.refer = Parameter(name, 'refer', 5000., tinyval, hard_min=tinyval, frozen=True, units="angstroms")
        self.ampl = Parameter(name, 'ampl', 1., tinyval, hard_min=tinyval, units="angstroms")
        self.temperature = Parameter(name, 'temperature', 3000., tinyval, hard_min=tinyval, units="Kelvin")
        self.fwhm = Parameter(name, 'fwhm', 100., tinyval, hard_min=tinyval, units="km/s")

        ArithmeticModel.__init__(self, name, (self.refer, self.ampl, self.temperature, self.fwhm))
Esempio n. 9
0
 def __init__(self, name="IC"):
     self.name = name
     self.TFIR = Parameter(name, "TFIR", 30, min=0, frozen=True, units="K")
     self.uFIR = Parameter(
         name, "uFIR", 0.0, min=0, frozen=True, units="eV/cm3"
     )  # , 0.2eV/cm3 typical in outer disk
     self.TNIR = Parameter(
         name, "TNIR", 3000, min=0, frozen=True, units="K"
     )
     self.uNIR = Parameter(
         name, "uNIR", 0.0, min=0, frozen=True, units="eV/cm3"
     )  # , 0.2eV/cm3 typical in outer disk
     # add ECPL params
     super(InverseCompton, self).__init__(name=name)
     # Initialize model
     ArithmeticModel.__init__(
         self,
         name,
         (
             self.index,
             self.ref,
             self.ampl,
             self.cutoff,
             self.beta,
             self.TFIR,
             self.uFIR,
             self.TNIR,
             self.uNIR,
             self.distance,
             self.verbose,
         ),
     )
     self._use_caching = True
     self.cache = 10
Esempio n. 10
0
 def __init__(self, name='shell2d'):
     self.xpos = Parameter(name, 'xpos', 0) # p[0]
     self.ypos = Parameter(name, 'ypos', 0) # p[1]
     self.ampl = Parameter(name, 'ampl', 1) # p[2]
     self.r0 = Parameter(name, 'r0', 1, 0) # p[3]
     self.width = Parameter(name, 'width', 0.1, 0)
     ArithmeticModel.__init__(self, name, (self.xpos, self.ypos, self.ampl, self.r0, self.width))
Esempio n. 11
0
    def __init__(self, name='absorptionedge'):
        self.edgew = Parameter(name, 'edgew', 5000., tinyval, frozen=True, units='angstroms')
        self.tau = Parameter(name, 'tau', 0.5)
        self.index = Parameter(name, 'index', 3.0, alwaysfrozen=True,
                               hidden=True)

        ArithmeticModel.__init__(self, name,
                                 (self.edgew, self.tau, self.index))
Esempio n. 12
0
    def __init__(self, name='absorptionlorentz'):

        self.fwhm = Parameter(name, 'fwhm', 100., tinyval, hard_min=tinyval, 
                              units="km/s")
        self.pos = Parameter(name, 'pos', 5000., tinyval, frozen=True, units='angstroms')
        self.ewidth = Parameter(name, 'ewidth', 1.)

        ArithmeticModel.__init__(self, name, (self.fwhm, self.pos, self.ewidth))
Esempio n. 13
0
    def __init__(self, name='logabsorption'):

        self.fwhm = Parameter(name, 'fwhm', 100., tinyval, hard_min=tinyval, 
                              units="km/s")
        self.pos = Parameter(name, 'pos', 5000., tinyval, frozen=True, units='angstroms')
        self.tau = Parameter(name, 'tau', 0.5)

        ArithmeticModel.__init__(self, name, (self.fwhm, self.pos,
                                              self.tau))
Esempio n. 14
0
    def __init__(self, name='blackbody'):
        self.refer = Parameter(name, 'refer', 5000., tinyval, hard_min=tinyval, frozen=True, units="angstroms")
        self.ampl = Parameter(name, 'ampl', 1., tinyval, hard_min=tinyval, units="angstroms")
        self.temperature = Parameter(name, 'temperature', 3000., tinyval, hard_min=tinyval, units="Kelvin")

        self._argmin = 1.0e-3
        self._argmax = 1000.0

        ArithmeticModel.__init__(self, name, (self.refer, self.ampl, self.temperature))
Esempio n. 15
0
 def __init__(self, name='bpl1d'):
     self.gamma1 = Parameter(name, 'gamma1', 0, -10, 10)
     self.gamma2 = Parameter(name, 'gamma2', 0, -10, 10)
     self.eb = Parameter(name, 'eb', 100, 0, 1000, 0)
     self.ref = Parameter(name, 'ref', 1, frozen=True)
     self.ampl = Parameter(name, 'ampl', 1, 1e-20)
     ArithmeticModel.__init__(self, name,
                              (self.gamma1, self.gamma2,
                               self.eb, self.ref, self.ampl))
Esempio n. 16
0
    def __init__(self, name='emissionlorentz'):

        self.fwhm = Parameter(name, 'fwhm', 100., tinyval, hard_min=tinyval,
                              units="km/s")
        self.pos = Parameter(name, 'pos', 5000., tinyval, frozen=True, units='angstroms')
        self.flux = Parameter(name, 'flux', 1.)
        self.kurt = Parameter(name, 'kurt', 2., frozen=True)

        ArithmeticModel.__init__(self, name, (self.fwhm, self.pos,
                                              self.flux, self.kurt))
Esempio n. 17
0
 def __init__(self, name='Sync'):
     self.B = Parameter(name, 'B', 1, min=0, max=10, frozen=True, units='G')
     # add ECPL params
     super(Synchrotron, self).__init__(name=name)
     # Initialize model
     ArithmeticModel.__init__(self, name, (self.index, self.ref, self.ampl,
                                           self.cutoff, self.beta, self.B,
                                           self.distance, self.verbose))
     self._use_caching = True
     self.cache = 10
Esempio n. 18
0
 def __init__(self, name='pp'):
     self.nh = Parameter(name, 'nH', 1, min=0, frozen=True, units='1/cm3')
     # add ECPL params
     super(PionDecay, self).__init__(name=name)
     # Initialize model
     ArithmeticModel.__init__(self, name, (self.index, self.ref, self.ampl,
                                           self.cutoff, self.beta, self.nh,
                                           self.distance, self.verbose))
     self._use_caching = True
     self.cache = 10
Esempio n. 19
0
    def __init__(self, name='accretiondisk'):

        self.ref = Parameter(name, 'ref', 5000., frozen=True, units='angstroms')
        self.beta = Parameter(name, 'beta', 0.5, -10, 10)
        self.ampl = Parameter(name, 'ampl', 1.)
        self.norm = Parameter(name, 'norm', 20000.0, tinyval, alwaysfrozen=True,
                              hidden=True)

        ArithmeticModel.__init__(self, name,
                                 (self.ref, self.beta, self.ampl, self.norm))
Esempio n. 20
0
 def __init__(self, name='fm'):
     self.ebv = Parameter(name, 'ebv', 0.5)  # E(B-V)
     self.x0 = Parameter(name, 'x0', 4.6)    # Position of Drude bump
     self.width = Parameter(name, 'width', 0.06) # Width of Drude bump 
     self.c1 = Parameter(name, 'c1', 0.2)
     self.c2 = Parameter(name, 'c2', 0.1)
     self.c3 = Parameter(name, 'c3', 0.02)
     self.c4 = Parameter(name, 'c4', 0.1)
     ArithmeticModel.__init__(self, name, (self.ebv, self.x0,
                                           self.width, self.c1, self.c2,
                                           self.c3, self.c4))
Esempio n. 21
0
 def __init__(self,name='pp'):
     self.index   = Parameter(name , 'index'   , 2.1 , min=-10 , max=10)
     self.ref     = Parameter(name , 'ref'     , 60  , min=0   , frozen=True  , units='TeV')
     self.ampl    = Parameter(name , 'ampl'    , 100 , min=0   , max=1e60     , hard_max=1e100 , units='1e30/eV')
     self.cutoff  = Parameter(name , 'cutoff'  , 0   , min=0   , frozen=True  , units='TeV')
     self.beta    = Parameter(name , 'beta'    , 1   , min=0   , max=10       , frozen=True)
     self.nh      = Parameter(name , 'nH'      , 1   , min=0   , frozen=True  , units='1/cm3')
     self.verbose = Parameter(name , 'verbose' , 0   , min=0   , frozen=True)
     ArithmeticModel.__init__(self,name,(self.index,self.ref,self.ampl,self.cutoff,self.beta,self.nh,self.verbose))
     self._use_caching = True
     self.cache = 10
Esempio n. 22
0
    def __init__(self, name='seaton'):
        self.ebv = Parameter(name, 'ebv', 0.5)

        self._xtab = numpy.array([0.0,  1.0, 1.1, 1.2, 1.3, 1.4, 1.5,
                                  1.6, 1.7, 1.8, 1.9, 2.0, 2.1,
                                  2.2, 2.3, 2.4, 2.5, 2.6, 2.7])
        self._extab = numpy.array([0.0,   1.36, 1.64, 1.84, 2.04, 2.24, 2.44,
                                   2.66, 2.88, 3.14, 3.36, 3.56, 3.77,
                                   3.96, 4.15, 4.26, 4.40, 4.52, 4.64])

        ArithmeticModel.__init__(self, name, (self.ebv,))
Esempio n. 23
0
    def __init__(self, name='emissionvoigt'):
        self.center = Parameter(name, 'center', 5000., tinyval, hard_min=tinyval, frozen=True, units="angstroms")
        self.flux = Parameter(name, 'flux', 1.)
        self.fwhm = Parameter(name, 'fwhm', 100., tinyval, hard_min=tinyval, units="km/s")
        self.lg = Parameter(name, 'lg', 1., tinyval, hard_min=tinyval, frozen=True)

        # Create core and wings from Gaussian and Lorentz
        self._core = EmissionGaussian()
        self._wings = EmissionLorentz()

        ArithmeticModel.__init__(self, name, (self.center, self.flux, self.fwhm, self.lg))
Esempio n. 24
0
    def __init__(self, name='opticalgaussian'):

        self.fwhm = Parameter(name, 'fwhm', 100., tinyval, hard_min=tinyval, 
                              units="km/s")
        self.pos = Parameter(name, 'pos', 5000., tinyval, frozen=True, units='angstroms')
        self.tau = Parameter(name, 'tau', 0.5)
        self.limit = Parameter(name, 'limit', 4., alwaysfrozen=True,
                               hidden=True )

        ArithmeticModel.__init__(self, name, (self.fwhm, self.pos,
                                              self.tau, self.limit))
Esempio n. 25
0
    def __init__(self, name='absorptiongaussian'):

        self.fwhm = Parameter(name, 'fwhm', 100., tinyval, hard_min=tinyval, 
                              units="km/s")
        self.pos = Parameter(name, 'pos', 5000., tinyval, frozen=True, units='angstroms')
        self.ewidth = Parameter(name, 'ewidth', 1.)
        self.limit = Parameter(name, 'limit', 4., alwaysfrozen=True,
                               hidden=True )

        ArithmeticModel.__init__(self, name, (self.fwhm, self.pos,
                                              self.ewidth, self.limit))
Esempio n. 26
0
    def __init__(self, name='parametercase'):
        self.period = Parameter(name, 'Period', 1, 1e-10, 10, tinyval)
        self.offset = Parameter(name, 'Offset', 0, 0, hard_min=0)
        self.ampl = Parameter(name, 'Ampl', 1, 1e-05, hard_min=0, aliases=["NORM"])

        with warnings.catch_warnings(record=True) as warn:
            warnings.simplefilter("always", DeprecationWarning)
            pars = (self.perioD, self.oFFSEt, self.NORM)
            validate_warning(warn)

        self._basemodel = Sin()
        ArithmeticModel.__init__(self, name, pars)
Esempio n. 27
0
 def __init__(self, name='hubblereynolds'):
     self.r0 = Parameter(name, 'r0', 10, 0, hard_min=0)
     self.xpos = Parameter(name, 'xpos', 0)
     self.ypos = Parameter(name, 'ypos', 0)
     self.ellip = Parameter(name, 'ellip', 0, 0, 0.999, 0, 0.9999)
     self.theta = Parameter(name, 'theta', 0, 0, 2*numpy.pi, -2*numpy.pi,
                            4*numpy.pi, 'radians')
     self.ampl = Parameter(name, 'ampl', 1)
     ArithmeticModel.__init__(self, name,
                              (self.r0, self.xpos, self.ypos, self.ellip,
                               self.theta, self.ampl))
     self.cache = 0
Esempio n. 28
0
    def __init__(self, name='logemission'):

        self.fwhm = Parameter(name, 'fwhm', 100., tinyval, hard_min=tinyval,
                              units="km/s")
        self.pos = Parameter(name, 'pos', 5000., tinyval, frozen=True, units='angstroms')
        self.flux = Parameter(name, 'flux', 1.)
        self.skew = Parameter(name, 'skew', 1., tinyval, frozen=True)
        self.limit = Parameter(name, 'limit', 4., alwaysfrozen=True,
                               hidden=True )

        ArithmeticModel.__init__(self, name,
                                 (self.fwhm, self.pos, self.flux,
                                  self.skew, self.limit))
Esempio n. 29
0
    def __init__(self, name='polynomial'):
        pars = []

        for i in xrange(6):
            pars.append(Parameter(name, 'c%d' % i, 0, frozen=True))
        pars[0].val = 1
        pars[0].frozen = False
        for p in pars:
            setattr(self, p.name, p)

        self.offset = Parameter(name, 'offset', 0, frozen=True)
        pars.append(self.offset)
        ArithmeticModel.__init__(self, name, pars)
Esempio n. 30
0
 def __init__(self, name='sersic2d'):
     self.r0 = Parameter(name, 'r0', 10, 0, hard_min=0)
     self.xpos = Parameter(name, 'xpos', 0)
     self.ypos = Parameter(name, 'ypos', 0)
     self.ellip = Parameter(name, 'ellip', 0, 0, 0.999, 0, 0.9999)
     self.theta = Parameter(name, 'theta', 0, 0, 2*numpy.pi, -2*numpy.pi,
                            4*numpy.pi, 'radians')
     self.ampl = Parameter(name, 'ampl', 1)
     self.n = Parameter(name,'n', 1, .1, 10, 0.01, 100, frozen=True )
     ArithmeticModel.__init__(self, name,
                              (self.r0, self.xpos, self.ypos, self.ellip,
                               self.theta, self.ampl, self.n))
     self.cache = 0
Esempio n. 31
0
 def __init__(self, name='beta2d'):
     self.r0 = Parameter(name, 'r0', 10, tinyval, hard_min=tinyval)
     self.xpos = Parameter(name, 'xpos', 0)
     self.ypos = Parameter(name, 'ypos', 0)
     self.ellip = Parameter(name,
                            'ellip',
                            0,
                            0,
                            0.999,
                            0,
                            0.9999,
                            frozen=True)
     self.theta = Parameter(name, 'theta', 0, -2 * numpy.pi, 2 * numpy.pi,
                            -2 * numpy.pi, 4 * numpy.pi, 'radians', True)
     self.ampl = Parameter(name, 'ampl', 1)
     self.alpha = Parameter(name, 'alpha', 1, -10, 10)
     ArithmeticModel.__init__(self, name,
                              (self.r0, self.xpos, self.ypos, self.ellip,
                               self.theta, self.ampl, self.alpha))
     self.cache = 0
Esempio n. 32
0
 def __init__(self, name='jdpileup'):
     self.alpha = Parameter(name, 'alpha', 0.5, 0, 1, 0, 1)
     self.g0 = Parameter(name, 'g0', 1, tinyval, 1, tinyval, 1, frozen=True)
     self.f = Parameter(name, 'f', 0.95, 0.9, 1, 0, 1)
     self.n = Parameter(name,
                        'n',
                        1,
                        tinyval,
                        100,
                        tinyval,
                        2048,
                        alwaysfrozen=True)
     self.ftime = Parameter(name,
                            'ftime',
                            3.241,
                            tinyval,
                            5,
                            tinyval,
                            100,
                            'sec',
                            alwaysfrozen=True)
     self.fracexp = Parameter(name,
                              'fracexp',
                              0.987,
                              0,
                              1,
                              0,
                              1,
                              alwaysfrozen=True)
     self.nterms = Parameter(name,
                             'nterms',
                             30,
                             1,
                             100,
                             1,
                             100,
                             alwaysfrozen=True)
     self._results = None
     ArithmeticModel.__init__(self, name,
                              (self.alpha, self.g0, self.f, self.n,
                               self.ftime, self.fracexp, self.nterms))
Esempio n. 33
0
    def __init__(self, name="Cont_flux"):
        """

        :param y1: y_point to fit
        :type y1: float64
        :param y2: y_point to fit
        :type y2: float64
        :param y3: y_point to fit
        :type y3: float64
        :param y4: y_point to fit
        :type y4: float64
        :param y5: y_point to fit
        :type y5: float64
        :param y6: y_point to fit
        :type y6: float64
        :param y7: y_point to fit
        :type y7: float64
        :param y8: y_point to fit
        :type y8: float64
        :param n_points: number of anchor points to put spline.
        :type n_points: int

        """

        self.y1 = Parameter(name, "y1", 1.0, frozen=True)
        self.y2 = Parameter(name, "y2", 1.0, frozen=True)
        self.y3 = Parameter(name, "y3", 1.0, frozen=True)
        self.y4 = Parameter(name, "y4", None, frozen=True)
        self.y5 = Parameter(name, "y5", None, frozen=True)
        self.y6 = Parameter(name, "y6", None, frozen=True)
        self.y7 = Parameter(name, "y7", None, frozen=True)
        self.y8 = Parameter(name, "y8", None, frozen=True)

        ArithmeticModel.__init__(
            self,
            name,
            (self.y1, self.y2, self.y3, self.y4, self.y5, self.y6, self.y7,
             self.y8),
        )
Esempio n. 34
0
 def __init__(self, name="pp"):
     self.name = name
     self.nh = Parameter(name, "nH", 1, min=0, frozen=True, units="1/cm3")
     # add ECPL params
     super().__init__(name=name)
     # Initialize model
     ArithmeticModel.__init__(
         self,
         name,
         (
             self.index,
             self.ref,
             self.ampl,
             self.cutoff,
             self.beta,
             self.nh,
             self.distance,
             self.verbose,
         ),
     )
     self._use_caching = True
     self.cache = 10
Esempio n. 35
0
    def __init__(self, name='opticalgaussian'):

        self.fwhm = Parameter(name,
                              'fwhm',
                              100.,
                              tinyval,
                              hard_min=tinyval,
                              units="km/s")
        self.pos = Parameter(name,
                             'pos',
                             5000.,
                             tinyval,
                             frozen=True,
                             units='angstroms')
        self.tau = Parameter(name, 'tau', 0.5)
        self.limit = Parameter(name,
                               'limit',
                               4.,
                               alwaysfrozen=True,
                               hidden=True)

        ArithmeticModel.__init__(self, name,
                                 (self.fwhm, self.pos, self.tau, self.limit))
Esempio n. 36
0
    def __init__(self, name='absorptiongaussian'):

        self.fwhm = Parameter(name,
                              'fwhm',
                              100.,
                              tinyval,
                              hard_min=tinyval,
                              units="km/s")
        self.pos = Parameter(name,
                             'pos',
                             5000.,
                             tinyval,
                             frozen=True,
                             units='angstroms')
        self.ewidth = Parameter(name, 'ewidth', 1.)
        self.limit = Parameter(name,
                               'limit',
                               4.,
                               alwaysfrozen=True,
                               hidden=True)

        ArithmeticModel.__init__(
            self, name, (self.fwhm, self.pos, self.ewidth, self.limit))
Esempio n. 37
0
    def __init__(self, name='bremsstrahlung'):
        self.refer = Parameter(name,
                               'refer',
                               5000.,
                               tinyval,
                               hard_min=tinyval,
                               frozen=True,
                               units="angstroms")
        self.ampl = Parameter(name,
                              'ampl',
                              1.,
                              tinyval,
                              hard_min=tinyval,
                              units="angstroms")
        self.temperature = Parameter(name,
                                     'temperature',
                                     3000.,
                                     tinyval,
                                     hard_min=tinyval,
                                     units="Kelvin")

        ArithmeticModel.__init__(self, name,
                                 (self.refer, self.ampl, self.temperature))
Esempio n. 38
0
    def __str__(self):
        s = ArithmeticModel.__str__(self)

        if self._results is not None:
            pileup_fractions, integral_ae, num_terms = self._results

            sum = 0.0
            if num_terms > 0:
                sum = pileup_fractions[1]

            sum_piled = pileup_fractions[2:num_terms+1].sum()
            sum += sum_piled

            pn = numpy.exp(-integral_ae)

            s += '\n\n'

            for i in xrange(1, num_terms+1):
                pn *= integral_ae / float(i)
                s += '   %d: %g  %g\n' % (i, pn, pileup_fractions[i]/sum)

            s += '   *** pileup fraction: %g' % (sum_piled/sum)

        return s
Esempio n. 39
0
 def __init__(self, name='schechter'):
     self.alpha = Parameter(name, 'alpha', 10)
     self.ref = Parameter(name, 'ref', 1)
     self.norm = Parameter(name, 'norm', 1)
     ArithmeticModel.__init__(self, name, (self.alpha, self.ref, self.norm))
Esempio n. 40
0
    def __init__(self, name='ccm'):
        self.ebv = Parameter(name, 'ebv', 0.5)
        self.r = Parameter(name, 'r', 3.2)

        ArithmeticModel.__init__(self, name, (self.ebv, self.r))
Esempio n. 41
0
    def __init__(self, name='xgal'):
        self.ebv = Parameter(name, 'ebv', 0.5)

        ArithmeticModel.__init__(self, name, (self.ebv, ))
Esempio n. 42
0
 def __init__(self, name='atten'):
     self.hcol = Parameter(name, 'hcol', 1e+20, 1e+17, 1e+24, tinyval)
     self.heiRatio = Parameter(name, 'heiRatio', 0.1, 0, 1)
     self.heiiRatio = Parameter(name, 'heiiRatio', 0.01, 0, 1)
     ArithmeticModel.__init__(self, name,
                              (self.hcol, self.heiRatio, self.heiiRatio))
Esempio n. 43
0
 def __init__(self, name='disk2d'):
     self.xpos = Parameter(name, 'xpos', 0) # p[0]
     self.ypos = Parameter(name, 'ypos', 0) # p[1]
     self.ampl = Parameter(name, 'ampl', 1) # p[2]
     self.r0 = Parameter(name, 'r0', 1, 0) # p[3]
     ArithmeticModel.__init__(self, name, (self.xpos, self.ypos, self.ampl, self.r0))
Esempio n. 44
0
 def __init__(self, name='bbody'):
     self.space = Parameter(name, 'space', 0, 0, 1, 0, 1,
                            '0 - energy | 1 - wave', alwaysfrozen=True)
     self.kT = Parameter(name, 'kT', 1, 0.1, 1000, 0, 1e+10, 'keV')
     self.ampl = Parameter(name, 'ampl', 1, 1e-20, 1e+20, 1e-20, 1e+20)
     ArithmeticModel.__init__(self, name, (self.space, self.kT, self.ampl))
Esempio n. 45
0
 def __init__(self, name='renamedpars'):
     self.period = Parameter(name, 'period', 1, 1e-10, 10, tinyval)
     self.offset = Parameter(name, 'offset', 0, 0, hard_min=0)
     self.ampl = Parameter(name, 'ampl', 1, 1e-05, hard_min=0, aliases=['norm'])
     ArithmeticModel.__init__(self, name,
                              (self.period, self.offset, self.ampl))
Esempio n. 46
0
 def __init__(self, name='dered'):
     self.rv = Parameter(name, 'rv', 10, 1e-10, 1000, tinyval)
     self.nhgal = Parameter(name, 'nhgal', 1e-07, 1e-07, 100000)
     ArithmeticModel.__init__(self, name, (self.rv, self.nhgal))
Esempio n. 47
0
 def __init__(self, name='bbodyfreq'):
     self.T = Parameter(name, 'T', 1e+06, 1000, 1e+10, 1000, 1e+10)
     self.ampl = Parameter(name, 'ampl', 1, 0, hard_min=0)
     ArithmeticModel.__init__(self, name, (self.T, self.ampl))
Esempio n. 48
0
 def __init__(self, name='lorentz1d'):
     self.fwhm = Parameter(name, 'fwhm', 10, 0, hard_min=0)
     self.pos = Parameter(name, 'pos', 1)
     self.ampl = Parameter(name, 'ampl', 1)
     ArithmeticModel.__init__(self, name,
                              (self.fwhm, self.pos, self.ampl))
Esempio n. 49
0
    def __init__(self, name='lmc'):
        self.ebv = Parameter(name, 'ebv', 0.5)
        self._R = 3.1

        ArithmeticModel.__init__(self, name, (self.ebv, ))