Skip to content

Commit

Permalink
additional results
Browse files Browse the repository at this point in the history
  • Loading branch information
Paytonco committed Jan 30, 2022
1 parent 63493fa commit 1111f8c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
Binary file added figures/cityGrid.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/fireSpread.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 26 additions & 16 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import math
import numpy as np
import matplotlib.pyplot as plt
import model

initialState = np.zeros((100,100))
initialState[50,50] = 0.1
initialState = np.zeros((10,10))
initialState[5,5] = 0.1

tempHigh = np.array([94,87,86,97,98,89,92,96,98,99,103,103,97,91])
tempLow = np.array([60,56,55,59,61,61,57,58,59,64,65,64,62,57])
Expand All @@ -13,20 +14,29 @@

testModel = model.firemodel(initialState, tempHigh, tempLow, precip, wind, humid)

plt.figure(1)
states = np.zeros((10,10,9))
states[:,:,0] = testModel.visualize()
testModel.timeStep()
plt.imshow(testModel.visualize(), cmap=plt.get_cmap('inferno'))
plt.show
for i in range(50):
for i in range(8):
testModel.timeStep()

plt.figure(2)
plt.imshow(testModel.visualize(), cmap=plt.get_cmap('inferno'))
plt.show
states[:,:,i+1] = testModel.visualize()
'''if testModel.t % 50 == 0:
states[:,:,math.floor(testModel.t/50)] = testModel.visualize()'''

fig, ax = plt.subplots(3,3)

'''
for i in range(50):
testModel.timeStep()
plt.imshow(testModel.visualize(),cmap=plt.get_cmap('inferno'))
'''
ax[0][0].imshow(states[:,:,0],cmap=plt.get_cmap('inferno'))
ax[0][1].imshow(states[:,:,1],cmap=plt.get_cmap('inferno'))
ax[0][2].imshow(states[:,:,2],cmap=plt.get_cmap('inferno'))
im = ax[1][0].imshow(states[:,:,3],cmap=plt.get_cmap('inferno'))
ax[1][1].imshow(states[:,:,4],cmap=plt.get_cmap('inferno'))
ax[1][2].imshow(states[:,:,5],cmap=plt.get_cmap('inferno'))
ax[2][0].imshow(states[:,:,6],cmap=plt.get_cmap('inferno'))
ax[2][1].imshow(states[:,:,7],cmap=plt.get_cmap('inferno'))
ax[2][2].imshow(states[:,:,8],cmap=plt.get_cmap('inferno'))

fig.colorbar(im)
plt.show()

#plt.imshow(testModel.visualize(), cmap=plt.get_cmap('inferno'))
#plt.show

0 comments on commit 1111f8c

Please sign in to comment.