コード例 #1
0
plt.ylabel(r'Peak i-band magnitude')
plt.gca().invert_yaxis()
cbar = plt.colorbar()
cbar.set_label(r'Ejecta mass log10($M_{\odot}$)')
plt.savefig(plotName)
plt.close()

bounds = [15, 35]
xlims = [15.0, 35.0]
ylims = [1e-2, 1]

plotName = "%s/appi.pdf" % (plotDir)
plt.figure(figsize=(10, 8))
for ii, model in enumerate(models):
    legend_name = get_legend(model)
    bins, hist1 = lightcurve_utils.hist_results(
        model_tables[model]["peak_appmag_i"], Nbins=25, bounds=bounds)
    plt.semilogy(bins,
                 hist1,
                 '-',
                 color=colors_names[ii],
                 linewidth=3,
                 label=legend_name)
plt.xlabel(r"Apparent Magnitude [mag]", fontsize=24)
plt.ylabel('Probability Density Function', fontsize=24)
plt.legend(loc="best", prop={'size': 24})
plt.xticks(fontsize=24)
plt.yticks(fontsize=24)
plt.xlim(xlims)
plt.ylim(ylims)
plt.savefig(plotName)
plt.close()
コード例 #2
0
                 linestyle='--',
                 linewidth=2)
g.ax_marg_y.plot([0., 1500], [197., 197.],
                 color=color2,
                 linestyle='--',
                 linewidth=2)
g.ax_marg_x.text(1.42, 3500, '$q < 1.38$', color=color2, fontsize=14)
g.ax_marg_y.text(1100,
                 150,
                 '$\\tilde{\\Lambda} > 197$',
                 color=color2,
                 fontsize=14,
                 rotation=-90)

bounds = [1.0, 1.7]
bins, hist1 = lightcurve_utils.hist_results(q_gw, Nbins=15, bounds=bounds)
hist1 = 4800.0 * hist1 / np.max(hist1)
for ii in range(len(bins) - 1):
    bin_start, bin_end = bins[ii], bins[ii + 1]
    val = hist1[ii]
    #g.ax_marg_x.fill_between([bin_start, bin_end],[0,0],[val,val],facecolor=color1,alpha=1.0)
    #g.ax_marg_x.plot([bin_start, bin_end],[val,val],color=color1,alpha=1.0)

bounds = [0, 600]
bins, hist1 = lightcurve_utils.hist_results(lambdatilde_gw,
                                            Nbins=25,
                                            bounds=bounds)
hist1 = 1500.0 * hist1 / np.max(hist1)
for ii in range(len(bins) - 1):
    bin_start, bin_end = bins[ii], bins[ii + 1]
    val = hist1[ii]
