Exemplo n.º 1
0
def plotParamMargs(x, nbins=50):

    r = bnmin1utils.ChainToArray(x)
    pyxplot.histogram(
        [[r[:, 0] * 0.5, ""]], "o/mcmc_amp.eps", width=10, xlabel="Amplitude", nbins=nbins, relative=True, key=None
    )

    pyxplot.histogram(
        [[r[:, 3], ""]], "o/mcmc_sigma.eps", width=10, xlabel="Width", nbins=nbins, relative=True, key=None
    )

    pyxplot.histogram(
        [[r[:, 1], ""]], "o/mcmc_pos.eps", width=10, xlabel="Position", nbins=nbins, relative=True, key=None
    )

    pyxplot.histogram(
        [[r[:, 4], ""]], "o/mcmc_rot.eps", width=10, xlabel="Rotation", nbins=nbins, relative=True, key=None
    )

    pl = ["Amplitude", "x-position", "y-position", "width", "squint", "rotation"]
    for i in range(len(pl)):
        pyxplot.histogram(
            [[r[:, i], ""]], "o/mcmc-%i.eps" % (i,), width=10, xlabel="Rotation", nbins=nbins, relative=True, key=None
        )
        for j in range(i + 1, len(pl)):
            twod.hist2d(r[:, i], r[:, j], "o/mcmc-%i-%i.eps" % (i, j), xlabel=pl[i], ylabel=pl[j])
Exemplo n.º 2
0
def plotmode(n=1000):
    xx, xy = [], []
    for i in range(n):
        x = maxpix(MkIllMap(256))
        xx.append(x[0])
        xy.append(x[1])
    pyxplot.histogram([[xx, "x"], [xy, "y"]], "o/pixpos.eps", width=10, xlabel="position")

    return xx, xy
Exemplo n.º 3
0
def plotchi():
    xlabel = r"$-\log P(x|\theta)$"
    d = numpy.array(pickle.load(open(("o/ampbiasdata.p"))))
    d2 = numpy.array(pickle.load(open(("o/ampbiasdata-npos.p"))))
    pyxplot.histogram(
        [[d[0, :, 2] * 4, ""], [d2[0, :, 2] * 4, ""]], "o/chisqhist.eps", width=10, xlabel=xlabel, nbins=50
    )

    obsdst.cuml([[d[0, :, 2] * 4, ""], [d2[0, :, 2] * 4, ""]], "o/chisqcuml.eps", xlabel=xlabel, fmin=0.48, fmax=0.52)
Exemplo n.º 4
0
def PlotAmpBias(fin="o/ampbiasdata.p", fout="o/amp"):
    r, r2 = pickle.load(open(fin))
    noise = 0.5
    print "%shist-%i.eps" % (fout, noise * 10)
    print "o/%scuml-%i.eps" % (fout, noise * 10)
    pyxplot.histogram([[r, ""], [r2, ""]], "%shist-%i.eps" % (fout, noise * 10), width=10, xlabel="Amplitude", nbins=50)

    obsdst.cuml([[r, ""], [r2, ""]], "%scuml-%i.eps" % (fout, noise * 10), xlabel="Amplitude", fmin=0.4, fmax=0.6)

    obsdst.cuml([[r, ""], [r2, ""]], "%suml-%i-whole.eps" % (fout, noise * 10), xlabel="Amplitude")
Exemplo n.º 5
0
def plotSinlgeParDist(din,
                      parname,
                      fnameout,
                      burn=0):
    """
    Plot the distribution of a single parameter
    """
    d=din.data.field(parname)
    x=d[burn*len(d):]
    pyxplot.histogram( [ (x, "")],
                       fnameout,
                       xax=pyxplot.axis(escapeAxisName(parname)),
                       width=pyxplot.MNRAS_SC,
                       nbins=20,
                       key=None)
Exemplo n.º 6
0
def ElHist():

    "Compute histogram of measured elevations"

    res =  []
    for scandir , obsds in izip(allscans , obsscans) :
        el=pyfits.open(obsds)[0].header["meanel"]
        
        res.append(el)

    res.sort()

    pyxplot.histogram( [ ( res , "" ) ],
                       "plots/el-hist.eps",
                       width=pyxplot.THESIS ,
                       key=None ,
                       nbins=9,
                       xax=pyxplot.axis(r"$\theta\,$(deg)", xmin=0 , xmax=90)
                       )
Exemplo n.º 7
0
def plotMCMCbias():
    x = readMapMCMC()
    pyxplot.histogram([[x, ""]], "o/mcmc_bias.eps", width=10, xlabel="Amplitude", nbins=100, relative=True, key=None)