예제 #1
0
def estimate_rz(psr, T, show=0, device='/XWIN'):
    """
    estimate_rz(psr, T, show=0, device='/XWIN'):
        Return estimates of a pulsar's average Fourier freq ('r')
        relative to its nominal Fourier freq as well as its
        Fourier f-dot ('z') in bins, of a pulsar.
           'psr' is a psrparams structure describing the pulsar.
           'T' is the length of the observation in sec.
           'show' if true, displays plots of 'r' and 'z'.
           'device' if the device to plot to if 'show' is true.
    """
    startE = keplers_eqn(psr.orb.t, psr.orb.p, psr.orb.e, 1.0E-15)
    numorbpts = int(T / psr.orb.p + 1.0) * 1024 + 1
    dt = T / (numorbpts - 1)
    E = dorbint(startE, numorbpts, dt, psr.orb)
    z = z_from_e(E, psr, T)
    r = T/p_from_e(E, psr) - T/psr.p
    if show:
        times = np.arange(numorbpts) * dt
        Pgplot.plotxy(r, times, labx = 'Time', \
                      laby = 'Fourier Frequency (r)', device=device)
        if device=='/XWIN':
            print 'Press enter to continue:'
            i = raw_input()
        Pgplot.nextplotpage()
        Pgplot.plotxy(z, times, labx = 'Time',
                      laby = 'Fourier Frequency Derivative (z)', device=device)
        Pgplot.closeplot()
    return r.mean(), z.mean()
예제 #2
0
def estimate_rz(psr, T, show=0, device='/XWIN'):
    """
    estimate_rz(psr, T, show=0, device='/XWIN'):
        Return estimates of a pulsar's average Fourier freq ('r')
        relative to its nominal Fourier freq as well as its
        Fourier f-dot ('z') in bins, of a pulsar.
           'psr' is a psrparams structure describing the pulsar.
           'T' is the length of the observation in sec.
           'show' if true, displays plots of 'r' and 'z'.
           'device' if the device to plot to if 'show' is true.
    """
    startE = keplers_eqn(psr.orb.t, psr.orb.p, psr.orb.e, 1.0E-15)
    numorbpts = int(T / psr.orb.p + 1.0) * 1024 + 1
    dt = T / (numorbpts - 1)
    E = dorbint(startE, numorbpts, dt, psr.orb)
    z = z_from_e(E, psr, T)
    r = T / p_from_e(E, psr) - T / psr.p
    if show:
        times = Num.arange(numorbpts) * dt
        Pgplot.plotxy(r, times, labx = 'Time', \
                      laby = 'Fourier Frequency (r)', device=device)
        if device == '/XWIN':
            print 'Press enter to continue:'
            i = raw_input()
        Pgplot.nextplotpage()
        Pgplot.plotxy(z,
                      times,
                      labx='Time',
                      laby='Fourier Frequency Derivative (z)',
                      device=device)
        Pgplot.closeplot()
    return r.mean(), z.mean()
예제 #3
0
 # Create the data set
 cand = presto.orbitparams()
 m = 0
 comb = presto.gen_bin_response(0.0, 1, psr.p, T, psr.orb , 
                                presto.LOWACC, m)
 ind = len(comb)
 # The follwoing is performed automatically in gen_bin_resp() now
 # m = (ind / 2 + 10) * numbetween
 data = Numeric.zeros(3 * ind, 'F')
 data[ind:2*ind] = comb
 if showplots and not parallel:
     Pgplot.plotxy(presto.spectralpower(data), color='red',
                   title='Data', labx='Fourier Frequency',
                   laby='Relative Power')
     a = raw_input("Press enter to continue...")
     Pgplot.nextplotpage(1)
     
 # Perform the loops over the Keplarian parameters
 for job in range(numjobs):
     if parallel:
         myjob = work[myid]
     else:
         myjob = work[job]
     if myjob=='p':
         Dd = Dp
         psrref = psr.orb.p
     if myjob=='x':
         Dd = Dx
         psrref = psr.orb.x
     if myjob=='t':
         Dd = Dt
예제 #4
0
 # Create the data set
 cand = presto.orbitparams()
 m = 0
 comb = presto.gen_bin_response(0.0, 1, psr.p, T, psr.orb , 
                                presto.LOWACC, m)
 ind = len(comb)
 # The follwoing is performed automatically in gen_bin_resp() now
 # m = (ind / 2 + 10) * numbetween
 data = Numeric.zeros(3 * ind, 'F')
 data[ind:2*ind] = comb
 if showplots and not parallel:
     Pgplot.plotxy(presto.spectralpower(data), color='red',
                   title='Data', labx='Fourier Frequency',
                   laby='Relative Power')
     a = raw_input("Press enter to continue...")
     Pgplot.nextplotpage(1)
     
 # Perform the loops over the Keplerian parameters
 for job in range(numjobs):
     if parallel:
         myjob = work[myid]
     else:
         myjob = work[job]
     if myjob=='p':
         Dd = Dp
         psrref = psr.orb.p
     if myjob=='x':
         Dd = Dx
         psrref = psr.orb.x
     if myjob=='t':
         Dd = Dt