示例#1
0
 def phaseogram(self, weights=None, bins=100, rotate=0.0, size=5,
     alpha=0.25, file=False):
     """
     Make a nice 2-panel phaseogram for the current model
     """
     mjds = self.toas.table['tdbld'].astype(np.float64)
     phss = self.get_event_phases()
     fermi.phaseogram(mjds, phss, weights=self.weights, bins=bins,
         rotate=rotate, size=size, alpha=alpha, file=file)
示例#2
0
 def phaseogram(self, bins=100, rotate=0.0, size=5,
     alpha=0.25, file=False):
     """
     Make a nice 2-panel phaseogram for the current model
     """
     mjds = self.toas.table['tdbld'].astype(np.float64)
     phss = self.get_event_phases()
     fermi.phaseogram(mjds, phss, weights=self.weights, bins=bins,
         rotate=rotate, size=size, alpha=alpha, file=file)
示例#3
0
            if tt.mjd < maxT:
                tlnew.append(tt)
        tl = tlnew
        print("post len : ", len(tlnew))

    # Now convert to TOAs object and compute TDBs and posvels
    ts = toa.TOAs(toalist=tl)
    ts.filename = args.eventfile
    ts.compute_TDBs()
    ts.compute_posvels(ephem=args.ephem, planets=args.planets)

    print(ts.get_summary())
    mjds = ts.get_mjds()
    print(mjds.min(), mjds.max())

    # Read in model
    modelin = pint.models.get_model(args.parfile)

    # Remove the dispersion delay as it is unnecessary
    modelin.delay_funcs['L1'].remove(modelin.dispersion_delay)

    # Compute model phase for each TOA
    phss = modelin.phase(ts.table)[1]
    # ensure all postive
    phases = np.where(phss < 0.0, phss + 1.0, phss)
    mjds = ts.get_mjds()
    weights = np.array([w['weight'] for w in ts.table['flags']])
    h = float(hmw(phases, weights))
    print("Htest : {0:.2f} ({1:.2f} sigma)".format(h, h2sig(h)))
    phaseogram(mjds, phases, weights, bins=100, file=args.outfile)
示例#4
0
            if tt.mjd < maxT:
                tlnew.append(tt)
        tl=tlnew
        print("post len : ",len(tlnew))

    # Now convert to TOAs object and compute TDBs and posvels
    ts = toa.TOAs(toalist=tl)
    ts.filename = args.eventfile
    ts.compute_TDBs()
    ts.compute_posvels(ephem=args.ephem,planets=args.planets)

    print(ts.get_summary())
    mjds = ts.get_mjds()
    print(mjds.min(),mjds.max())

    # Read in model
    modelin = pint.models.get_model(args.parfile)

    # Remove the dispersion delay as it is unnecessary
    modelin.delay_funcs['L1'].remove(modelin.dispersion_delay)

    # Compute model phase for each TOA
    phss = modelin.phase(ts.table)[1]
    # ensure all postive
    phases = np.where(phss < 0.0, phss + 1.0, phss)
    mjds = ts.get_mjds()
    weights = np.array([w['weight'] for w in ts.table['flags']])
    h = float(hmw(phases,weights))
    print("Htest : {0:.2f} ({1:.2f} sigma)".format(h,h2sig(h)))
    phaseogram(mjds,phases,weights,bins=100,file = args.outfile)