示例#1
0
                                                                                                                                                                     8]
    idx = np.argmax(loglikelihood)
    t0_best, mej_1_best, vej_1_best, Xlan_1_best, mej_2_best, vej_2_best, Xlan_2_best, zp_best = data[
        idx, 0], 10**data[idx, 1], data[idx, 2], 10**data[idx, 3], 10**data[
            idx, 4], data[idx, 5], 10**data[idx, 6], data[idx, 7]

    if opts.doAbsorption:
        t_best, lambdas_best, spec_best = Ka2017x2_model_spec_ejecta_absorption(
            mej_1_best, vej_1_best, Xlan_1_best, mej_2_best, vej_2_best,
            Xlan_2_best)
    else:
        t_best, lambdas_best, spec_best = Ka2017x2_model_spec_ejecta(
            mej_1_best, vej_1_best, Xlan_1_best, mej_2_best, vej_2_best,
            Xlan_2_best)

truths = lightcurve_utils.get_truths(opts.name, opts.model, n_params, True)

pcklFile = os.path.join(plotDir, "data.pkl")
f = open(pcklFile, 'wb')
pickle.dump((data_out, data, t_best, lambdas_best, spec_best, t0_best, zp_best,
             n_params, labels, truths), f)
f.close()

if n_params >= 8:
    title_fontsize = 26
    label_fontsize = 30
else:
    title_fontsize = 24
    label_fontsize = 28

plotName = "%s/corner.pdf" % (plotDir)
示例#2
0
            svd_mag_color_model = pickle.load(handle)
        Global.svd_mag_color_model = svd_mag_color_model
    elif opts.model in ["Ka2017x2inc", "Ka2017x3inc"]:
        Global.svd_mag_color_models = []
        for colorm in colormodel:
            if colorm == "a1.0":
                Global.svd_mag_color_models.append("a1.0")
            else:
                modelfile = os.path.join(ModelPath, '%s.pkl' % colorm)
                with open(modelfile, 'rb') as handle:
                    svd_mag_color_model = pickle.load(handle)
                Global.svd_mag_color_models.append(svd_mag_color_model)

data, tmag, lbol, mag, t0_best, zp_best, n_params, labels, best = run.multinest(
    opts, plotDir)
truths = lightcurve_utils.get_truths(opts.name, opts.model, n_params,
                                     opts.doEjecta)

pcklFile = os.path.join(plotDir, "data.pkl")
f = open(pcklFile, 'wb')
pickle.dump((data_out, data, tmag, lbol, mag, t0_best, zp_best, n_params,
             labels, best, truths), f)
f.close()

if n_params >= 6:
    title_fontsize = 36
    label_fontsize = 36
else:
    title_fontsize = 30
    label_fontsize = 30

plotName = "%s/corner.pdf" % (plotDir)