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
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
ift
NIFTy
Commits
b7934d79
Commit
b7934d79
authored
Jan 04, 2018
by
Martin Reinecke
Browse files
more simplifications
parent
2396e6c9
Pipeline
#23348
passed with stage
in 4 minutes and 34 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
demos/nonlinear_critical_filter.py
View file @
b7934d79
...
...
@@ -49,7 +49,8 @@ if __name__ == "__main__":
mask
=
ift
.
Field
(
s_space
,
val
=
ift
.
dobj
.
from_global_data
(
mask
))
MaskOperator
=
ift
.
DiagonalOperator
(
mask
)
InstrumentResponse
=
ift
.
ResponseOperator
(
s_space
,
sigma
=
[
0.0
])
InstrumentResponse
=
ift
.
ResponseOperator
(
s_space
,
sigma
=
[
0.0
],
exposure
=
[
1.0
])
MeasurementOperator
=
InstrumentResponse
*
MaskOperator
d_space
=
MeasurementOperator
.
target
...
...
nifty/library/critical_power_curvature.py
View file @
b7934d79
from
..operators
import
EndomorphicOperator
,
InversionEnabler
,
DiagonalOperator
from
..operators
import
InversionEnabler
,
DiagonalOperator
class
CriticalPowerCurvature
(
EndomorphicOperator
):
"""The curvature of the CriticalPowerEnergy.
This operator implements the second derivative of the
CriticalPowerEnergy used in some minimization algorithms or
for error estimates of the power spectrum.
Parameters
----------
theta: Field,
The map and inverse gamma prior contribution to the curvature.
T : SmoothnessOperator,
The smoothness prior contribution to the curvature.
"""
def
__init__
(
self
,
theta
,
T
,
inverter
):
super
(
CriticalPowerCurvature
,
self
).
__init__
()
theta
=
DiagonalOperator
(
theta
)
self
.
_op
=
InversionEnabler
(
T
+
theta
,
inverter
,
theta
.
inverse_times
)
@
property
def
capability
(
self
):
return
self
.
_op
.
capability
def
apply
(
self
,
x
,
mode
):
return
self
.
_op
.
apply
(
x
,
mode
)
@
property
def
domain
(
self
):
return
self
.
_op
.
domain
def
CriticalPowerCurvature
(
theta
,
T
,
inverter
):
theta
=
DiagonalOperator
(
theta
)
return
InversionEnabler
(
T
+
theta
,
inverter
,
theta
.
inverse_times
)
nifty/library/response_operators.py
View file @
b7934d79
from
..field
import
exp
from
..operators.linear_operator
import
LinearOperator
class
LinearizedSignalResponse
(
LinearOperator
):
def
__init__
(
self
,
Instrument
,
nonlinearity
,
FFT
,
power
,
m
):
super
(
LinearizedSignalResponse
,
self
).
__init__
()
position
=
FFT
.
adjoint_times
(
power
*
m
)
self
.
_op
=
(
Instrument
*
nonlinearity
.
derivative
(
position
)
*
FFT
.
adjoint
*
power
)
def
LinearizedSignalResponse
(
Instrument
,
nonlinearity
,
FFT
,
power
,
m
):
position
=
FFT
.
adjoint_times
(
power
*
m
)
return
(
Instrument
*
nonlinearity
.
derivative
(
position
)
*
FFT
.
adjoint
*
power
)
@
property
def
domain
(
self
):
return
self
.
_op
.
domain
@
property
def
target
(
self
):
return
self
.
_op
.
target
@
property
def
capability
(
self
):
return
self
.
_op
.
capability
def
apply
(
self
,
x
,
mode
):
return
self
.
_op
.
apply
(
x
,
mode
)
class
LinearizedPowerResponse
(
LinearOperator
):
def
__init__
(
self
,
Instrument
,
nonlinearity
,
FFT
,
Projection
,
t
,
m
):
super
(
LinearizedPowerResponse
,
self
).
__init__
()
power
=
exp
(
0.5
*
t
)
position
=
FFT
.
adjoint_times
(
Projection
.
adjoint_times
(
power
)
*
m
)
linearization
=
nonlinearity
.
derivative
(
position
)
self
.
_op
=
(
0.5
*
Instrument
*
linearization
*
FFT
.
adjoint
*
m
*
Projection
.
adjoint
*
power
)
@
property
def
domain
(
self
):
return
self
.
_op
.
domain
@
property
def
target
(
self
):
return
self
.
_op
.
target
@
property
def
capability
(
self
):
return
self
.
_op
.
capability
def
apply
(
self
,
x
,
mode
):
return
self
.
_op
.
apply
(
x
,
mode
)
def
LinearizedPowerResponse
(
Instrument
,
nonlinearity
,
FFT
,
Projection
,
t
,
m
):
power
=
exp
(
0.5
*
t
)
position
=
FFT
.
adjoint_times
(
Projection
.
adjoint_times
(
power
)
*
m
)
linearization
=
nonlinearity
.
derivative
(
position
)
return
(
0.5
*
Instrument
*
linearization
*
FFT
.
adjoint
*
m
*
Projection
.
adjoint
*
power
)
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