In [1]:
import MagicTools

In [2]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [6]:
MagicTools.Deviation(['2magic1.out','2magic2.out','2magic3.out','2magic4.out','2magic6.out'] )


2magic1.out.iter1    S:   5.46988       RDF:   0.33938
2magic1.out.iter2    S:   2.79449       RDF:   0.20567
2magic1.out.iter3    S:   3.72178       RDF:   0.21355
2magic1.out.iter4    S:   5.07828       RDF:   0.27494
2magic1.out.iter5    S:   5.99820       RDF:   0.29111
2magic1.out.iter6    S:   7.31535       RDF:   0.33200
2magic1.out.iter7    S:   7.54058       RDF:   0.33938
2magic1.out.iter8    S:   7.76075       RDF:   0.35010
2magic1.out.iter9    S:   7.59699       RDF:   0.35015
2magic1.out.iter10    S:   7.74754       RDF:   0.34508
2magic2.out.iter1    S:   7.74108       RDF:   0.34236
2magic2.out.iter2    S:   7.70248       RDF:   0.34315
2magic2.out.iter3    S:   7.70787       RDF:   0.34666
2magic2.out.iter4    S:   6.74775       RDF:   0.30699
2magic2.out.iter5    S:   6.96000       RDF:   0.31497
2magic2.out.iter6    S:   7.09313       RDF:   0.32565
2magic2.out.iter7    S:   7.15673       RDF:   0.32481
2magic2.out.iter8    S:   7.36198       RDF:   0.33103
2magic2.out.iter9    S:   7.56269       RDF:   0.34086
2magic2.out.iter10    S:   7.66522       RDF:   0.33830
2magic3.out.iter1    S:   7.63191       RDF:   0.33815
2magic3.out.iter2    S:   7.80063       RDF:   0.34682
2magic3.out.iter3    S:   7.92932       RDF:   0.34473
2magic3.out.iter4    S:   7.48382       RDF:   0.32968
2magic3.out.iter5    S:   7.70759       RDF:   0.33261
2magic3.out.iter6    S:   3.03636       RDF:   0.11191
2magic3.out.iter7    S:   1.90418       RDF:   0.06878
2magic3.out.iter8    S:   1.95837       RDF:   0.08073
2magic3.out.iter9    S:   1.84221       RDF:   0.07608
2magic3.out.iter10    S:   1.73158       RDF:   0.07184
2magic4.out.iter1    S:   4.77899       RDF:   0.20483
2magic4.out.iter2    S:   3.30222       RDF:   0.13649
2magic4.out.iter3    S:   1.56838       RDF:   0.05788
2magic4.out.iter4    S:   1.75336       RDF:   0.06180
2magic4.out.iter5    S:   1.66433       RDF:   0.05992
2magic4.out.iter6    S:   1.46836       RDF:   0.06786
2magic4.out.iter7    S:   1.26479       RDF:   0.05529
2magic4.out.iter8    S:   1.36285       RDF:   0.06318
2magic4.out.iter9    S:   1.28048       RDF:   0.05110
2magic4.out.iter10    S:   0.65258       RDF:   0.03524
2magic6.out.iter1    S:   0.44314       RDF:   0.02498
2magic6.out.iter2    S:   0.34766       RDF:   0.02138
2magic6.out.iter3    S:   0.50291       RDF:   0.01637
2magic6.out.iter4    S:   0.68395       RDF:   0.04106
2magic6.out.iter5    S:   0.79981       RDF:   0.04985
2magic6.out.iter6    S:   1.03560       RDF:   0.06940
2magic6.out.iter7    S:   1.09897       RDF:   0.06885
2magic6.out.iter8    S:   1.20078       RDF:   0.07185
2magic6.out.iter9    S:   1.30119       RDF:   0.07777
2magic6.out.iter10    S:   1.10010       RDF:   0.07351
2magic6.out.iter11    S:   1.05480       RDF:   0.06850
2magic6.out.iter12    S:   1.20796       RDF:   0.07674
2magic6.out.iter13    S:   1.14317       RDF:   0.07445
2magic6.out.iter14    S:   1.08287       RDF:   0.07342
2magic6.out.iter15    S:   1.17694       RDF:   0.07710

