summaryrefslogtreecommitdiff
path: root/example.py
diff options
context:
space:
mode:
Diffstat (limited to 'example.py')
-rw-r--r--example.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/example.py b/example.py
new file mode 100644
index 0000000..0cb97cc
--- /dev/null
+++ b/example.py
@@ -0,0 +1,27 @@
+from matplotlib import pyplot as plt
+from pathlib import Path
+
+import infiray_irg
+
+coarse, fine, vis = infiray_irg.load(Path('example.irg').read_bytes())
+
+fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(15, 18))
+
+ax1.imshow(coarse)
+ax1.set_title('Coarse contrast-maximized')
+
+fine_plt = ax2.imshow(fine)
+ax2.set_title('Fine absolute temperatures')
+fig.colorbar(fine_plt, ax=ax2, location='right', label='degrees Celsius')
+
+ax3.imshow(vis)
+ax3.set_title('Visual')
+
+ax4.hist(fine.flatten(), bins=100)
+ax4.set_title('Temperature histogram')
+ax4.set_xlabel('degrees Celsius')
+
+fig.tight_layout()
+fig.savefig('plot.png')
+
+print('Coldest pixel:', fine.min(), 'C', 'Hottest pixel:', fine.max(), 'C')