Not quite sure if this will work for you, and it is not yet available, but there is a "pad" array function in the version for creating numpy ...
https://github.com/numpy/numpy/blob/master/numpy/lib/arraypad.py
One option is "linear_ramp", which extrapolates (gaskets) outward, starting from the edge value and linearly increasing / decreasing to the specified final value.
This is a pure python function, so you can just copy it into your path and import (untested by me though)
source share