Skip to content

Cannot use RiverMapper & pyDEM in the same script #1

@SorooshMani-NOAA

Description

@SorooshMani-NOAA

@feiye-vims while you're working on the latest generated mesh to see if it's useful or not, I started using RiverMapper and pyDEM to learn a bit more about them. To start I tried both serial and parallel sample for each of them successfully.

My next step was to try to combine the two serial scripts so that I end up with a single script that gets DEM as input and outputs river polygons. This is where I ran into an issue.

After some digging I realized that the issue stems from this line:

Basically setting this error handling in RiverMapper affects the results of pyDEM. So when at the top of myscript I import:

from pyDEM.dem import dem
from RiverMapper.make_river_map import make_river_map

I run into an issue during the calculation of the DEM thalwegs:

        dem_obj.compute_river(acc_limit=catchment_area)
        gdf = dem_obj.write_shapefile(npt_smooth=thalweg_smoothing)
        gdf.to_file(out_stem)

So I was wondering if there's any reason why this error handling is set for numpy errors?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions