added error on missing camera name; print raw shape
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user