In [11]:
from __future__ import division 
%pylab inline
import string
import os
txt = 'run'
txt2 = '/rho_'
densPath = '/home/cifucito/nrgcode/TwoChNRG/Images/Density/run'


Populating the interactive namespace from numpy and matplotlib
WARNING: pylab import has clobbered these variables: ['text', 'save']
`%matplotlib` prevents importing * from pylab and numpy

In [42]:
for j in range(39,40):
    for i in range(4):
        output = txt+repr(j)+txt2 +repr(i)+'_'+repr(i)+'_OmegaRhow.dat'
        #output = '/home/cifucito/nrgcode/TwoChNRG/src/Main/Run/Run2DOtM/rho_2_2_OmegaRhow.dat'
        print output
        infile = open(os.path.abspath(output), 'r')
        text = infile.readlines()
        vec = []
        vec2 = []
        for x in text:
            #print(list(x))
            a =x.split(' ')
            vec.append(float(a[-3]))
            vec2.append(float(a[0]))
        vec = array(vec)    
        maxima = vec[r_[True, vec[1:] > vec[:-1]] & r_[vec[:-1] > vec[1:], True]]
        maxima = sort(maxima)
        plot(vec2,vec)    
        xlabel('$\omega$',fontsize=19)
        ylabel('Spectral Density ',fontsize=18)
        title(" , ".join(str(x) for x in maxima[-3:]),fontsize=10)
        directory = densPath + repr(j)
        !mkdir {directory}
        save = directory +'/'+txt2 +repr(i)+'_'+repr(i)+'_OmegaRhow.png'
       
        
        savefig(save)
        close()


run39/rho_0_0_OmegaRhow.dat
mkdir: cannot create directory ‘/home/cifucito/nrgcode/TwoChNRG/Images/Density/run39’: File exists
run39/rho_1_1_OmegaRhow.dat
mkdir: cannot create directory ‘/home/cifucito/nrgcode/TwoChNRG/Images/Density/run39’: File exists
run39/rho_2_2_OmegaRhow.dat
mkdir: cannot create directory ‘/home/cifucito/nrgcode/TwoChNRG/Images/Density/run39’: File exists
run39/rho_3_3_OmegaRhow.dat
mkdir: cannot create directory ‘/home/cifucito/nrgcode/TwoChNRG/Images/Density/run39’: File exists

In [7]:
!mkdir {txt}

In [18]:
vec


Out[18]:
[9.229172586340199e-05,
 0.01334291418994035,
 0.08144538561886815,
 0.388576033614062,
 0.821149502384257,
 0.8150037059028259,
 0.5218576173385497,
 0.4147239698854034,
 0.41851444007989,
 0.4616937288751194,
 0.5370473330582222,
 0.7055981282152675,
 1.017338903381566,
 1.74339787259361,
 3.025296763768499,
 4.9042246443719,
 6.908973978657301,
 8.492323322397109,
 9.535170550186134,
 10.04277660028582,
 10.31002569774943,
 10.41245346350279,
 10.46346329860892,
 10.48153263428563,
 10.49065497711147,
 10.49395857724373,
 10.49565655592403,
 10.49629535289515,
 10.49660641000306,
 10.49669993232259,
 10.49671237662379,
 10.49667216363337,
 10.49660559755489,
 10.49652309843098,
 10.4964314318067,
 10.49633467305979,
 10.49623424720465,
 10.49613216690177,
 10.49602849058492,
 10.49592437852743,
 10.49581995235736,
 10.49571531917748,
 10.49561387489719,
 10.49551080086571,
 10.49543104303432,
 10.49533961432694,
 10.49539680694623,
 10.49537848430253,
 10.4962999680036,
 10.49670407977264,
 10.5039605731714,
 10.50863451186981,
 10.50863451187002,
 10.50396057317069,
 10.49670407977176,
 10.49629996800233,
 10.49537848430096,
 10.49539680694472,
 10.49533961432577,
 10.49543104303333,
 10.49551080086481,
 10.49561387489608,
 10.4957153191762,
 10.49581995235596,
 10.49592437852633,
 10.49602849058447,
 10.49613216690196,
 10.49623424720502,
 10.49633467306013,
 10.49643143180683,
 10.49652309843104,
 10.49660559755535,
 10.49667216363397,
 10.49671237662386,
 10.49669993232211,
 10.49660641000256,
 10.49629535289499,
 10.49565655592448,
 10.49395857724494,
 10.4906549771133,
 10.481532634288,
 10.46346329861178,
 10.41245346350623,
 10.31002569775364,
 10.04277660029106,
 9.535170550193136,
 8.492323322405124,
 6.908973978665386,
 4.904224644377742,
 3.025296763771781,
 1.743397872594815,
 1.017338903381959,
 0.7055981282154757,
 0.5370473330584512,
 0.4616937288753783,
 0.4185144400801768,
 0.4147239698857372,
 0.5218576173390485,
 0.8150037059036801,
 0.8211495023851338,
 0.3885760336144651,
 0.0814453856189443,
 0.01334291418994998,
 9.229172586345397e-05]

In [41]:


In [41]:


In [ ]: