Commit 64cdbfaa authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'fun_with_operators' into byebye_volume_factors

parents 2e77efe1 bbfb9c1b
Pipeline #23706 failed with stage
in 4 minutes and 5 seconds
...@@ -5,12 +5,14 @@ np.random.seed(42) ...@@ -5,12 +5,14 @@ np.random.seed(42)
def adjust_zero_mode(m0, t0): def adjust_zero_mode(m0, t0):
mtmp = ift.dobj.to_global_data(m0.val)
zero_position = len(m0.shape)*(0,) zero_position = len(m0.shape)*(0,)
zero_mode = m0.val[zero_position] zero_mode = mtmp[zero_position]
m0.val[zero_position] = zero_mode / abs(zero_mode) mtmp[zero_position] = zero_mode / abs(zero_mode)
t0.val[0] += 2 * np.log(abs(zero_mode)) ttmp = ift.dobj.to_global_data(t0.val)
return m0, t0 ttmp[0] += 2 * np.log(abs(zero_mode))
return (ift.Field(m0.domain, ift.dobj.from_global_data(mtmp)),
ift.Field(t0.domain, ift.dobj.from_global_data(ttmp)))
if __name__ == "__main__": if __name__ == "__main__":
......
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