Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
8426e638
Commit
8426e638
authored
May 11, 2017
by
Pumpe, Daniel (dpumpe)
Browse files
a few typos & keywords corrected
parent
1f05ea0c
Changes
3
Hide whitespace changes
Inline
Side-by-side
demos/wiener_filter_harmonic.py
View file @
8426e638
...
...
@@ -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")
nifty/field.py
View file @
8426e638
...
...
@@ -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
(
...
...
nifty/operators/response_operator/response_operator.py
View file @
8426e638
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment