Skip to content

Error 'nodata' for grid.snap_to_mask and grid.catchment (as for grid.flowdir and grid.accumulation) #266

@z123371

Description

@z123371

First of all thanks for the code. I have the same issue for grid.flowdir and grid.accumulation but I solve it with this code : nodata_out=np.int64(0)
But for grid.snap_to_mask and grid.catchment, the use of nodata_out doesn't succed.
Here you can see the code :

Snap pour point to high accumulation cell

x_snap, y_snap = grid.snap_to_mask(acc > 1000, (x, y), nodata_out=np.int64(0))

Delineate the catchment

catch = grid.catchment(x=x_snap, y=y_snap, fdir=fdir, dirmap=dirmap,
xytype='coordinate', nodata_out=np.int64(0))

And the error type is styll : 'nodata' value not representable in dtype of array. I'd checked acc and fdir and they don't have "no data" values...

Do you have a solution to this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions