Пример #1
0
    chain = indsamples

if not args.intelburn: chain = chain[args.manualburn:,:]
    
############################################################
# Doing a quick plot to manually cut-off the burn-in stage
############################################################

if 'gam4p33' in args.chaindir:
    # checking Agwb
    Agwb = chain[:,int(param_list[param_list[:,1]=='Agwb',0][0])]

    gwb_params = np.zeros((len(chain),1))
    gwb_params[:,0] = Agwb

    bu.makePostPlots_show(gwb_params,ndim=1,labels=[r'$A_h$']) 
    plt.show()
else:
    # checking Agwb and gam_gwb
    Agwb = chain[:,int(param_list[param_list[:,1]=='Agwb',0][0])]
    gam_gwb = chain[:,int(param_list[param_list[:,1]=='gam_gwb',0][0])]

    gwb_params = np.zeros((len(chain),2))
    gwb_params[:,0] = Agwb
    gwb_params[:,1] = gam_gwb
    
    bu.makePostPlots_show(gwb_params,ndim=2,labels=[r'$A_h$', r'$\gamma$']) 
    plt.show()


##########################
Пример #2
0
    chain = indsamples

if not args.intelburn: chain = chain[args.manualburn:, :]

############################################################
# Doing a quick plot to manually cut-off the burn-in stage
############################################################

if 'gam4p33' in args.chaindir:
    # checking Agwb
    Agwb = chain[:, int(param_list[param_list[:, 1] == 'Agwb', 0][0])]

    gwb_params = np.zeros((len(chain), 1))
    gwb_params[:, 0] = Agwb

    bu.makePostPlots_show(gwb_params, ndim=1, labels=[r'$A_h$'])
    plt.show()
else:
    # checking Agwb and gam_gwb
    Agwb = chain[:, int(param_list[param_list[:, 1] == 'Agwb', 0][0])]
    gam_gwb = chain[:, int(param_list[param_list[:, 1] == 'gam_gwb', 0][0])]

    gwb_params = np.zeros((len(chain), 2))
    gwb_params[:, 0] = Agwb
    gwb_params[:, 1] = gam_gwb

    bu.makePostPlots_show(gwb_params, ndim=2, labels=[r'$A_h$', r'$\gamma$'])
    plt.show()

##########################
# Now processing results
Пример #3
0
    print "\n The ML coefficients of an l={0} search are {1}\n".format(args.LMAX,anisOptStat[0]/np.sqrt(4.0*np.pi))
    print "\n The error-bars from the inverse Fisher matrix are {0}\n".format(np.sqrt(np.diag(anisOptStat[1]))/np.sqrt(4.0*np.pi))

    print "\n The Fisher information is {0}\n".format(anisOptStat[2])

    print "\n The ML coefficients of an l={0} search are {1}\n".format(args.LMAX,anisOptStat[0])
    print "\n The full covariance matrix is {0}\n".format(anisOptStat[1])

    np.save('mlcoeff_lmax{0}'.format(args.LMAX),anisOptStat[0])
    np.save('invfisher_lmax{0}'.format(args.LMAX),anisOptStat[1])

    psrlocs = np.loadtxt('PsrPos_SNR_{0}.txt'.format(snr_tag_ext),usecols=[1,2])
    Asqr = anisOptStat[0][0]/np.sqrt(4.0*np.pi)
    final_clm = np.array(anisOptStat[0]) / Asqr

    bu.makeSkyMap(final_clm, lmax=args.LMAX, psrs=psrlocs)
    plt.show()

    '''
    print "Fisher matrix singular values are {0}".format(anisOptStat[2])
    plt.plot(anisOptStat[2])
    plt.yscale('log')
    plt.ylabel("Fisher matrix singular value",fontsize=15)
    plt.show()
    '''

    plt.plot(anisOptStat[0]/np.sqrt(np.diag(anisOptStat[1])))
    plt.xlabel("lm mode",fontsize=15)
    plt.ylabel("ML value / error",fontsize=15)
    plt.show()
Пример #4
0
    chain = indsamples

if not args.intelburn: chain = chain[args.manualburn:,:]
    
############################################################
# Doing a quick plot to manually cut-off the burn-in stage
############################################################

if 'gam4p33' in args.chaindir:
    # checking Agwb
    Agwb = chain[:,int(param_list[param_list[:,1]=='Agwb',0][0])]

    gwb_params = np.zeros((len(chain),1))
    gwb_params[:,0] = Agwb

    bu.makePostPlots_show(gwb_params,ndim=1,labels=[r'$A_h$']) 
    plt.show()
else:
    # checking Agwb and gam_gwb
    Agwb = chain[:,int(param_list[param_list[:,1]=='Agwb',0][0])]
    gam_gwb = chain[:,int(param_list[param_list[:,1]=='gam_gwb',0][0])]

    gwb_params = np.zeros((len(chain),2))
    gwb_params[:,0] = Agwb
    gwb_params[:,1] = gam_gwb
    
    bu.makePostPlots_show(gwb_params,ndim=2,labels=[r'$A_h$', r'$\gamma$']) 
    plt.show()


##########################
Пример #5
0
print "\n In this data, the minimum Ah of an SMBHB background that is required for 5% FAR and 68% DR is {0}\n".\
  format(np.sqrt( optimalStat[1]*np.sqrt(2.0)*( ss.erfcinv(2.0*0.05) - ss.erfcinv(2.0*0.68) ) ))
print "\n In this data, the minimum Ah of an SMBHB background that is required for 5% FAR and 95% DR is {0}\n".\
  format(np.sqrt( optimalStat[1]*np.sqrt(2.0)*( ss.erfcinv(2.0*0.05) - ss.erfcinv(2.0*0.95) ) ))

print "\n The 90% upper-limit on Ah is {0}\n".\
  format(np.sqrt( optimalStat[0] + optimalStat[1]*np.sqrt(2.0)*( ss.erfcinv(2.0*(1.-0.90)) ) ))
print "\n The 95% upper-limit on Ah is {0}\n".\
  format(np.sqrt( optimalStat[0] + optimalStat[1]*np.sqrt(2.0)*( ss.erfcinv(2.0*(1.-0.95)) ) ))

if args.make_plot:

    if args.limit_or_detect == 'detect':
        far = 0.05
        dr_list = [0.95, 0.68]
        bu.OSupperLimit(psr, GCGnoiseInv, HnD, optimalStat, far, dr_list)
    else:
        ul_list = [0.95, 0.90]
        bu.OSupperLimit(psr, GCGnoiseInv, HnD, optimalStat, ul_list)

    bu.OScrossPower(angSep, optimalStat[3], optimalStat[4])

if args.LMAX != 0:
    anisOptStat = utils.AnisOptStat(psr,
                                    GCGnoiseInv,
                                    CorrCoeff,
                                    args.LMAX,
                                    gam_gwb=gam_bkgrd)

    print "\n The ML coefficients of an l={0} search are {1}\n".format(
        args.LMAX, anisOptStat[0] / np.sqrt(4.0 * np.pi))