コード例 #3
0
        elif opts.labelType == "model":
            color = colors[ii]
            colortrue = colors[ii]
            linestyle = linestyles[jj]
        else:
            color = 'b'
            colortrue = 'k'
            linestyle = '-'

        samples = np.log10(post[name][errorbudget]["mej"])
        if (opts.labelType == "errorbar") and (float(errorbudget) < 1.0):
            bounds = [-2.8, -1.8]
        else:
            bounds = [-3.5, 0.0]
        bins, hist1 = lightcurve_utils.hist_results(samples,
                                                    Nbins=25,
                                                    bounds=bounds)
        if (opts.labelType == "name" or opts.labelType == "model") and jj > 0:
            plt.semilogy(bins, hist1, '%s%s' % (color, linestyle), linewidth=3)
        else:
            plt.semilogy(bins,
                         hist1,
                         '%s%s' % (color, linestyle),
                         label=label,
                         linewidth=3)

        plt.semilogy([
            post[name][errorbudget]["truths"][1],
            post[name][errorbudget]["truths"][1]
        ], [1e-3, 100.0],
                     '%s--' % colortrue,
color2 = 'coral'
color1 = 'cornflowerblue'
color3 = 'palegreen'
color4 = 'darkmagenta'
colors_names = [color1, color2, color3, color4]

bounds = [16, 34]
xlims = [15.0, 35.0]
ylims = [1e-2, 1]

plotName = "%s/appi.pdf" % (baseoutputDir)
plt.figure(figsize=(12, 8))
for ii, distance_set in enumerate(distance_sets):
    distance_underscore = "%d_%d" % (distance_set[0], distance_set[1])
    legend_name = "%d-%d Mpc" % (distance_set[0], distance_set[1])
    bins, hist1 = lightcurve_utils.hist_results(
        data[distance_underscore]["K"][:, 4], Nbins=25, bounds=bounds)
    plt.semilogy(bins,
                 hist1,
                 '-',
                 color=colors_names[ii],
                 linewidth=3,
                 label=legend_name)
    bins, hist1 = lightcurve_utils.hist_results(
        data[distance_underscore]["g"][:, 4], Nbins=25, bounds=bounds)
    plt.semilogy(bins, hist1, '--', color=colors_names[ii], linewidth=3)
plt.xlabel(r"Apparent Magnitude [mag]", fontsize=24)
plt.ylabel('Probability Density Function', fontsize=24)
plt.legend(loc="best", prop={'size': 24})
plt.xticks(fontsize=24)
plt.yticks(fontsize=24)
plt.xlim(xlims)
コード例 #5
0
     opts.analysisType) + "_m1_" + str(
         np.round(m1m, decimals=1)) + "_m2_" + str(
             np.round(
                 m2m,
                 decimals=1)) + '_chi_' + str(chi) + ".pdf"
 if twixie_tf:
     plotName = "/home/andrew.toivonen/gwemlightcurves/mass_plots/mej_" + str(
         opts.analysisType) + "_m1_" + str(
             np.round(m1m, decimals=1)) + "_m2_" + str(
                 np.round(m2m, decimals=1)) + "twixie.pdf"
 plt.figure(figsize=(15, 10))
 ax = plt.gca()
 for ii, model in enumerate(models):
     legend_name = get_legend(model) + ' EOS: ' + runType
     bins, hist1 = lightcurve_utils.hist_results(
         np.log10(samples_gp["mej"]),
         Nbins=20,
         bounds=bounds)
     plt.step(bins,
              hist1,
              '-',
              color='b',
              linewidth=3,
              label=legend_name,
              where='mid')
     lim = np.percentile(np.log10(samples_gp["mej"]), 90)
     plt.plot([lim, lim], ylims, 'k--')
 plt.xlabel(r"${\rm log}_{10} (M_{\rm ej})$", fontsize=24)
 plt.ylabel('Probability Density Function', fontsize=24)
 #plt.legend(loc="best",prop={'size':24})
 plt.xticks(fontsize=24)
 plt.yticks(fontsize=24)
コード例 #6
0
    samples['mej'] = samples['mej'] * 10.0

    idx = np.where(samples['mej'] > 0.1)[0]
    samples['mej'][idx] = 0.1

bounds = [-3.0, -1.0]
xlims = [-2.8, -1.0]
ylims = [1e-1, 2]

plotName = "%s/mej.pdf" % (plotDir)
plt.figure(figsize=(15, 10))
ax = plt.gca()
for ii, model in enumerate(models):
    legend_name = get_legend(model)
    bins, hist1 = lightcurve_utils.hist_results(np.log10(samples["mej"]),
                                                Nbins=20,
                                                bounds=bounds)
    plt.step(bins,
             hist1,
             '-',
             color='k',
             linewidth=3,
             label=legend_name,
             where='mid')
    lim = np.percentile(np.log10(samples["mej"]), 90)
    plt.plot([lim, lim], ylims, 'k--')
plt.xlabel(r"${\rm log}_{10} (M_{\rm ej})$", fontsize=24)
plt.ylabel('Probability Density Function', fontsize=24)
#plt.legend(loc="best",prop={'size':24})
plt.xticks(fontsize=24)
plt.yticks(fontsize=24)