#

from __future__ import division

from pystellar.density import density
from pystellar.opacity import OpacityTable
from pystellar.threading import ObjectsManager, EngineManager

import numpy as np
import time
import logging

X = 0.70
Y = 0.28

log = logging.getLogger('pystellar.opacity')
log.setLevel(logging.DEBUG)
console = logging.StreamHandler()
console.setLevel(logging.DEBUG)
log.addHandler(console)

OP = OpacityTable(fkey='OP17', X=0.70, Y=0.28, efkey='cunha06')
P, T = [8.726086186677213013e+07, 4.576702504411734481e+03]

rho = density(P=P, T=T, X=X, Y=Y)

print OP.kappa(rho=rho, T=T)
print OP.make_points(logT=np.log10(T), logrho=np.log10(rho))
T = 11264.2381423
rho = 0.0044603404639
print OP.kappa(T=T, rho=rho)
Beispiel #2
0
Opacity.start()

print ""

print "Settings for the Sun"
print "M = %10.6g g" % Ms
print "X = %10.3f" % X
print "Y = %10.3f" % Y
print u"μ = %10.3f" % mmw(X=X,Y=Y)
print ""

m = 1.9890999983295044e+33

print "Inner Boundary Conditions"
print "    Initial Step:"
print "    m = %10.6e g" % m
(r,l,P,T) = [  6.96000000e+10,   2.13492744e+33,   3.64246107e+27,  5.77489402e+03]
print "At m=m:"
print "    r = %10.6e cm" % r
print "    l = %10.6e erg/s" % l
print "    P = %10.6e Dyne/cm^2" % P
print "    T = %10.6e K" % T
print u"      = %10.6e " % density(P=P,T=T,X=X,Y=Y)
print "Derivatives"
(dr,dl,dP,dT) = derivatives(np.array([m]),np.atleast_2d([r,l,P,T]),mu=mmw(X=X,Y=Y),optable=Opacity,X=X,XCNO=(1-X-Y),cfg=Config["Data.Energy"])
print "    dr = %10.6e" % dr
print "    dl = %10.6e" % dl
print "    dP = %10.6e" % dP
print "    dT = %10.6e" % dT
print ""
Opacity.stop()

from __future__ import division

from pystellar.density import density
from pystellar.opacity import OpacityTable
from pystellar.threading import ObjectsManager, EngineManager

import numpy as np
import time
import logging

X = 0.70
Y = 0.28

log = logging.getLogger('pystellar.opacity')
log.setLevel(logging.DEBUG)
console = logging.StreamHandler()
console.setLevel(logging.DEBUG)
log.addHandler(console)

OP = OpacityTable(fkey='OP17',X=0.70,Y=0.28,efkey='cunha06')
P, T = [8.726086186677213013e+07, 4.576702504411734481e+03]

rho = density(P=P,T=T,X=X,Y=Y)

print OP.kappa(rho=rho,T=T)
print OP.make_points(logT=np.log10(T),logrho=np.log10(rho))
T= 11264.2381423
rho=0.0044603404639
print OP.kappa(T=T,rho=rho)