Commit efdfcfff authored by Martin Reinecke's avatar Martin Reinecke
Browse files

fix mistakes

parent 85dc3a08
Pipeline #22315 passed with stage
in 4 minutes and 46 seconds
......@@ -5,9 +5,10 @@ from .response_operators import LinearizedPowerResponse
class NonlinearPowerCurvature(EndomorphicOperator):
def __init__(self, position, Instrument, nonlinearity,
def __init__(self, position, FFT, Instrument, nonlinearity,
Projection, N, T, sample_list):
self.N = N
self.FFT = FFT
self.Instrument = Instrument
self.T = T
self.sample_list = sample_list
......@@ -32,14 +33,17 @@ class NonlinearPowerCurvature(EndomorphicOperator):
return False
def _times(self, x):
result = Field.zeros_like(self.position, dtype=np.float64)
result = None
for sample in self.sample_list:
result += self._sample_times(x, sample)
if result is None:
result = self._sample_times(x, sample)
result += self._sample_times(x, sample)
result *= 1./len(self.sample_list)
return result + self.T(x)
def _sample_times(self, x, sample):
LinearizedResponse = LinearizedPowerResponse(self.Instrument, self.nonlinearity,
self.Projection, self.position, sample)
self.FFT, self.Projection, self.position, sample)
return LinearizedResponse.adjoint_times(
......@@ -110,6 +110,6 @@ class NonlinearPowerEnergy(Energy):
def curvature(self):
curvature = NonlinearPowerCurvature(self.position, self.Instrument, self.nonlinearity,
curvature = NonlinearPowerCurvature(self.position, self.FFT, self.Instrument, self.nonlinearity,
self.Projection, self.N, self.T, self.sample_list)
return InversionEnabler(curvature, inverter=self.inverter)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment