Skip to content

Commit

Permalink
had to rechunk, as setting chunk size in from_delayed isn't allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
akhanf committed Oct 4, 2024
1 parent 3b03fbd commit 6079e6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion workflow/scripts/tif_to_zarr_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def build_zstack_from_single(gcs_uri,zstack_metadata,fs):

tif_file = in_tif_pattern.format(tilex=tilex,tiley=tiley,prefix=metadata['prefixes'][0],channel=channel)

zstacks.append(da.from_delayed(delayed(read_stack_as_numpy)('gcs://'+tif_file,fs,size_z,size_y,size_x),shape=(size_z,size_y,size_x),chunks=(1,size_y,size_x),dtype='uint16'))
zstacks.append(da.from_delayed(delayed(read_stack_as_numpy)('gcs://'+tif_file,fs,size_z,size_y,size_x),shape=(size_z,size_y,size_x),dtype='uint16').rechunk((1,size_y,size_x)))

else:
zstacks.append(build_zstack(fs.glob('gcs://'+in_tif_glob.format(tilex=tilex,tiley=tiley,prefix=metadata['prefixes'][0],channel=channel,zslice='*')),fs=fs))
Expand Down

0 comments on commit 6079e6d

Please sign in to comment.