In [1]:
%load_ext autoreload
%autoreload 2
from IPython.display import clear_output

In [151]:
tStart = 1950
tEnd = 1951
Np = 50
N = 40
M = 20
region = 'sahel'
detectionSites = np.zeros(tEnd-tStart+1)
X = zeros((tEnd-tStart+1,24,44))

for t in range(tEnd-tStart+1):
    filename = 'results/Np'+str(Np)+'_M'+str(N)+'_M'+str(M)+'_t'+str(tStart+t)+region+'.csv'
    c = loadtxt(filename,delimiter=',')
    X[t,:,:] = c
    detectionSites[t] = np.sum(c>0.7)

In [152]:
plot(arange(tStart,tEnd+1,dtype=int),detectionSites)


Out[152]:
[<matplotlib.lines.Line2D at 0x7fee00c7e790>]

In [150]:
year = 1950
imshow(X[year-tStart,:,:]>0.7)
colorbar()
print detectionSites[year-tStart]


0.0

In [32]:
tEnd-year


Out[32]:
7

In [ ]: