concentracao.py 594 Bytes
Newer Older
Matheus Müller's avatar
Matheus Müller committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from pylab import *

def montaperfil( arquivo, step, modo, xmax):

    x,y = loadtxt(arquivo, unpack=True)
    profundidade = arange(0, xmax, step)
    concent = profundidade*0
    u = 0

    if modo == 'step':
        global u
        for i in x:
            for j in arange (u, i, step) 
                concent[int(j/step)] = y[i]
            u = i

    if modo == 'reta':
        global u
        for i in x:
            for j in arange (u, i, step) 
                concent[int(j/step)] = (j-u)*(y[i]-y[u])/(x[i]-x[u])
            u = i        

    plot(profundidade, concent)
    show()