def ATPEnergyContourPlot(ax, CO2origin='pH', pHrange=np.linspace(7, 14, num=11), Trange=np.linspace(273, 473, num=11)): plotkey = 'ATPGibbs' Meshes = EnceladusGrids.getMesh(Trange, pHrange, params=[plotkey]) XX = Meshes['pH'] YY = Meshes['T'] ZZ = Meshes[plotkey] contf = ax.contourf(XX, YY, ZZ[0], levels=np.arange(55000, 68000, 1000), cmap='cool_r', vmin=55000, vmax=68000) cont = ax.contour(XX, YY, ZZ[0], levels=5, colors=['k'], vmin=55000, vmax=68000) ax.clabel(cont, inline=1, fontsize=12, fmt='%d') # add label return ax, contf
def PSContourPlot(ax, CO2origin='pH', pHrange=np.linspace(7, 14, num=11), Trange=np.linspace(273, 473, num=21), cmap='PuBu', maincont=0, mesh=False, k_corr=0.0, nATP=1.0): plotkey = 'PowerSupply' Meshes = EnceladusGrids.getMesh(Trange, pHrange, params=[plotkey], CO2origin=CO2origin, k_corr=k_corr, nATP=nATP) XX = Meshes['pH'] YY = Meshes['T'] ZZ = Meshes[plotkey] contourlevels = [-25, -15, -10, -5] cmap = plt.cm.get_cmap(cmap, 15) if mesh: contf = ax.pcolormesh(XX, YY, np.log10(ZZ[maincont]), vmin=-25, vmax=-5, shading='nearest', cmap=cmap, edgecolor='slategray', linewidth=1) else: contf = ax.contourf(XX, YY, np.log10(ZZ[maincont]), levels=np.arange(-25, -4, 1), cmap=cmap, vmin=-25, vmax=-5, extend='both') return ax, contf
def MethanogenesisEnergyContourPlot(ax, CO2origin='pH', pHrange=np.linspace(7, 14, num=11), Trange=np.linspace(273, 473, num=11), maincont=0, quotienttype='salty_nominal'): plotkey = 'Gibbs_Methanogenesis' Meshes = EnceladusGrids.getMesh(Trange, pHrange, params=[plotkey], CO2origin=CO2origin, quotienttype=quotienttype) XX = Meshes['pH'] YY = Meshes['T'] ZZ = Meshes[plotkey] levels = [-150, -75, 0, 75] # contf = ax.contourf(XX, YY, ZZ[maincont], levels=np.arange(-150000, 150000, 3000), cmap=energycolormap(), vmin=-150000, vmax=150000, extend='both') contf = ax.contourf(XX, YY, ZZ[maincont] / 1000, levels=np.arange(-160, 80, 2.5), cmap=energycolormap(), vmin=-160, vmax=80, extend='both') contourcolor = 'k' #'dimgray' cont = ax.contour(XX, YY, ZZ[0] / 1000, levels=levels, colors=[contourcolor], vmin=-150000, vmax=80000, linewidths=2.5) ax.clabel(cont, inline=1, fontsize=16, fmt='%d') # add label ax.contour(XX, YY, ZZ[1] / 1000, levels=levels, linestyles='dotted', colors=[contourcolor], vmin=-150, vmax=80, linewidths=2.5) ax.contour(XX, YY, ZZ[2] / 1000, levels=levels, linestyles='dotted', colors=[contourcolor], vmin=-150, vmax=80, linewidths=2.5) ax.plot([0, 0], [0, 0], c=contourcolor, label='Uncertainty bounds on Gibbs free energy contour', linestyle='dotted', linewidth=2.5) return ax, contf