import h2o_ddb import h2o_bk import matplotlib.pyplot as plt import numpy as np f = np.arange(1, 1000, 1) P = 0.1 T = 300.0 X_h2o = 3.3E-04 X_he = 0.1 X_h2 = 1.0 - (X_h2o+X_he) X = [X_h2, X_he, X_h2o] P_dict = {'H2':0,'HE':1,'H2O':2} otherpar = [] addb = h2o_ddb.alpha(f,T,P,X,P_dict,otherpar) abk = h2o_bk.alpha(f,T,P,X,P_dict,otherpar) #plt.loglog(f,addb) plt.loglog(f,abk)
import h2o_ddb import h2o_bk import matplotlib.pyplot as plt import numpy as np f = np.arange(1, 1000, 1) P = 0.1 T = 300.0 X_h2o = 3.3E-04 X_he = 0.1 X_h2 = 1.0 - (X_h2o + X_he) X = [X_h2, X_he, X_h2o] P_dict = {'H2': 0, 'HE': 1, 'H2O': 2} otherpar = [] addb = h2o_ddb.alpha(f, T, P, X, P_dict, otherpar) abk = h2o_bk.alpha(f, T, P, X, P_dict, otherpar) #plt.loglog(f,addb) plt.loglog(f, abk)
2400., 3200., ] X_h2o = 0.005 X_he = 0.10 X_h2 = 1.0 - (X_h2o + X_he) X_partial = [X_h2, X_he, X_h2o] P_dict = {'H2': 0, 'HE': 1, 'H2O': 2} a_bk = [] a_ddb = [] for i in range(len(jupiterTestP)): T = jupiterTestT[i] P = jupiterTestP[i] a_bk.append(h2o_bk.alpha(f, T, P, X_partial, P_dict, other_dict)) a_ddb.append(h2o_ddb.alpha(f, T, P, X_partial, P_dict, other_dict)) print '%5.0f\t%4.0f\t%.3f\t%.3f' % (T, P, a_bk[i][0], a_ddb[i][0]) a_bk = np.array(a_bk) a_ddb = np.array(a_ddb) plt.figure('samples') for i in range(len(f)): s = '%.0f GHz' % (f[i]) print s plt.plot(jupiterTestP, a_bk[:, i], 'bo') plt.plot(jupiterTestP, a_bk[:, i], 'b', label=s) plt.plot(jupiterTestP, a_ddb[:, i], 'ro') plt.plot(jupiterTestP, a_ddb[:, i], 'r', label=s) plt.xscale('log') plt.yscale('log') plt.legend() plt.xlabel('Pressure [bars]')