reSpy package for
this purpose:
https://github.com/PMEAL/porespy/blob/dev/porespy/tools/_unpadfunc.py
On Mon, Apr 12, 2021 at 9:15 PM Stephan Hoyer wrote:
> On Mon, Apr 12, 2021 at 5:12 PM Jeff Gostick wrote:
>
>> I guess I should have clarified that I was inquiring about proposing a
d shape
> (x[20:20+orig_x.shape[0]]).
>
> Aaron Meurer
>
> >
> >
> > On Mon, Apr 12, 2021 at 1:15 PM Jeff Gostick wrote:
> >>
> >> I often find myself padding an array to do some processing on it (i.e.
> to avoid edge artifacts), then I need to remov
uot;
> elements on the right hand side, because Python interprets an ending slice
> of zero differently -- you need to write something like x[20:] to undo
> padding by [(20, 0)].
>
>
> On Mon, Apr 12, 2021 at 1:15 PM Jeff Gostick wrote:
>
>> I often find myself padding an a
I often find myself padding an array to do some processing on it (i.e. to
avoid edge artifacts), then I need to remove the padding. I wish there was
either a built in "unpad" function that accepted the same arguments as
"pad", or that "pad" accepted negative numbers (e.g [-20, -4] would undo a
pad