from SART_OP import sart
import matplotlib.pyplot as plt
import numpy as np

"""
Small code to generate the 4x4 plots of the flame reconstructions shown in the results section of the report.
"""
a = np.random.rand(10,10)
g1 = sart(-90, 60, 6, 'z', 0.55, 'FL','_256.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/256px_flames', 0.125,5)
g2 = sart(-90, 54, 12, 'z', 0.55, 'FL','_256.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/256px_flames', 0.125,5)
g3 = sart(-90, 54, 18, 'z', 0.55, 'FL','_256.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/256px_flames', 0.125,5)
g4 = sart(-90, 60, 30, 'z', 0.55, 'FL','_256.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/256px_flames', 0.125,5)
g5 = sart(-90, 60, 6, 'z', 0.55, 'FL','_512.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/512px_flames', 0.25,5)
g6 = sart(-90, 54, 12, 'z', 0.55, 'FL','_512.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/512px_flames', 0.25,5)
g7 = sart(-90, 54, 18, 'z', 0.55, 'FL','_512.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/512px_flames', 0.25,5)
g8 = sart(-90, 60, 30, 'z', 0.55, 'FL','_512.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/512px_flames', 0.25,5)
g9 = sart(-90, 60, 6, 'z', 0.55, 'FL','_1024.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/1024px_flames', 0.5,5)
g10 = sart(-90, 54, 12, 'z', 0.55, 'FL','_1024.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/1024px_flames', 0.5,5)
g11 = sart(-90, 54, 18, 'z', 0.55, 'FL','_1024.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/1024px_flames', 0.5,5)
g12 = sart(-90, 60, 30, 'z', 0.55, 'FL','_1024.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/1024px_flames', 0.5,5)
g13 = sart(-90, 60, 6, 'z', 0.55, 'FL','_2048.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/2048px_flames', 1,5)
g14 = sart(-90, 54, 12, 'z', 0.55, 'FL','_2048.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/2048px_flames', 1,5)
g15 = sart(-90, 54, 18, 'z', 0.55, 'FL','_2048.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/2048px_flames', 1,5)
g16 = sart(-90, 60, 30, 'z', 0.55, 'FL','_2048.csv', 'C:/Users/alexm/PycharmProjects/HonoursPy/2048px_flames', 1,5)

fig , axs = plt.subplots(4, 4)
axs[0,0].imshow(g13, cmap='viridis', vmin=0, vmax=0.95)
axs[0,0].set_title(' 2048x2048 pixels')
axs[0,0].set_ylabel('24 views')
axs[1,0].imshow(g14, cmap='viridis', vmin=0, vmax=0.95)
axs[1,0].set_ylabel('13 views')
axs[2,0].imshow(g15, cmap='viridis', vmin=0, vmax=0.95)
axs[2,0].set_ylabel('9 views')
axs[3,0].imshow(g16, cmap='viridis', vmin=0, vmax=0.95)
axs[3,0].set_ylabel('6 views')
axs[0,1].imshow(g9, cmap='viridis', vmin=0, vmax=0.95)
axs[0,1].set_title(' 1024x1024 pixels')
axs[1,1].imshow(g10, cmap='viridis', vmin=0, vmax=0.95)
axs[2,1].imshow(g11, cmap='viridis', vmin=0, vmax=0.95)
axs[3,1].imshow(g12, cmap='viridis', vmin=0, vmax=0.95)
axs[0,2].imshow(g5, cmap='viridis', vmin=0, vmax=0.95)
axs[0,2].set_title(' 512x512 pixels')
axs[1,2].imshow(g6, cmap='viridis', vmin=0, vmax=0.95)
axs[2,2].imshow(g7, cmap='viridis', vmin=0, vmax=0.95)
axs[3,2].imshow(g8, cmap='viridis', vmin=0, vmax=0.95)
axs[0,3].imshow(g1, cmap='viridis', vmin=0, vmax=0.95)
axs[0,3].set_title(' 256x256 pixels')
axs[1,3].imshow(g2, cmap='viridis', vmin=0, vmax=0.95)
axs[2,3].imshow(g3, cmap='viridis', vmin=0, vmax=0.95)
im = axs[3,3].imshow(g4, cmap='viridis', vmin=0, vmax=0.95)

#plt.colorbar()
fig.subplots_adjust(right=0.8)
cbar_ax = fig.add_axes([0.85, 0.15, 0.05, 0.7])
fig.colorbar(im, cax=cbar_ax, label = "Photons per cubic pixel")
plt.savefig('array08.png')
plt.show()
