a few typos & keywords corrected

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