From 7840074004536b44396083fcab75a9e6355e4a42 Mon Sep 17 00:00:00 2001 From: jaseg Date: Mon, 18 Dec 2023 14:22:45 +0100 Subject: Initial commit --- example.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 example.py (limited to 'example.py') 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') -- cgit