Skip to content

Calculate slopes with PriorityFlow#9

Draft
mvhulten wants to merge 12 commits intomainfrom
dev-slopes-R
Draft

Calculate slopes with PriorityFlow#9
mvhulten wants to merge 12 commits intomainfrom
dev-slopes-R

Conversation

@mvhulten
Copy link
Copy Markdown
Collaborator

Calculate D4 direction slopes with PriorityFlow.

The goal is to create slope files for ParFlow.  This tools should be able
to do that.
This should be consistent with the ParFlow overland flow boundary condition.
This is calls PriorityFlow::SlopeCalStan() with the right arguments, but
ParFlow needs PriorityFlow::SlopeCalcUP().
Slopes in x- and y-direction appear okay, except that the right half of both
variables are sort of a ghost mirror image of the left half.  Figure out at
which step this happens.
@mvhulten mvhulten self-assigned this Mar 11, 2026
I am not certain if this is relevant, as I've found out that the script
(also in its previous form) does nothing to HSURFBurned.nc, i.e. the
values of HSURFBurnedAndMod are identical to HSURFBurned.
N.B. This still uses PriorityFlow::SlopeCalStan() and should use
PriorityFlow::SlopeCalcUP() for ParFlow.  Also direction based on non-burnt DEM
should be used in the calculation.

Resolves: #10
This should be the opposite of netCDF2simpleASCII.py
N.B. This does not generate the expected slopes!

Does not resolve #10

+ Use pysheds to fill pits
+ Use GDAL for conversion between GeoTIFF and netCDF
Apparently the mask is upside down; with this patch the mask is applied
correctly.

This commit resolves Problem 2 of issue #10.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant