Open apatlpo opened 1 year ago
For the records, here is the correct way to compute the gradient:
ds = xr.open_zarr(zarr)
# manually negate 999999 values
ds["cells"] = ds.cells.where( ds.cells!=999999, other=-999999 )
# manually add Nk to suntans accessor
ds.suntans.Nk = np.ones(ds.Nc.size)
# compute gradient on a temporal snapshot provided as a numpy array
ds.suntans.calc_grad(ds.eta.isel(time=1))
I'm pretty sure this is a usage mistake, but I am having difficulties computing a gradient:
Any pointers as to how to fix this are welcome