16 lines
737 B
Python
16 lines
737 B
Python
"""Contact sheet of whole camera images (downscaled): sheet.py OUT.png TIME1 TIME2 ... (YYYYMMDDTHHMM)."""
|
|
import sys, os, glob
|
|
import matplotlib; matplotlib.use('Agg')
|
|
import matplotlib.pyplot as plt
|
|
import matplotlib.image as mpimg
|
|
out, times = sys.argv[1], sys.argv[2:]
|
|
n = len(times); cols = 3; rows = (n + cols - 1) // cols
|
|
fig, axs = plt.subplots(rows, cols, figsize=(cols * 6, rows * 4))
|
|
for ax in axs.flat: ax.axis('off')
|
|
for ax, t in zip(axs.flat, times):
|
|
f = sorted(glob.glob(f'data/NORDEND/images/{t}Z_*.jpg'))
|
|
if not f: ax.set_title(t + ' none'); continue
|
|
im = mpimg.imread(f[0])[::4, ::4]
|
|
ax.imshow(im, cmap='gray', vmin=0, vmax=255); ax.set_title(t)
|
|
plt.tight_layout(); plt.savefig(out, dpi=60); print(out)
|