# 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))

# Perform chi-squared fit to determine best fit amplituded to HD curve
hc_sqr = np.sum(crosspower*hdcoeff / (crosspowererr*crosspowererr)) / \
            np.sum(hdcoeff*hdcoeff / (crosspowererr*crosspowererr))

hc_sqrerr = 1.0 / np.sqrt(np.sum(hdcoeff * hdcoeff / (crosspowererr * crosspowererr)))

# get reduced chi-squared value
chisqr = np.sum(((crosspower - hc_sqr*hdcoeff) / crosspowererr)**2)
redchisqr = np.sum(chisqr) / len(crosspower)


print 'Results of Search\n'

print '------------------------------------\n'
Ejemplo n.º 2
0
# 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))

# Perform chi-squared fit to determine best fit amplituded to HD curve
hc_sqr = np.sum(crosspower*hdcoeff / (crosspowererr*crosspowererr)) / \
            np.sum(hdcoeff*hdcoeff / (crosspowererr*crosspowererr))

hc_sqrerr = 1.0 / np.sqrt(
    np.sum(hdcoeff * hdcoeff / (crosspowererr * crosspowererr)))

# get reduced chi-squared value
chisqr = np.sum(((crosspower - hc_sqr * hdcoeff) / crosspowererr)**2)
redchisqr = np.sum(chisqr) / len(crosspower)

print 'Results of Search\n'

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