Example #1
0
                    vmin=np.maximum(np.min(z), -16.0),
                    vmax=0.0,
                    origin='lower')
    cb = fig.colorbar(cax)

    cb.set_label('log abs dfriddr err')
    ax.set_title(title)
    ax.set_xlabel('lnT')
    ax.set_ylabel('LnRho')
    fig.savefig(name)
    plt.close(fig)


mod = "kap"

pym.buildModule(mod)

const_lib, const_def = pym.loadMod("const")
crlibm_lib, _ = pym.loadMod("crlibm")
chem_lib, chem_def = pym.loadMod("chem")
kap_lib, kap_def = pym.loadMod("kap")

ierr = 0

crlibm_lib.crlibm_init()
const_lib.const_init(pym.MESA_DIR, ierr)
chem_lib.chem_init('isotopes.data', ierr)

kap_lib.kap_init('gs98', 'gs98_co', 'lowT_fa05_gs98', 3.88, 3.80, 3.80, False,
                 pym.KAP_CACHE, '', ierr)
Example #2
0
import pyMesaUtils as pym
import numpy as np

pym.buildModule('kap')

eos_lib, eos_def = pym.loadMod("eos")
const_lib, const_def = pym.loadMod("const")
crlibm_lib, _ = pym.loadMod("crlibm")
chem_lib, chem_def = pym.loadMod("chem")
kap_lib, kap_def = pym.loadMod("kap")

ierr = 0

const_lib.const_init('', ierr)
crlibm_lib.crlibm_init()
chem_lib.chem_init('isotopes.data', ierr)

if pym.MESA_VERSION >= 11354:
    kap_lib.kap_init('gs98', 'gs98_co', 'lowT_fa05_gs98', 3.88, 3.80, True,
                     pym.KAP_CACHE, '', False, ierr)
elif pym.MESA_VERSION >= 10398 and pym.MESA_VERSION < 11354:
    kap_lib.kap_init('gs98', 'gs98_co', 'lowT_fa05_gs98', 3.88, 3.80, True,
                     pym.KAP_CACHE, '', ierr)
else:
    kap_lib.kap_init('gs98', 'gs98_co', 'lowT_fa05_gs98', 3.88, 3.80, 3.80,
                     True, pym.KAP_CACHE, '', ierr)

kap_handle = kap_lib.alloc_kap_handle(ierr)

if pym.MESA_VERSION >= 10398:
    kap_lib.kap_set_choices(kap_handle, False, False, True, True, True, 0.71,