@@ -36,6 +36,7 @@ def multiscale(
3636 chunks : ChunkOption | Sequence [int ] | dict [Hashable , int ] = "preserve" ,
3737 chained : bool = True ,
3838 namer : Callable [[int ], str ] = _default_namer ,
39+ ** kwargs : Any ,
3940) -> list [xarray .DataArray ]:
4041 """
4142 Generate a coordinate-aware multiscale representation of an array.
@@ -90,6 +91,9 @@ def multiscale(
9091 index and return a string. The default function simply prepends the string
9192 representation of the integer with the character "s".
9293
94+ **kwargs: Any
95+ Additional keyword arguments that will be passed to the reduction function.
96+
9397 Returns
9498 -------
9599 result : list[xarray.DataArray]
@@ -127,7 +131,7 @@ def multiscale(
127131 else :
128132 scale = tuple (s ** level for s in scale_factors )
129133 source = result [0 ]
130- downscaled = downscale (source , reduction , scale , preserve_dtype )
134+ downscaled = downscale (source , reduction , scale , preserve_dtype , ** kwargs )
131135 downscaled .name = namer (level )
132136 result .append (downscaled )
133137
@@ -201,7 +205,7 @@ def downscale(
201205 if to_downscale .chunks is not None :
202206 downscaled_data = downscale_dask (to_downscale .data , reduction , scale_factors , ** kwargs )
203207 else :
204- downscaled_data = reduction (to_downscale .data , scale_factors )
208+ downscaled_data = reduction (to_downscale .data , scale_factors , ** kwargs )
205209 if preserve_dtype :
206210 downscaled_data = downscaled_data .astype (array .dtype )
207211 downscaled_coords = downscale_coords (to_downscale , scale_factors )
0 commit comments