Ejemplo n.º 1
0
def check_g_RA_dec(detectors):
    """
	Create a figure to plot the RA dec component of the
	amplitude-maximized amplitude-averaged metric.
	"""
    dRA = 2 * pi / 200
    ddec = pi / 200
    RA, dec = scipy.mgrid[-pi + dRA:pi:dRA, -pi / 2:pi / 2 + ddec:ddec]

    A, B, C, D = metric.maximum_likelihood_matrix(RA, dec, detectors)

    z0 = []
    z1 = []
    z2 = []
    z3 = []
    Fderivs = True
    for detector1 in detectors:
        I_n1 = detector1.I_n
        fp1 = metric.Fp(RA, dec, detector1)
        fx1 = metric.Fx(RA, dec, detector1)
        if Fderivs:
            dfp_dRA1 = metric.dFp_dRA(RA, dec, detector1)
            dfx_dRA1 = metric.dFx_dRA(RA, dec, detector1)
            dfp_ddec1 = metric.dFp_ddec(RA, dec, detector1)
            dfx_ddec1 = metric.dFx_ddec(RA, dec, detector1)
        drn_dRA1 = metric.drn_dRA(RA, dec, detector1)
        drn_ddec1 = metric.drn_ddec(RA, dec, detector1)
        z0.append((B * fp1 * fp1 + A * fx1 * fx1 - 2 * C * fp1 * fx1) / D *
                  I_n1['-1'] * (-2 * pi * drn_dRA1) * (-2 * pi * drn_ddec1))
        if Fderivs:
            z1.append((B*dfp_dRA1*dfp_ddec1+A*dfx_dRA1*dfx_ddec1-C*dfp_dRA1*dfx_ddec1-C*dfx_dRA1*dfp_ddec1)/D \
             *I_n1['-7'])
        z2.append([])
        z3.append([])
        for detector2 in detectors:
            I_n2 = detector2.I_n
            fp2 = metric.Fp(RA, dec, detector2)
            fx2 = metric.Fx(RA, dec, detector2)
            if Fderivs:
                dfp_ddec2 = metric.dFp_ddec(RA, dec, detector2)
                dfx_ddec2 = metric.dFx_ddec(RA, dec, detector2)
            drn_ddec2 = metric.drn_ddec(RA, dec, detector2)
            pre = B * fp1 * fp2 + A * fx1 * fx2 - C * fp1 * fx2 - C * fx1 * fp2
            z2[-1].append(pre*(B*fp1*fp2+A*fx1*fx2-C*fp1*fx2-C*fx1*fp2)/D**2 \
             *I_n1['-4']*I_n2['-4']*(-2*pi*drn_dRA1)*(-2*pi*drn_ddec2))
            if Fderivs:
                z3[-1].append(pre*(B*dfp_dRA1*dfp_ddec2+A*dfx_dRA1*dfx_ddec2-C*dfp_dRA1*dfx_ddec2-C*dfx_dRA1*dfp_ddec2)/D**2 \
                 *I_n1['-7']*I_n2['-7'])

    plot_metric_component_pieces(RA, dec, z0, z1, z2, z3)
def check_g_RA_dec(detectors):
	"""
	Create a figure to plot the RA dec component of the
	amplitude-maximized amplitude-averaged metric.
	"""
	dRA = 2*pi/200
	ddec = pi/200
	RA,dec = scipy.mgrid[-pi+dRA:pi:dRA, -pi/2:pi/2+ddec:ddec]

	A,B,C,D = metric.maximum_likelihood_matrix(RA, dec, detectors)

	z0 = []
	z1 = []
	z2 = []
	z3 = []
	Fderivs = True
	for detector1 in detectors:
		I_n1 = detector1.I_n
		fp1 = metric.Fp(RA, dec, detector1)
		fx1 = metric.Fx(RA, dec, detector1)
		if Fderivs:
			dfp_dRA1 = metric.dFp_dRA(RA, dec, detector1)
			dfx_dRA1 = metric.dFx_dRA(RA, dec, detector1)
			dfp_ddec1 = metric.dFp_ddec(RA, dec, detector1)
			dfx_ddec1 = metric.dFx_ddec(RA, dec, detector1)
		drn_dRA1 = metric.drn_dRA(RA, dec, detector1)
		drn_ddec1 = metric.drn_ddec(RA, dec, detector1)
		z0.append((B*fp1*fp1+A*fx1*fx1-2*C*fp1*fx1)/D*I_n1['-1']*(-2*pi*drn_dRA1)*(-2*pi*drn_ddec1))
		if Fderivs:
			z1.append((B*dfp_dRA1*dfp_ddec1+A*dfx_dRA1*dfx_ddec1-C*dfp_dRA1*dfx_ddec1-C*dfx_dRA1*dfp_ddec1)/D \
				*I_n1['-7'])
		z2.append([])
		z3.append([])
		for detector2 in detectors:
			I_n2 = detector2.I_n
			fp2 = metric.Fp(RA, dec, detector2)
			fx2 = metric.Fx(RA, dec, detector2)
			if Fderivs:
				dfp_ddec2 = metric.dFp_ddec(RA, dec, detector2)
				dfx_ddec2 = metric.dFx_ddec(RA, dec, detector2)
			drn_ddec2 = metric.drn_ddec(RA, dec, detector2)
			pre = B*fp1*fp2+A*fx1*fx2-C*fp1*fx2-C*fx1*fp2
			z2[-1].append(pre*(B*fp1*fp2+A*fx1*fx2-C*fp1*fx2-C*fx1*fp2)/D**2 \
				*I_n1['-4']*I_n2['-4']*(-2*pi*drn_dRA1)*(-2*pi*drn_ddec2))
			if Fderivs:
				z3[-1].append(pre*(B*dfp_dRA1*dfp_ddec2+A*dfx_dRA1*dfx_ddec2-C*dfp_dRA1*dfx_ddec2-C*dfx_dRA1*dfp_ddec2)/D**2 \
					*I_n1['-7']*I_n2['-7'])

	plot_metric_component_pieces(RA, dec, z0, z1, z2, z3)
