os.chdir(tempdir) #put lists for each structure in here, writing over them as we go os.system('rm *') for structi in structselect: dirs = [] dirsfull = [] for dir in dirs1: if structi+'_' in dir: dirs.append(dir) dirsfull.append(maindir+dir) print dirs if structi == structselect[0]: [mmax, ibest] = getibest(dirs) print 'energy of structure 1, multiplier %i, index %i used as ebest' % (mmax, ibest) #ibest = 17 ###################TEMP ONLY !!!!!!!!!!!!!!!!!!!!! writeEnergiesOszicar(dirsfull) writefermi(dirsfull) #skip so don't have to read it every time writedirnames(dirsfull) writeNkIBZ(dirsfull) #writeNk(dirsfull) writeElConverge(dirsfull) writeElSteps(dirsfull) writeCPUtime(dirsfull) parts = enerparts(dirsfull) dets = getdata(dirsfull,'detL') #supercell volume in terms of unit cell volume dets = [float(dets[i]) for i in range(len(dets))] NkfullBZ = getdata(dirsfull,'detM') #Nk without symmetry reduction lattypes = getdata(dirsfull,'lattype') ms = array(getms(dirsfull),dtype = int) filesstructselect = sorted([f for f in os.listdir(os.getcwd())])
#maindir = '/fslhome/bch/cluster_expansion/alir/AFLOWDATAf1_50e/f3varyN/0.6802/' title_detail = '' #maindir = '/fslhome/bch/cluster_expansion/alir/AFLOWDATAf1_50e/AlIr/' #maindir = '/fslhome/bch/cluster_expansion/alir/AFLOWDATAf1_50e/AlIr34-50/' testfile = 'POSCAR' #reallatt = zeros((3,3)) os.chdir(maindir) dirs = sorted([d for d in os.listdir(os.getcwd()) if os.path.isdir(d)]) #file1 = open('varypf.csv','a') #file1.write('Structure,Lattice,amax/amin,pfB,pf_orth,pf_orth2fcc,pf_maxpf, pf_pf2fcc, pfmax, meshtype' + ',' \ # + 'Improvement,fcc compatibility,Nmesh,TargetNmesh,Nmesh/Target,cbest' + '\n') #for i,directory in enumerate(dirs): print dirs writeEnergiesOszicar(dirs) writedirnames(dirs) writeNkIBZ(dirs) writeNk(dirs) writeElConverge(dirs) writeElSteps(dirs) writeCPUtime(dirs) parts = enerparts(dirs) #print'parts'; print parts #find deviation from average for each part means = mean(parts, axis=0) #print'means';print means deviations = abs(parts - means) + 1e-16 #last term to handle zero entries #print'deviations';print deviations try:
'/fslhome/bch/cluster_expansion/structure_noise/ptpt/equivk_accurate/'] nplots = len(paths) titles = [] errsList = [[]]*nplots nsList = [[]]*nplots for iplot,path in enumerate(paths): titles.append(path.split('/')[-3][0].upper()+path.split('/')[-3][1].lower()) for maindir in [path + 'structs.cubmesh/']: os.chdir(maindir) dirs = sorted([d for d in os.listdir(os.getcwd()) if os.path.isdir(d)]) print dirs if 'structselect' in dirs: dirs.remove('structselect') [mmax, ibest] = getibest(dirs) print 'energy of structure 1, multiplier %i, index %i used as ebest' % (mmax, ibest) writeEnergiesOszicar(dirs) # writefermi(dirs) #skip if don't want to read it every time writedirnames(dirs) writeNkIBZ(dirs) #writeNk(dirs) writeElConverge(dirs) writeElSteps(dirs) writeCPUtime(dirs) parts = enerparts(dirs) dets = getdata(dirs,'detL') #supercell volume in terms of unit cell volume dets = [float(dets[i]) for i in range(len(dets))] NkfullBZ = getdata(dirs,'detM') #Nk without symmetry reduction lattypes = getdata(dirs,'lattype') ms = array(getms(dirs),dtype = int) ################# summary ################# outfile = open('vary_n.csv','w')