# make sure all pulsar have same reference time
tt=[] 
for p in psr:
    tt.append(np.min(p.toas))

# find reference time
tref = np.min(tt)

# now scale pulsar time
for p in psr:
    p.toas -= tref


# compute pairwise overlap reduction function values
print 'Computing Overlap Reduction Function Values'
ORF = PALutils.computeORF(psr)

# since we have defined our ORF to be normalized to 1
hdcoeff = ORF/2

# compute optimal statistic
print 'Running Cross correlation Statistic on {0} Pulsars'.format(npsr)
crosspower, crosspowererr = PALLikelihoods.crossPower(psr, args.gam)

# angular separation
xi = []
for ll in range(npsr):
    for kk in range(ll+1, npsr):
        xi.append(PALutils.angularSeparation(psr[ll].theta, psr[ll].phi, \
                                            psr[kk].theta, psr[kk].phi))
Ejemplo n.º 2
0
# now scale pulsar time
for p in psr:
    p.toas -= tref

#import glob
#invmat = glob.glob('/Users/Justin/Work/nanograv/nanograv/data_products/joris/*invCov*')
#
## get list of R matrices
#R = [PALutils.createRmatrix(p.dmatrix, p.err) for p in psr]
#
#for ct,p in enumerate(psr):
#    p.invCov = np.dot(R[ct].T, np.dot(p.invCov, R[ct]))

# compute pairwise overlap reduction function values
print 'Computing Overlap Reduction Function Values'
ORF = PALutils.computeORF(psr)

# compute optimal statistic
print 'Running Optimal Statistic on {0} Pulsars'.format(npsr)
Opt, sigma, snr = PALLikelihoods.optStat(psr, ORF, gam=args.gam)

print 'Results of Search\n'

print '------------------------------------\n'

print 'A_gw^2 = {0}'.format(Opt)
print 'std. dev. = {0}'.format(sigma)
print 'SNR = {0}'.format(snr)

if snr > 3.0:
    print 'SNR of {0} is above threshold!'.format(snr)