Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nam
ProxPython
Commits
f46bfd4e
Commit
f46bfd4e
authored
Mar 13, 2019
by
robin.requadt
Browse files
Upload New File : P_M.py
parent
cb0297bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
proxtoolbox/ProxOperators/P_M.py
0 → 100644
View file @
f46bfd4e
from
proxoperators
import
ProxOperator
import
numpy
as
np
class
P_M
(
ProxOperator
):
"""
Projection onto Fourier magnitude constraints
"""
def
__init__
(
self
,
config
):
"""
Initialization
Parameters
----------
config : dict - Dictionary containing the problem configuration. It must contain the following mapping:
'M' : array_like - nonegative real FOURIER DOMAIN CONSTRAINT
"""
self
.
M
=
config
[
'M'
]
def
work
(
self
,
u
):
"""
Applies the proxoperator P_M
Parameters
----------
u : array_like - function in the physical domain to be projected
Returns
-------
array_like - [p_M,phat_M] ,where p_M = the projection IN THE PHYSICAL (time) DOMAIN and phat_M = projection IN THE FOURIER DOMAIN
"""
m
=
self
.
M
a
=
eval
(
'np.fft.fft2(u)'
)
b
=
eval
(
'magproj(a,m)'
)
return
eval
(
'np.fft.ifft2(b)'
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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