In [190]:
new = MagicTools.GetPotsFromFile_pot('new.pot', mcmfile='dmddHigh.mcm')
a1 = MagicTools.GetPotsFromFile_pot('imc6dmddHigh.i001.pot', mcmfile='dmddHigh.mcm')
a2 = MagicTools.GetPotsFromFile_pot('imc6dmddHigh.i002.pot', mcmfile='dmddHigh.mcm')
a3 = MagicTools.GetPotsFromFile_pot('imc6dmddHigh.i003.pot', mcmfile='dmddHigh.mcm')
a4 = MagicTools.GetPotsFromFile_pot('imc2dmddHigh.i004.pot', mcmfile='dmddHigh.mcm')
a5 = MagicTools.GetPotsFromFile_pot('imc3dmddHigh.i005.pot', mcmfile='dmddHigh.mcm')
a6 = MagicTools.GetPotsFromFile_pot('imc3dmddHigh.i006.pot', mcmfile='dmddHigh.mcm')
a7 = MagicTools.GetPotsFromFile_pot('imc2dmddHigh.i007.pot', mcmfile='dmddHigh.mcm')
a8 = MagicTools.GetPotsFromFile_pot('imc4dmddHigh.i008.pot', mcmfile='dmddHigh.mcm')
a9 = MagicTools.GetPotsFromFile_pot('imc4dmddHigh.i009.pot', mcmfile='dmddHigh.mcm')
a10 = MagicTools.GetPotsFromFile_pot('imc4dmddHigh.i010.pot', mcmfile='dmddHigh.mcm')
MagicTools.PlotAllDFs([new,a10,a1,a2,a3])



In [192]:
MagicTools.AnalyzeIMCOuput('2magic6.out', iters = (1,2,3
                                                   ))


Automatically defining list of interactions from input file. If this does not work well for your input, edit subroutine GetDFsFromFile_magic in MagicTools.py and manualy add list of your beads to PairNamesList
3  intermolecular pairs detected  ['N-N', 'N-C', 'C-C']
2  pairwise bonds detected  ['N1-C1', 'C1-C2']
1  angles detected  ['N1-C2-C1']
Total number of checks per iteration: 29
Iteration 1
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 2
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 3
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Automatically defining list of interactions from input file. If this does not work well for your input, edit subroutine GetDFsFromFile_magic in MagicTools.py and manualy add list of your beads to PairNamesList
3  intermolecular pairs detected  ['N-N', 'N-C', 'C-C']
2  pairwise bonds detected  ['N1-C1', 'C1-C2']
1  angles detected  ['N1-C2-C1']
Total number of checks per iteration: 29
Iteration 1
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 2

In [3]:
rdf = []
rdf.append(MagicTools.GetDFsFromFile_magic('2magic1.out'));
rdf.append(MagicTools.GetDFsFromFile_magic('2magic2.out'));
rdf.append(MagicTools.GetDFsFromFile_magic('2magic3.out'));
rdf.append(MagicTools.GetDFsFromFile_magic('2magic4.out'));
rdf.append(MagicTools.GetDFsFromFile_magic('2magic6.out'));


