summaryrefslogtreecommitdiff
path: root/example.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-12-18 14:22:45 +0100
committerjaseg <git@jaseg.de>2023-12-18 14:22:45 +0100
commit7840074004536b44396083fcab75a9e6355e4a42 (patch)
tree3bdfd3e907e5548de679722e73a1288b8f070acd /example.py
downloadinfiray_irg_py-1.0.tar.gz
infiray_irg_py-1.0.tar.bz2
infiray_irg_py-1.0.zip
Initial commitv1.0
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')