diff --git a/xdem/coreg/biascorr.py b/xdem/coreg/biascorr.py index 5af87a92..01f31d19 100644 --- a/xdem/coreg/biascorr.py +++ b/xdem/coreg/biascorr.py @@ -248,15 +248,12 @@ def _fit_biascorr( # type: ignore if isinstance(diff, np.ndarray): ydata = diff[subsample_mask].flatten() xdata = np.array([var[subsample_mask].flatten() for var in bias_vars.values()]).squeeze() - # TODO - there is a bug here still - # sigma = (weights[subsample_mask].flatten() if weights is not None else None,) - sigma = None + sigma = weights[subsample_mask].flatten() if weights is not None else None elif isinstance(diff, da.Array): ydata = diff.vindex[subsample_mask].flatten().compute() # type:ignore [assignment] xdata = np.array([var.vindex[subsample_mask].flatten().compute() for var in bias_vars.values()]) - # TODO - there is a bug here still - # sigma = (weights[subsample_mask].flatten() if weights is not None else None,) - sigma = None + # TODO - where do the weights come from? Are they also dask arrays? + sigma = weights.vindex[subsample_mask].flatten() if weights is not None else None else: raise TypeError(f"Incompatible input type for arrays {type(diff)}.")