diff --git a/procprof/make_example_images.py b/procprof/make_example_images.py index 72904b1..8015c06 100755 --- a/procprof/make_example_images.py +++ b/procprof/make_example_images.py @@ -36,13 +36,19 @@ def mk_rand(n): def mk_real(fn, ch, n): ch = harmonize_channel(ch) with SFDataFiles(fn) as f: - imgs = f[ch][:n] + if ch is None: + names = list(f.names) + raise SystemExit(f"No camera or channel name specificed. Choose from: {names}") + c = f[ch] + print("Shape of raw images:", c.shape) + imgs = c[:n] nreal = len(imgs) if nreal != n: print(f"Warning: Got only {nreal} images from channel {ch} in {fn}") return imgs def harmonize_channel(ch): + if ch is None: return if not ch.endswith(FPIC): ch += FPIC return ch