Ejemplo n.º 3
0
def plot_maximum_likelihood_matrix(detectors):
    """
	Create a figure to plot the components of the maximum likelihood
	matrix as a function of sky location.
	"""
    fig = pylab.figure(figsize=(8, 4.5))

    dRA = 2 * pi / 200
    ddec = pi / 200
    RAs, decs = scipy.mgrid[-pi + dRA:pi:dRA, -pi / 2:pi / 2 + ddec:ddec]
    A, B, C, D = metric.maximum_likelihood_matrix(RAs, decs, detectors)

    ax = fig.add_axes(boundingbox(2, 2, 1, 1))
    m = mollwiede_map(ax)
    levels = 20
    x, y = m(RAs * 180. / pi, decs * 180. / pi)
    CS = m.contour(x, y, A, levels)
    plot_arms(m, detectors)
    ax.set_title('$A \in [%.2e, %.2e]$' % (min(A.flatten()), max(A.flatten())))

    ax = fig.add_axes(boundingbox(2, 2, 1, 2))
    m = mollwiede_map(ax)
    levels = 20
    x, y = m(RAs * 180. / pi, decs * 180. / pi)
    CS = m.contour(x, y, B, levels)
    plot_arms(m, detectors)
    ax.set_title('$B \in [%.2e, %.2e]$' % (min(B.flatten()), max(B.flatten())))

    ax = fig.add_axes(boundingbox(2, 2, 2, 1))
    m = mollwiede_map(ax)
    levels = 20
    x, y = m(RAs * 180. / pi, decs * 180. / pi)
    CS = m.contour(x, y, C, levels)
    plot_arms(m, detectors)
    ax.set_title('$C \in [%.2e, %.2e]$' % (min(C.flatten()), max(C.flatten())))

    ax = fig.add_axes(boundingbox(2, 2, 2, 2))
    m = mollwiede_map(ax)
    levels = 20
    x, y = m(RAs * 180. / pi, decs * 180. / pi)
    CS = m.contour(x, y, scipy.log(D), levels)
    plot_arms(m, detectors)
    ax.set_title('$\log(D) ,\, D \in [%.2e, %.2e]$' %
                 (min(D.flatten()), max(D.flatten())))
def plot_maximum_likelihood_matrix(detectors):
	"""
	Create a figure to plot the components of the maximum likelihood
	matrix as a function of sky location.
	"""
	fig = pylab.figure(figsize=(8,4.5))

	dRA = 2*pi/200
	ddec = pi/200
	RAs,decs = scipy.mgrid[-pi+dRA:pi:dRA, -pi/2:pi/2+ddec:ddec]
	A,B,C,D = metric.maximum_likelihood_matrix(RAs, decs, detectors)

	ax = fig.add_axes(boundingbox(2,2,1,1))
	m = mollwiede_map(ax)
	levels = 20
	x, y = m(RAs*180./pi, decs*180./pi)
	CS = m.contour(x, y, A, levels)
	plot_arms(m, detectors)
	ax.set_title('$A \in [%.2e, %.2e]$'%(min(A.flatten()), max(A.flatten())))

	ax = fig.add_axes(boundingbox(2,2,1,2))
	m = mollwiede_map(ax)
	levels = 20
	x, y = m(RAs*180./pi, decs*180./pi)
	CS = m.contour(x, y, B, levels)
	plot_arms(m, detectors)
	ax.set_title('$B \in [%.2e, %.2e]$'%(min(B.flatten()), max(B.flatten())))

	ax = fig.add_axes(boundingbox(2,2,2,1))
	m = mollwiede_map(ax)
	levels = 20
	x, y = m(RAs*180./pi, decs*180./pi)
	CS = m.contour(x, y, C, levels)
	plot_arms(m, detectors)
	ax.set_title('$C \in [%.2e, %.2e]$'%(min(C.flatten()), max(C.flatten())))

	ax = fig.add_axes(boundingbox(2,2,2,2))
	m = mollwiede_map(ax)
	levels = 20
	x, y = m(RAs*180./pi, decs*180./pi)
	CS = m.contour(x, y, scipy.log(D), levels)
	plot_arms(m, detectors)
	ax.set_title('$\log(D) ,\, D \in [%.2e, %.2e]$'%(min(D.flatten()), max(D.flatten())))