VeinsOfTheEarth / rabpro

Delineating watershed basins and computing attribute statistics using Google Earth Engine
https://VeinsOfTheEarth.github.io/rabpro
BSD 3-Clause "New" or "Revised" License
35 stars 8 forks source link

Using custom watershed datasets instead of HydroBasins? #132

Open kanishkan91 opened 2 years ago

kanishkan91 commented 2 years ago

@jonschwenk @jsta From the documentation and the code I gather that you are using the HydroBasins data product to produce aggregate delineations. But is it that rabpro can only be used with HydroBasins for producing more aggregate delineations? For example, if I had my own aggregate basins file, can I use rabpro with it (Maybe by just switching in the shape file)?

The reason I raise this is that there are Earth System Models that use custom basin boundaries. If this package can be used with such custom aggregate basin files, it would be extremely useful to the community.

On further study of the code, I see that load_continent_basins() is used to load the HydroBasins file. I'm wondering whether it would be possible to parameterize this to read in generic shapefiles? If this is a tool that works specifically with HydroBasins and not with any other generic shapefile, then that needs to be noted more front and center.

Apologies if I missed anything in the documentation related to this.

(PS- Note that this is probably my last comment on the code. After this, I will probably be out of your hair for the code review at least!)

jonschwenk commented 2 years ago

The short answer is no, you can't use generic watershed boundaries to do aggregations. This is mainly due to the fields that rabpro expects to see that it uses to identify connectivity and drainage areas. In theory, if you renamed your shapefile fields to match HydroBasins, then it would be possible...ish. The other thing that rabpro does (kinda hacky) to avoid loading in all the level-12 (highest resolution) subbasins to figure out which contains your coordinate is to first load in the level-1 subbasins (coarsest), intersect with the provided coordinate and use that intersection to determine which level-12 continent file to load. So this would also have to be adapted. We could make the procedure generic, but then users would need to modify the HydroBasins file (or use our version of it)...

If there is a consistent format that the ESM community uses, we'd be amenable to providing watershed delineation support for that format!

jsta commented 2 years ago

Do you know an example of a custom (aggregate) basin boundaries file that is not HydroBasins?

kanishkan91 commented 2 years ago

We work with an IAM and ESM called GCAM and we use our 235 basins for the same (We call them GLUs or geographical land use regions) which are intersected with 32 regions. These are custom developed for the model. Details are here -https://jgcri.github.io/gcam-doc/common_assumptions.html. I think other ESMs may have their own maps like these. But we need to initialize data for these 235 basins.

kanishkan91 commented 2 years ago

@jonschwenk , @jsta Could you add some text to the paper similar to the above comment on why you cant use custom boundaries with rabpro. Also, feel free to keep this issue open if you think this is something that may happen in the future.

jonschwenk commented 2 years ago

Added the following to the paper:

rabpro does not currently provide support for custom watershed datasets similar to HydroBASINS due to attribute field and data structure requirements that must be consistent for generalizability.

I will change the title of this Issue and leave it open--if enough people want to see either generalizability or a specific format supported, we can consider it (or help them implement). Thanks for bringing this up!