Skip to content
Snippets Groups Projects
Commit aa0b1292 authored by Philipp Arras's avatar Philipp Arras
Browse files

Cosmetics

parent 69da894e
No related branches found
No related tags found
No related merge requests found
...@@ -18,9 +18,9 @@ def make_random_mask(): ...@@ -18,9 +18,9 @@ def make_random_mask():
if __name__ == '__main__': if __name__ == '__main__':
# # description of the tutorial ###
np.random.seed(42) np.random.seed(42)
# FIXME description of the tutorial
# Choose problem geometry and masking # Choose problem geometry and masking
# One dimensional regular grid # One dimensional regular grid
...@@ -38,7 +38,7 @@ if __name__ == '__main__': ...@@ -38,7 +38,7 @@ if __name__ == '__main__':
harmonic_space = position_space.get_default_codomain() harmonic_space = position_space.get_default_codomain()
HT = ift.HarmonicTransformOperator(harmonic_space, target=position_space) HT = ift.HarmonicTransformOperator(harmonic_space, target=position_space)
# set correlation structure with a power spectrum and build # Set correlation structure with a power spectrum and build
# prior correlation covariance # prior correlation covariance
def power_spectrum(k): def power_spectrum(k):
return 100. / (20.+k**3) return 100. / (20.+k**3)
...@@ -48,7 +48,7 @@ if __name__ == '__main__': ...@@ -48,7 +48,7 @@ if __name__ == '__main__':
S = ift.DiagonalOperator(prior_correlation_structure) S = ift.DiagonalOperator(prior_correlation_structure)
# build instrument response consisting of a discretization, mask # Build instrument response consisting of a discretization, mask
# and harmonic transformaion # and harmonic transformaion
GR = ift.GeometryRemover(position_space) GR = ift.GeometryRemover(position_space)
mask = ift.Field.from_global_data(position_space, mask) mask = ift.Field.from_global_data(position_space, mask)
...@@ -57,19 +57,19 @@ if __name__ == '__main__': ...@@ -57,19 +57,19 @@ if __name__ == '__main__':
data_space = GR.target data_space = GR.target
# setting the noise covariance # Set the noise covariance
noise = 5. noise = 5.
N = ift.ScalingOperator(noise, data_space) N = ift.ScalingOperator(noise, data_space)
# creating mock data # Create mock data
MOCK_SIGNAL = S.draw_sample() MOCK_SIGNAL = S.draw_sample()
MOCK_NOISE = N.draw_sample() MOCK_NOISE = N.draw_sample()
data = R(MOCK_SIGNAL) + MOCK_NOISE data = R(MOCK_SIGNAL) + MOCK_NOISE
# building propagator D and information source j # Build propagator D and information source j
j = R.adjoint_times(N.inverse_times(data)) j = R.adjoint_times(N.inverse_times(data))
D_inv = R.adjoint * N.inverse * R + S.inverse D_inv = R.adjoint * N.inverse * R + S.inverse
# make it invertible # Make it invertible
IC = ift.GradientNormController(iteration_limit=500, tol_abs_gradnorm=1e-3) IC = ift.GradientNormController(iteration_limit=500, tol_abs_gradnorm=1e-3)
D = ift.InversionEnabler(D_inv, IC, approximation=S.inverse).inverse D = ift.InversionEnabler(D_inv, IC, approximation=S.inverse).inverse
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment