print('maxe', maxe) print('minlndos', minlndos) print('maxlndos', maxlndos) print('numframes', numframes) for frame in range(numframes): if frame % 10 == 0: print('working on frame %d/%d' % (frame, numframes)) plt.cla() basename = dataformat % frame e, lndos = readandcompute.e_lndos(basename) ax.plot(e, lndos, 'k-') datname = basename + '-lndos.dat' min_T = readandcompute.minT(datname) try: ax.axvline(-readandcompute.max_entropy_state(basename), color='r', linestyle=':') min_important_energy = readandcompute.min_important_energy(basename) ax.axvline(-min_important_energy, color='b', linestyle=':') ax.plot(e, (e + min_important_energy) / min_T + lndos[min_important_energy], 'g--') ax.axvline(-readandcompute.converged_state(datname), color='c', linestyle=':') except: pass e, lnw = readandcompute.e_lnw(basename) ax.plot(e, -lnw, 'r:')
] first_method = True the_first_method = '' first_temperature = [True, True, True] methods = [ '-tmi', '-toe', '-tmmc', ] for i in range(len(methods)): method = methods[i] fbase = 'data/lv/ww%.2f-ff%.2f-%gx%g%s' % (ww, ff, lenx, lenyz, method) fname = fbase + '-density.dat' try: minT = readandcompute.minT(fname) convergedT = readandcompute.convergedT(fname) for T in Ts: if T >= minT and T >= convergedT * 0.8: density, x = readandcompute.density_x(fbase, T) plt.plot(x / 2, density, color(T) + lines[i]) if first_method or method == the_first_method: if first_temperature[i]: plt.plot(x / 2, density, color(T) + lines[i], label='T=%g %s (converged to %.2g)' % (T, method[1:], convergedT)) first_temperature[i] = False else:
print 'numframes', numframes for frame in xrange(numframes): if frame % 10 == 0: print 'working on frame %d/%d' % (frame, numframes) plt.cla() for suffix_index in range(len(suffixes)): suffix = suffixes[suffix_index] basename = dataformat % (suffix, frame*skipby) try: e, hist = readandcompute.e_and_total_init_histogram(basename) ax.plot(e, hist, colors[suffix_index]+'-', label=suffix) datname = basename+'-transitions.dat' min_T = readandcompute.minT(datname) ax.axvline(-readandcompute.max_entropy_state(basename), color='r', linestyle=':') min_important_energy = readandcompute.min_important_energy(basename) ax.axvline(-min_important_energy, color='b', linestyle=':') ax.axvline(-readandcompute.converged_state(datname), color=colors[suffix_index], linestyle=':') except (KeyboardInterrupt, SystemExit): raise except: pass ax.set_xlabel(r'$E$') ax.set_ylim(0, maxhist) # ax.set_xlim(-5, -0.3) ax.set_xlim(mine, maxe) ax.set_ylabel(r'histogram') # ax.legend(loc='best').get_frame().set_alpha(0.25)
try: return colors[T] except: return '' lines = ['-', '--', ':',] first_method = True the_first_method = '' first_temperature = [True, True, True] methods = ['-tmi', '-toe', '-tmmc', ] for i in range(len(methods)): method = methods[i] fbase = 'data/lv/ww%.2f-ff%.2f-%gx%g%s' % (ww,ff,lenx,lenyz,method) fname = fbase + '-density.dat' try: minT = readandcompute.minT(fname) convergedT = readandcompute.convergedT(fname) for T in Ts: if T >= minT and T >= convergedT*0.8: density, x = readandcompute.density_x(fbase, T) plt.plot(x/2, density, color(T)+lines[i]) if first_method or method == the_first_method: if first_temperature[i]: plt.plot(x/2, density, color(T)+lines[i], label='T=%g %s (converged to %.2g)' % (T, method[1:], convergedT)) first_temperature[i] = False else: plt.plot(x/2, density, color(T)+lines[i], label='T=%g' % T) the_first_method = method first_method = False