#    pl.title("Lognormal with Mach")
#    pl.savefig(savepath+"LognormalWithMach_%s_v_%s_mcmc.png" % (p1,p2))

#for fignum2,(p1,p2) in enumerate(itertools.combinations(('tauoneone_mu','tautwotwo_mu','tau_ratio','sigma','meandens'),2)):
#    pymc_plotting.hist2d(mc_simple, p1, p2, bins=30, clear=True, fignum=fignum+fignum2+1, varslice=varslice, colorbar=True)
#    pl.title("Lognormal - just $\\tau$ fits")
#    pl.savefig(savepath+"LognormalJustTau_%s_v_%s_mcmc.png" % (p1,p2))

docontours_all(mc_lognormal, mc_simple, mc_lognormal_freemach)

if domillion:
    print "\nSimple sampling 1 million"
    mc_simple.sample(1e6)
    mc_lognormal_simple_traces = save_traces(
        mc_simple,
        trace_data_path +
        "mc_lognormal_simple_traces%s_opr%s.fits" % (abundance, opr),
        clobber=True)
    print "\nlognormal sampling 1 million"
    mc_lognormal.sample(1e6)
    mc_lognormal_traces = save_traces(
        mc_lognormal,
        trace_data_path +
        "mc_lognormal_withmach_traces%s_opr%s.fits" % (abundance, opr),
        clobber=True)
    print "\nlognormal (freemach) sampling 1 million"
    mc_lognormal_freemach.sample(1e6)
    mc_lognormal_freemach_traces = save_traces(
        mc_lognormal_freemach,
        trace_data_path +
        "mc_lognormal_freemach_traces%s_opr%s.fits" % (abundance, opr),
        savename=savepath + "mc_hopkins_justtau_multipanel_abundance%s_opr%s.pdf" % (abundance, opr),
        dosave=True,
        parnames=("tauoneone_mu", "tautwotwo_mu", "meandens", "sigma", "tau_ratio", "Tval"),
    )
    # docontours_multi(mc_hopkins_simple,start=10000,savename=savepath+"mc_hopkins_justtau_multipanel_deviance.pdf", dosave=True,
    #                 parnames=('tauoneone_mu','tautwotwo_mu','meandens','sigma','tau_ratio','Tval','deviance'))


docontours_all(mc_hopkins_freemach, mc_hopkins, mc_hopkins_simple)

if domillion:
    print "\nsimple hopkins sampling 1 million"
    mc_hopkins_simple.sample(1e6)
    save_traces(
        mc_hopkins_simple,
        trace_data_path + "mc_hopkins_simple_traces_abundance%s_opr%s.fits" % (abundance, opr),
        clobber=True,
    )
    print "\nhopkins sampling 1 million"
    mc_hopkins.sample(1e6)
    save_traces(
        mc_hopkins,
        trace_data_path + "mc_hopkins_withmach_traces_abundance%s_opr%s.fits" % (abundance, opr),
        clobber=True,
    )
    print "\nhopkins freemach sampling 1 million"
    mc_hopkins_freemach.sample(1e6)
    save_traces(
        mc_hopkins_freemach,
        trace_data_path + "mc_hopkins_freemach_traces_abundance%s_opr%s.fits" % (abundance, opr),
        clobber=True,