Skip to content
Snippets Groups Projects
Commit 2b33d347 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

cosmetics

parent bf72e471
No related branches found
No related tags found
2 merge requests!265WIP: Even more fun with linear operators,!263WIP: Draw sample2
Pipeline #
......@@ -14,8 +14,8 @@ def adjust_zero_mode(m0, t0):
return (ift.Field.from_global_data(m0.domain, mtmp),
ift.Field.from_global_data(t0.domain, ttmp))
if __name__ == "__main__":
if __name__ == "__main__":
noise_level = 1.
p_spec = (lambda k: (.5 / (k + 1) ** 3))
......
......@@ -14,8 +14,8 @@ def adjust_zero_mode(m0, t0):
return (ift.Field.from_global_data(m0.domain, mtmp),
ift.Field.from_global_data(t0.domain, ttmp))
if __name__ == "__main__":
if __name__ == "__main__":
noise_level = 1.
p_spec = (lambda k: (1. / (k + 1) ** 2))
......
# Program to generate figures of article "Information theory for fields"
# by Torsten Ensslin, Annalen der Physik, submitted to special edition
# "Physics of Information" in April 2018, arXiv:1804.03350
# to get exact figure of paper comment out lines marked by "COMMENT OUT"
# to get exact figure of paper comment out lines marked by "COMMENT OUT"
import numpy as np
import nifty4 as ift
......@@ -28,7 +28,7 @@ if __name__ == "__main__":
L = 1. # Total length of interval or volume the field lives on
nprobes = 1000 # Number of probes for uncertainty quantification used in paper
nprobes = 10 # COMMENT OUT TO REPRODUCE PAPER FIGURE EXACTLY
# Define resolution (pixels per dimension)
N_pixels = 1024
......
......@@ -43,6 +43,7 @@ class CustomResponse(ift.LinearOperator):
def capability(self):
return self.TIMES | self.ADJOINT_TIMES
if __name__ == "__main__":
np.random.seed(43)
# Set up physical constants
......
......@@ -11,6 +11,7 @@ def init_nu():
data = comm.bcast(data, root=0)
nu.reset_units(data[0])
if __name__ == "__main__":
# In MPI mode, the random seed for numericalunits must be set by hand
init_nu()
......
......@@ -80,7 +80,7 @@ class SandwichOperator(EndomorphicOperator):
try:
s = self._cheese.draw_sample(from_inverse, dtype)
return self._bun.inverse_times(s)
except:
except NotImplementedError:
pass
raise NotImplementedError(
"cannot draw from inverse of this operator")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment