area = p.sizI * p.sizJ * ucArea * toCm * toCm x = np.array(x) y = np.array(y) x = 1 / kb / x y = y / (p.sizI * p.sizJ) ax.plot(x, y, label=label, ls="-", marker=marker, mfc=color) ax.set_yscale("log") ax.legend(loc="best", prop={'size': 6}) workingPath = os.getcwd() x = [] y = [] temperatures = True try: iter = inf.getTemperatures() except ValueError: iter = inf.getPressures() y2 = np.zeros(shape=(len(iter), 7)) print(np.shape(y2)) if iter[0] < 15: temperatures = False i = 0 for f in iter: try: os.chdir(str(f) + "/results") runFolder = glob.glob("*/") runFolder.sort() os.chdir(runFolder[-1]) except FileNotFoundError:
plt.title("$ R \propto d ( \\frac{s v_s}{r_g^2} )$") label = r'$\frac{s v_s}{r_g^2}$' plt.ylabel(label) label = r'R (total rate)' plt.xlabel(label) plt.grid(True) workingPath = os.getcwd() for f in i.getFluxes(): folder = "flux3.5e" + str(i) print(folder) try: p = i.getInputParameters(glob.glob(f + "/*/output*")[0]) os.chdir(f) temperatures = i.getTemperatures() meanValues = mk.getIslandDistribution(temperatures, False, False) except (OSError, IndexError): print("error changing to flux {}".format(f)) continue os.chdir(workingPath) vs = meanValues.getGrowthSlope() s = (0.3 * 400 * 400) / meanValues.getIslandsAmount() vg = meanValues.getGyradiusSlope() rtt = mk.getRtt(temperatures) d = fun.fractalD(rtt / p.flux) rg = meanValues.getLastGyradius() print(len(d), len(s), len(rg)) command = "d * ((s*vs)/rg**2)" y = eval(command) x = meanValues.getTotalRatio()
import re import info as inf import energies as e import matplotlib.pyplot as plt from matplotlib.ticker import FixedFormatter import os import glob import numpy as np import multiplicitiesPlot as mp import multiplicitiesInfo as mi ########################################################## ########## Main function ##################### ########################################################## temperatures = inf.getTemperatures("float") temperatures = np.array([v for v in temperatures if v > 400 and v < 1560]) maxRanges = len(temperatures) kb = 8.6173324e-5 p = inf.getInputParameters(inf.getLastOutputFile("*")) print("Reference file is ", inf.getLastOutputFile("*")) maxCo2 = int(p.nCo2 / 10) total = False sp = False rAndM = False omegas = False sensibility = False tofSensibility = False kindOfSensibility = False ext = "" if len(sys.argv) > 1:
#W = np.array(W) #print(np.shape(W)) #lg, = ax.loglog(x, np.sum(W, axis=0), "+", label="W sum"); handles.append(lg) plt.legend(handles=handles, loc="best") fig = plt.figure(figsize=(15, 15)) ax = fig.gca() workingPath = os.getcwd() for f in inf.getFluxes(): os.chdir(workingPath) print(f) os.chdir(f) fPath = os.getcwd() for t in inf.getTemperatures(): print("\t", t) try: os.chdir(str(t) + "/results") fig.clf() ax = fig.gca() ratioplicity(ax) #ax.set_ylim(1e-4,1e1) #ax.set_yscale("linear") #ax.set_ylim(0,6) fig.savefig("ratioplicity" + str(t) + ".pdf", bbox_inches='tight') except FileNotFoundError: pass os.chdir(fPath) ratios = p.getRatios().reshape(7, 7)
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Morphokinetics. If not, see <http://www.gnu.org/licenses/>. import os import sys import glob import info as inf import shutil as sh import pdb temperatures = inf.getTemperatures() cov = 20 if len(sys.argv) > 1: cov = int(sys.argv[1]) surfaces = ' '.join("psd" + str(cov) + str(t) + ".png" for t in temperatures) workingPath = os.getcwd() for i, t in enumerate(temperatures): print(t) os.chdir(workingPath) try: os.chdir(str(t) + "/results") runFolder = glob.glob("*/") runFolder.sort() os.chdir(runFolder[-1]) os.chdir("results")
filesN = glob.glob("data[0-9]*.txt") for i in range(0, len(filesN) - 1): fileName = "data" + str(i) + ".txt" allData.append(np.loadtxt(fname=fileName)) #plt.loglog(allData[1], allData[15]) ########################################################## ########## Main function ##################### ########################################################## workingPath = os.getcwd() fluxes = i.getFluxes() for f in fluxes: firstCollisionTime = [] temperaturesPlot = [] print(f) os.chdir(f) fPath = os.getcwd() for t in i.getTemperatures(): try: os.chdir(str(t) + "/results") print("\t", t) i.splitAeFiles() #diffusivityDistance() # find first dimer occurrence except FileNotFoundError: pass os.chdir(fPath) os.chdir(workingPath)
loc=2, borderaxespad=0.) plt.grid() plt.title("flux: {:.1e} temperature: {:d}".format(p.flux, int(p.temp))) plt.savefig("../../../plot2" + str(p.flux) + str(p.temp) + ".png") ########################################################## ########## Main function ##################### ########################################################## workingPath = os.getcwd() fluxes = inf.getFluxes() for f in fluxes: firstCollisionTime = [] temperaturesPlot = [] print(f) os.chdir(f) fPath = os.getcwd() for t in inf.getTemperatures()[15:]: try: os.chdir(str(t) + "/results") print("\t", t) inf.splitDataFiles() diffusivityDistance() except FileNotFoundError: pass os.chdir(fPath) os.chdir(workingPath) plt.legend()
x = 1 / kb / x y = y / (p.sizI * p.sizJ) ax.plot(x, y, marker=".", color=cm(i / 20)) ax.set_yscale("log") def plotError(x, y, p, ax): ax.boxplot(y) workingPath = os.getcwd() x = [] y = [] temperatures = True try: mIter = np.array([i for i in inf.getTemperatures() if i <= 900]) #filter temperatures higher than 500 except ValueError: mIter = inf.getPressures() y2 = np.zeros(shape=(len(mIter), 7)) print(np.shape(y2)) if mIter[0] < 15: temperatures = False i = 0 allRates = np.zeros((len(mIter), 20, mMsr)) for i, f in enumerate(mIter): try: os.chdir(str(f) + "/results") runFolder = glob.glob("*/")
########## Main function ##################### ########################################################## workingPath = os.getcwd() fluxes = inf.getFluxes() i = 0 f = "flux3.5e0" for f in fluxes: #if True: temperaturesPlot = [] print(f) os.chdir(f) fig1, ax1 = plt.subplots(1, 1, sharey=True, figsize=(5.7, 4)) fig2, ax2 = plt.subplots(1, 1, sharey=True, figsize=(5.7, 4)) fPath = os.getcwd() for t in list(reversed(inf.getTemperatures())): if t == 335 or t >= 1000 or t < 120 or t == 175: continue try: os.chdir(str(t) + "/results") print("\t", t) fig1.subplots_adjust(top=0.95, bottom=0.15, wspace=0.08, left=0.15, right=0.85) fig2.subplots_adjust(top=0.95, bottom=0.15, wspace=0.08, left=0.15, right=0.85)