Automatically defining list of interactions from input file. If this does not work well for your input, edit subroutine GetDFsFromFile_magic in MagicTools.py and manualy add list of your beads to PairNamesList
3  intermolecular pairs detected  ['N-N', 'N-C', 'C-C']
2  pairwise bonds detected  ['N1-C1', 'C1-C2']
1  angles detected  ['N1-C2-C1']
Total number of iterations: 10
Total number of checks per iteration: 6
Iteration 1
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 2
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 3
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 4
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 5
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 6
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 7
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 8
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 9
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 10
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Automatically defining list of interactions from input file. If this does not work well for your input, edit subroutine GetDFsFromFile_magic in MagicTools.py and manualy add list of your beads to PairNamesList
3  intermolecular pairs detected  ['N-N', 'N-C', 'C-C']
2  pairwise bonds detected  ['N1-C1', 'C1-C2']
1  angles detected  ['N1-C2-C1']
Total number of iterations: 10
Total number of checks per iteration: 6
Iteration 1
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 2
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 3
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 4
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 5
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 6
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 7
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 8
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 9
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 10
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Automatically defining list of interactions from input file. If this does not work well for your input, edit subroutine GetDFsFromFile_magic in MagicTools.py and manualy add list of your beads to PairNamesList
3  intermolecular pairs detected  ['N-N', 'N-C', 'C-C']
2  pairwise bonds detected  ['N1-C1', 'C1-C2']
1  angles detected  ['N1-C2-C1']
Total number of iterations: 10
Total number of checks per iteration: 6
Iteration 1
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 2
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 3
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 4
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 5
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 6
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 7
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 8
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 9
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 10
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Automatically defining list of interactions from input file. If this does not work well for your input, edit subroutine GetDFsFromFile_magic in MagicTools.py and manualy add list of your beads to PairNamesList
3  intermolecular pairs detected  ['N-N', 'N-C', 'C-C']
2  pairwise bonds detected  ['N1-C1', 'C1-C2']
1  angles detected  ['N1-C2-C1']
Total number of iterations: 10
Total number of checks per iteration: 6
Iteration 1
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 2
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 3
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 4
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 5
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 6
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 7
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 8
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 9
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 10
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Automatically defining list of interactions from input file. If this does not work well for your input, edit subroutine GetDFsFromFile_magic in MagicTools.py and manualy add list of your beads to PairNamesList
3  intermolecular pairs detected  ['N-N', 'N-C', 'C-C']
2  pairwise bonds detected  ['N1-C1', 'C1-C2']
1  angles detected  ['N1-C2-C1']
Total number of iterations: 15
Total number of checks per iteration: 6
Iteration 1
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 2
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 3
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 4
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 5
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 6
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 7
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 8
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 9
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 10
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 11
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 12
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 13
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 14
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1
Iteration 15
Pair N-N
Pair N-C
Pair C-C
Pair N1-C1
Pair C1-C2
Pair N1-C2-C1

In [4]:
r2 = np.array(rdf)
rx =[]
its = [10,10,5,10,3]
for i in xrange(len(its)):
    for j in xrange(its[i]):
        rx.append(r2[i][j][0])

In [5]:
p1 = []
its = [10,10,5,10,3]
for i in xrange(len(its)):
    for j in xrange(its[i]):
        p1.append(MagicTools.GetPotsFromFile_pot('imc{}dmddHigh.i{:03d}.pot'.format(i+1,j+1),mcmfile='dmddHigh.mcm'))

In [6]:
f = open('invpotsHigh.dat', 'w');
f.write('{0:3d}\n'.format(len(p1)))
j=0
for i in xrange(len(p1)):
    f.write('{0:3d}\n'.format(len(p1[i][j].g[:,0])))
    for w in xrange(len(p1[i][j].g[:,0])):
        f.write('{0:8.8f} {1:8.8f}\n'.format(p1[i][j].g[w,0],p1[i][j].g[w,1]))
f.close(); 

f = open('invrdfsHigh.dat', 'w');
f.write('{0:3d}\n'.format(len(rx)))
for i in xrange(len(rx)):
    f.write('{0:3d}\n'.format(len(rx[i].g[:,0])))
    for w in xrange(len(rx[i].g[:,0])):
        f.write('{0:8.8f} {1:8.8f}\n'.format(rx[i].g[w,0],rx[i].g[w,1]))
f.close();

In [ ]: