Commit 8426e638 authored by Pumpe, Daniel (dpumpe)'s avatar Pumpe, Daniel (dpumpe)
Browse files

a few typos & keywords corrected

parent 1f05ea0c
...@@ -85,9 +85,12 @@ if __name__ == "__main__": ...@@ -85,9 +85,12 @@ if __name__ == "__main__":
a_s = sigma_s ** 2. * lambda_s * total_volume a_s = sigma_s ** 2. * lambda_s * total_volume
# creation of spaces # creation of spaces
x1 = RGSpace([npix,npix], distances=total_volume / npix, # x1 = RGSpace([npix,npix], distances=total_volume / npix,
zerocenter=False) # zerocenter=False)
k1 = RGRGTransformation.get_codomain(x1) # k1 = RGRGTransformation.get_codomain(x1)
x1 = HPSpace(64)
k1 = HPLMTransformation.get_codomain(x1)
p1 = PowerSpace(harmonic_domain=k1, log=False) p1 = PowerSpace(harmonic_domain=k1, log=False)
# creating Power Operator with given spectrum # creating Power Operator with given spectrum
...@@ -96,14 +99,15 @@ if __name__ == "__main__": ...@@ -96,14 +99,15 @@ if __name__ == "__main__":
S_op = create_power_operator(k1, spec) S_op = create_power_operator(k1, spec)
# creating FFT-Operator and Response-Operator with Gaussian convolution # creating FFT-Operator and Response-Operator with Gaussian convolution
# adjust dtype_target probperly
Fft_op = FFTOperator(domain=x1, target=k1, Fft_op = FFTOperator(domain=x1, target=k1,
domain_dtype=np.float64, domain_dtype=np.float64,
target_dtype=np.complex128) target_dtype=np.float64)
R_op = ResponseOperator(x1, sigma=[length_convolution], R_op = ResponseOperator(x1, sigma=[length_convolution],
exposure=[exposure]) exposure=[exposure])
# drawing a random field # drawing a random field
sk = p_field.power_synthesize(real_signal=True, mean=0.) sk = p_field.power_synthesize(decompose_power=True, mean=0.)
s = Fft_op.adjoint_times(sk) s = Fft_op.adjoint_times(sk)
signal_to_noise = 1 signal_to_noise = 1
...@@ -123,12 +127,12 @@ if __name__ == "__main__": ...@@ -123,12 +127,12 @@ if __name__ == "__main__":
m = Fft_op.adjoint_times(mk) m = Fft_op.adjoint_times(mk)
z={} # z={}
z["signal"] = s # z["signal"] = s
z["reconstructed_map"] = m # z["reconstructed_map"] = m
z["data"] = d # z["data"] = d
z["lambda"] = R_op(s) # z["lambda"] = R_op(s)
#
plot_maps(z, "Wiener_filter.html") # plot_maps(z, "Wiener_filter.html")
...@@ -304,7 +304,7 @@ class Field(Loggable, Versionable, object): ...@@ -304,7 +304,7 @@ class Field(Loggable, Versionable, object):
return result_obj return result_obj
def power_synthesize(self, spaces=None, real_power=True, def power_synthesize(self, spaces=None, real_power=True,
real_signal=False, mean=None, std=None): decompose_power=False, mean=None, std=None):
# check if the `spaces` input is valid # check if the `spaces` input is valid
spaces = utilities.cast_axis_to_tuple(spaces, len(self.domain)) spaces = utilities.cast_axis_to_tuple(spaces, len(self.domain))
...@@ -363,7 +363,7 @@ class Field(Loggable, Versionable, object): ...@@ -363,7 +363,7 @@ class Field(Loggable, Versionable, object):
lambda x: x * local_rescaler.imag, lambda x: x * local_rescaler.imag,
inplace=True) inplace=True)
if real_signal: if decompose_power:
for power_space_index in spaces: for power_space_index in spaces:
harmonic_domain = result_domain[power_space_index] harmonic_domain = result_domain[power_space_index]
result_val_list = [harmonic_domain.hermitian_decomposition( result_val_list = [harmonic_domain.hermitian_decomposition(
......
...@@ -58,7 +58,9 @@ class ResponseOperator(LinearOperator): ...@@ -58,7 +58,9 @@ class ResponseOperator(LinearOperator):
""" """
def __init__(self, domain, def __init__(self, domain,
sigma=[1.], exposure=[1.]): sigma=[1.], exposure=[1.],
default_spaces=None):
super(ResponseOperator, self).__init__(default_spaces)
self._domain = self._parse_domain(domain) self._domain = self._parse_domain(domain)
......
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