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
def ExpCutoff(*pars): model = Models.ExpCutoff(p=pars, free=[True, True, False]) sources.set_default_bounds(model) return model
def ExpCutoff(*pars, **kw): return Models.ExpCutoff(p=pars, **kw)
def ExpCutoff(*pars): model = Models.ExpCutoff(p=pars, free=[True, True, False]) return model