diff options
author | jakobsj <jakobsj@users.noreply.github.com> | 2018-04-23 17:59:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-23 17:59:16 +0100 |
commit | d20467187e282bc005d02b4b261a21792d96e62c (patch) | |
tree | 279b3fa05ce0b74ebad17c286a05c5b8c386ecc1 | |
parent | 7101414b331f3547a8f1bba87913141ac91f6158 (diff) | |
parent | 358294dc60c682865e4a660466b52802a9d7f9bb (diff) | |
download | framework-d20467187e282bc005d02b4b261a21792d96e62c.tar.gz framework-d20467187e282bc005d02b4b261a21792d96e62c.tar.bz2 framework-d20467187e282bc005d02b4b261a21792d96e62c.tar.xz framework-d20467187e282bc005d02b4b261a21792d96e62c.zip |
Merge pull request #108 from vais-ral/fix_tv_fbpd
Fix ordering #106
-rwxr-xr-x | Wrappers/Python/ccpi/optimisation/ops.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Wrappers/Python/ccpi/optimisation/ops.py b/Wrappers/Python/ccpi/optimisation/ops.py index 993f2de..26787f5 100755 --- a/Wrappers/Python/ccpi/optimisation/ops.py +++ b/Wrappers/Python/ccpi/optimisation/ops.py @@ -63,25 +63,23 @@ class FiniteDiff2D(Operator): d1[:,:-1] = x.as_array()[:,1:] - x.as_array()[:,:-1] d2 = numpy.zeros_like(x.as_array()) d2[:-1,:] = x.as_array()[1:,:] - x.as_array()[:-1,:] - d = numpy.stack((d1,d2),2) + d = numpy.stack((d1,d2),0) return type(x)(d,geometry=x.geometry) def adjoint(self,x): - '''Backward differences, Newumann BC.''' - #Nrows, Ncols, Nchannels = x.as_array().shape - print (x) + '''Backward differences, Neumann BC.''' Nrows = x.get_dimension_size('horizontal_x') Ncols = x.get_dimension_size('horizontal_x') Nchannels = 1 if len(x.shape) == 4: Nchannels = x.get_dimension_size('channel') zer = numpy.zeros((Nrows,1)) - xxx = x.as_array()[:,:-1,0] + xxx = x.as_array()[0,:,:-1] h = numpy.concatenate((zer,xxx), 1) - numpy.concatenate((xxx,zer), 1) zer = numpy.zeros((1,Ncols)) - xxx = x.as_array()[:-1,:,1] + xxx = x.as_array()[1,:-1,:] v = numpy.concatenate((zer,xxx), 0) - numpy.concatenate((xxx,zer), 0) return type(x)(h + v,geometry=x.geometry) |