Beispiel #1
0
 def __call__(self, s):
     sdir = s.skydir
     if hasattr(s, 'spatial_model') and s.spatial_model is not None:
         return True
     for i, t in enumerate(self.sdir):
         dist = np.degrees(t.difference(sdir))
         if dist < self.tol and s.ts > self.ts_min:
             self.tags[i] = True
             self.assoc[i] = (s.name, dist, s.ts)
             if self.rename and s.name != self.psr_names[i]:
                 print 'Skymodel: renaming %s(%d) to %s' % (
                     s.name, s.index, self.psr_names[i])
                 s.name = self.psr_names[i]
             if s.model.name == 'ExpCutoff': return True
             flux = s.model[0]
             if flux > 1e-18:
                 print 'Skymodel: replacing model for: %s(%d): pulsar name: %s' % (
                     s.name, s.index, self.psr_names[i])
                 s.model = Models.ExpCutoff()
                 s.free = s.model.free.copy()
             else:
                 print 'Apparent pulsar %s(%d), %s, is very weak, flux=%.2e <1e-13: leave as powerlaw' % (
                     s.name, s.index, self.psr_names[i], flux)
             return True
     if s.model.name == 'ExpCutoff':
         print 'Skymodel setup warning: %s (%d) not in LAT pulsar list, should not be expcutoff' % (
             s.name, s.index)
     return True
Beispiel #2
0
def ExpCutoff(*pars):
    model = Models.ExpCutoff(p=pars, free=[True, True, False])
    sources.set_default_bounds(model)
    return model
Beispiel #3
0
def ExpCutoff(*pars, **kw):
    return Models.ExpCutoff(p=pars, **kw)
Beispiel #4
0
def ExpCutoff(*pars):
    model = Models.ExpCutoff(p=pars, free=[True, True, False])
    return model