For now use Nicolas' burning routine.
Then save slopes (2 coordinates) in the ParFlow binary format (.pfb) with
slopex, slopey = grid.grad
write_pfb('slopex.pfb', slopex)
write_pfb('slopey.pfb', slopey)
edit: this^ code sketches the idea but is wrong (Grid.grad and write_pfb() do not exist).