diff options
author | Jakob Jorgensen <jakob.jorgensen@manchester.ac.uk> | 2018-04-23 15:53:11 +0100 |
---|---|---|
committer | Jakob Jorgensen <jakob.jorgensen@manchester.ac.uk> | 2018-04-23 15:53:11 +0100 |
commit | 358294dc60c682865e4a660466b52802a9d7f9bb (patch) | |
tree | 279b3fa05ce0b74ebad17c286a05c5b8c386ecc1 | |
parent | 7101414b331f3547a8f1bba87913141ac91f6158 (diff) | |
download | framework-358294dc60c682865e4a660466b52802a9d7f9bb.tar.gz framework-358294dc60c682865e4a660466b52802a9d7f9bb.tar.bz2 framework-358294dc60c682865e4a660466b52802a9d7f9bb.tar.xz framework-358294dc60c682865e4a660466b52802a9d7f9bb.zip |
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) |