@@ -44,8 +44,8 @@ struct Pyramid{T,N,D,A,B<:DD.AbstractDimArray{T,N,D,A},L, Me} <: DD.AbstractDimA
4444 metadata:: Me
4545end
4646
47- function Pyramid (data:: DD.AbstractDimArray )
48- pyrdata, pyraxs = getpyramids (mean ∘ skipmissing , data, recursive = false )
47+ function Pyramid (data:: DD.AbstractDimArray ; resampling_method = mean ∘ skipmissing, kwargs ... )
48+ pyrdata, pyraxs = getpyramids (resampling_method , data; kwargs ... )
4949 levels = DD. DimArray .(pyrdata, pyraxs)
5050 meta = Dict (deepcopy (DD. metadata (data)))
5151 push! (meta, " resampling_method" => " mean_skipmissing" )
@@ -72,10 +72,10 @@ function _pyramid_gdal end
7272function _pyramid_zarr (path)
7373 g = zopen (path)
7474 allkeys = collect (keys (g. groups))
75- base = Cube (path)[Ti = 1 ] # This getindex should be unnecessary and I should rather fix my data on disk
75+ base = Cube (path) # This getindex should be unnecessary and I should rather fix my data on disk
7676 levavail = extrema (parse .(Int,allkeys[contains .(allkeys, r" \d " )]))
7777 clevels = [Cube (open_dataset (g[string (l)])) for l in 1 : last (levavail)]
78- Pyramid (base, clevels, Dict ( ))
78+ Pyramid (base[Ti = 1 ] , clevels, DD . metadata (base ))
7979end
8080# refdims
8181# name
124124function Base. map (f, A:: Pyramid )
125125 newbase = map (f, parent (A))
126126 newlevels = [map (f, levels (A,i)) for i in 1 : nlevels (A)]
127- @show typeof (newlevels)
128127 Pyramid (newbase, newlevels, DD. metadata (A)) # This should handle metadata better.
129128end
130129
@@ -315,7 +314,7 @@ The different scales are written according to the GeoZarr spec and a multiscales
315314The data is aggregated with the specified `resampling_method`.
316315Keyword arguments are forwarded to the `fill_pyramids` function.
317316"""
318- function buildpyramids (path; resampling_method= mean, recursive= true , runner= LocalRunner, verbose= false )
317+ function buildpyramids (path:: AbstractString ; resampling_method= mean, recursive= true , runner= LocalRunner, verbose= false )
319318 if YAB. backendfrompath (path) != YAB. ZarrDataset
320319 throw (ArgumentError (" $path is not a Zarr dataset therefore we can't build the Pyramids inplace" ))
321320 end
@@ -441,7 +440,7 @@ ykey(keyext) = DD.dim2key(DD.dims(keyext, YDim))
441440Internal function
442441
443442### Extended help
444- Return an Extent with the limits from `dataext` on the keys of `keyext`.
443+ Return an Extent with the limits from `dataext` and the keys of `keyext`.
445444 We assume that dataext has keys X, and Y and the keys of keyext are XDim and YDim from DimensionalData
446445"""
447446function switchkeys (dataext, keyext)
@@ -484,7 +483,7 @@ function plot!(ax, pyramid::Pyramid;interp=false, kwargs...)#; rastercrs=crs(par
484483 notify (data)
485484 end
486485 # @show typeof(data)
487- hmap = image ! (ax, data; interpolate= interp, kwargs... )
486+ hmap = heatmap ! (ax, data; interpolate= interp, kwargs... )
488487end
489488
490489"""
0 commit comments