Commit 53889812 authored by Philipp Arras's avatar Philipp Arras
Browse files

Some fixups

parent 69075882
Pipeline #24102 failed with stage
in 4 minutes and 29 seconds
......@@ -21,12 +21,11 @@ from .response_operators import LinearizedPowerResponse
def NonlinearPowerCurvature(position, FFT, Instrument, nonlinearity,
Projection, N, T, sample_list, inverter):
Projection, N, T, sample_list, inverter, munit=1., sunit=1.):
result = None
for sample in sample_list:
LinearizedResponse = LinearizedPowerResponse(
Instrument, nonlinearity, FFT, Projection, position, sample)
op = LinearizedResponse.adjoint*N.inverse*LinearizedResponse
LinR = LinearizedPowerResponse(Instrument, nonlinearity, FFT, Projection, position, sample, munit, sunit)
op = LinR.adjoint*N.inverse*LinR
result = op if result is None else result + op
result = result*(1./len(sample_list)) + T
return InversionEnabler(result, inverter)
......@@ -59,6 +59,7 @@ class NonlinearPowerEnergy(Energy):
self.Projection = Projection
self.sigma = sigma
self.munit = munit
self.sunit = sunit
if sample_list is None:
if samples is None or samples == 0:
sample_list = [m]
......@@ -99,9 +100,11 @@ class NonlinearPowerEnergy(Energy):
def at(self, position):
return self.__class__(position, self.d, self.N, self.m, self.D,
self.FFT, self.Instrument, self.nonlinearity,
self.Projection, sigma=self._sigma,
self.Projection, sigma=self.sigma,
......@@ -118,4 +121,4 @@ class NonlinearPowerEnergy(Energy):
return NonlinearPowerCurvature(
self.position, self.FFT, self.Instrument, self.nonlinearity,
self.Projection, self.N, self.T, self.sample_list,
self.inverter, self.munit, self.sunit)
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