@@ -353,14 +353,14 @@ function buildpyramids(path::AbstractString; resampling_method=mean, recursive=t
353353 # t = Missing <: eltype(org) ? Union{Missing, tfunc} : tfunc
354354
355355 t = Base. infer_return_type (resampling_method, (Matrix{nonmissingtype (eltype (org))},))
356-
357356 n_level = compute_nlevels (org)
358357 input_axes = DD. dims (org, spatial_dims)
358+ outarrs = [output_zarr (n, DD. dims (org), t, joinpath (path, string (n)),input_axes) for n in 1 : n_level]
359+
359360 if length (input_axes) != 2
360361 throw (ArgumentError (" Expected two spatial dimensions got $input_axes " ))
361362 end
362363 verbose && println (" Constructing output arrays" )
363- outarrs = [output_zarr (n, DD. dims (org), t, joinpath (path, string (n)),input_axes) for n in 1 : n_level]
364364 verbose && println (" Start computation" )
365365 ispatial_dims = DD. dimnum (DD. dims (org),spatial_dims)
366366 fill_pyramids (org, outarrs, resampling_method, recursive, ispatial_dims;runner)
385385
386386"""
387387 output_zarr(n, input_axes, t, path)
388+
388389Construct a Zarr dataset for the level n of a pyramid for the dimensions `input_axes`.
389390It sets the type to `t` and saves it to `path/n`
390391"""
413414Compute the data of the pyramids of a given data cube `ras`.
414415This returns the data of the pyramids and the dimension values of the aggregated axes.
415416"""
416- function getpyramids (reducefunc, ras;recursive= true , tilesize= 256 )
417+ function getpyramids (reducefunc, ras;recursive= true , tilesize= 256 , spatial_dims = SpatialDim )
417418 input_axes = DD. dims (ras)
418419 n_level = compute_nlevels (ras, tilesize)
419420 if iszero (n_level)
@@ -425,7 +426,9 @@ function getpyramids(reducefunc, ras;recursive=true, tilesize=256)
425426 outtype = Base. infer_return_type (reducefunc, (Matrix{eltype (ras)},))
426427 # outtype = Missing <: eltype(ras) ? Union{Missing, outtypefunc} : outtypefunc
427428 outmin = output_arrays (pyramid_sizes, outtype)
428- fill_pyramids (ras,outmin,reducefunc,recursive; threaded= true )
429+ ispatial_dims = DD. dimnum (DD. dims (ras),spatial_dims)
430+
431+ fill_pyramids (ras,outmin,reducefunc,recursive, ispatial_dims; threaded= true )
429432
430433 outmin, pyramid_axes
431434end
0 commit comments