Commit 8924690e authored by Martin Reinecke's avatar Martin Reinecke
Browse files

fixes

parent cd7dfa8c
...@@ -260,11 +260,11 @@ ...@@ -260,11 +260,11 @@
mask = np.full(s_space.shape, 1.) mask = np.full(s_space.shape, 1.)
mask[l:h] = 0 mask[l:h] = 0
mask = ift.Field.from_global_data(s_space, mask) mask = ift.Field.from_global_data(s_space, mask)
R = ift.DiagonalOperator(mask)*HT R = ift.DiagonalOperator(mask)*HT
n = n.to_global_data() n = n.to_global_data().copy()
n[l:h] = 0 n[l:h] = 0
n = ift.Field.from_global_data(s_space, n) n = ift.Field.from_global_data(s_space, n)
d = R(sh) + n d = R(sh) + n
``` ```
...@@ -299,11 +299,11 @@ ...@@ -299,11 +299,11 @@
# Get signal data and reconstruction data # Get signal data and reconstruction data
s_data = s.to_global_data() s_data = s.to_global_data()
m_data = HT(m).to_global_data() m_data = HT(m).to_global_data()
m_var_data = m_var.to_global_data() m_var_data = m_var.to_global_data()
uncertainty = np.sqrt(m_var_data) uncertainty = np.sqrt(m_var_data)
d_data = d.to_global_data() d_data = d.to_global_data().copy()
# Set lost data to NaN for proper plotting # Set lost data to NaN for proper plotting
d_data[d_data == 0] = np.nan d_data[d_data == 0] = np.nan
``` ```
...@@ -360,11 +360,11 @@ ...@@ -360,11 +360,11 @@
mask = np.full(s_space.shape, 1.) mask = np.full(s_space.shape, 1.)
mask[l:h,l:h] = 0. mask[l:h,l:h] = 0.
mask = ift.Field.from_global_data(s_space, mask) mask = ift.Field.from_global_data(s_space, mask)
R = ift.DiagonalOperator(mask)*HT R = ift.DiagonalOperator(mask)*HT
n = n.to_global_data() n = n.to_global_data().copy()
n[l:h, l:h] = 0 n[l:h, l:h] = 0
n = ift.Field.from_global_data(s_space, n) n = ift.Field.from_global_data(s_space, n)
curv = Curvature(R=R, N=N, Sh=Sh) curv = Curvature(R=R, N=N, Sh=Sh)
D = curv.inverse D = curv.inverse
......
...@@ -93,12 +93,12 @@ if __name__ == '__main__': ...@@ -93,12 +93,12 @@ if __name__ == '__main__':
for sample in samples: for sample in samples:
sam = signal.at(sample + position).value sam = signal.at(sample + position).value
powers.append(A.at(sample+position).value) powers.append(A.at(sample+position).value)
avrg += sam avrg = avrg + sam
va += sam**2 va = va + sam**2
avrg /= len(samples) avrg = avrg /len(samples)
va /= len(samples) va = va / len(samples)
va -= avrg**2 va = va - avrg**2
std = ift.sqrt(va) std = ift.sqrt(va)
ift.plot(avrg, name='avrg.pdf') ift.plot(avrg, name='avrg.pdf')
ift.plot(std, name='std.pdf') ift.plot(std, name='std.pdf')
......
Markdown is supported
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