r-barnes / faster-unmixer

A faster implementation of the sediment inverse/unmixing scheme proposed in Lipp et al (2021).
5 stars 1 forks source link

D8 raster needs a ring of 0's to be processed #42

Closed AlexLipp closed 1 year ago

AlexLipp commented 1 year ago

Noticed that if D8 grids are provided which don't have a ring of zero's surrounding the margin (i.e., a boundary of sink nodes) the faster_unmixer.cpp throws a runtime error: "Total area in graph does not equal total area in DEM!". I don't think we should be abl

Looks like its being thrown by Lines 240--242:

if(total_area!=flowdirs.size()){
      throw std::runtime_error("Total area in graph " + std::to_string(total_area) + " does not equal total area in DEM " + std::to_string(flowdirs.size()) + "!");
}

Is this needed @r-barnes? Adds an unnecessary constraint on data input I think.