Commit be024ac2 authored by alexander.dornheim's avatar alexander.dornheim
Browse files

Added ProxOprator P_Amod

parent 711ab14a
......@@ -77,8 +77,7 @@ class Phase(Problem):
elif self.config['constraint'] =='amplitude only':
proxoperators[0] ='P_amp'
elif self.config['constraint'] == 'phase on support':
pass
#proxoperators[0] ='P_Amod' currently not working in ProxPython
proxoperators[0] ='P_Amod'
elif self.config['constraint'] =='minimum amplitude':
proxoperators[0] = 'P_min_amp'
elif self.config['constraint'] =='sparse':
......
......@@ -9,4 +9,4 @@ The "ProxOperators"-module contains all proximal operators that are already impl
from .proxoperators import *
__all__ = ["P_diag","P_parallel","magproj", "Approx_P_JWST_Poisson", "P_amp", "P_SP", "Approx_PM_Gaussian", "Approx_PM_Poisson", "P_S", "P_S_real", "P_sequential_hyperplane_odd", "P_sequential_hyperplane_even","P_parallel_hyperplane", "P_block_parallel_hyperplane", "P_block_sequential_hyperplane", "Q_Heau"]
__all__ = ["P_diag","P_parallel","magproj", "Approx_P_JWST_Poisson", "P_amp", "P_SP", "Approx_PM_Gaussian", "Approx_PM_Poisson", "P_S", "P_S_real", "P_sequential_hyperplane_odd", "P_sequential_hyperplane_even","P_parallel_hyperplane", "P_block_parallel_hyperplane", "P_block_sequential_hyperplane", "Q_Heau", "P_Amod"]
......@@ -12,7 +12,7 @@ from numpy import conj, dot, empty, ones, sqrt, sum, zeros, exp, nonzero, log, t
#from pyfftw.interfaces.scipy_fftpack import fft2, ifft2
from numpy.fft import fft2, ifft2, ifft
__all__ = ["P_diag","P_parallel","magproj", "Approx_P_JWST_Poisson", "P_amp", "P_SP", "Approx_PM_Gaussian", "Approx_PM_Poisson", "P_S", "P_S_real", "P_sequential_hyperplane_odd", "P_sequential_hyperplane_even", "P_parallel_hyperplane", "P_block_parallel_hyperplane", "P_block_sequential_hyperplane", "Q_Heau"]
__all__ = ["P_diag","P_parallel","magproj", "Approx_P_JWST_Poisson", "P_amp", "P_SP", "Approx_PM_Gaussian", "Approx_PM_Poisson", "P_S", "P_S_real", "P_sequential_hyperplane_odd", "P_sequential_hyperplane_even", "P_parallel_hyperplane", "P_block_parallel_hyperplane", "P_block_sequential_hyperplane", "Q_Heau", "P_Amod"]
......@@ -689,3 +689,35 @@ class Q_Heau(ProxOperator):
elif((rho>0) and (xsi*nu<rho)):
return y+(nu/rho)*(xsi*(x-y)+nu*(z-y))
# P_Amod.m
# written on June 1, 2017 by
# Russell Luke
# Inst. Fuer Numerische und Angewandte Mathematik
# Universitaet Gottingen
#
# DESCRIPTION: Projection subroutine for projecting onto
# support constraints
#
# INPUT: input.supp_ampl = OBJECT (TIME) DOMAIN CONSTRAINT: indeces of the
# nonzero elements in the object domain.
# u = function in the physical domain to be projected
#
# OUTPUT: p_A = the projection IN THE PHYSICAL (time) DOMAIN,
# leaves the phase alone on the support, resets
# amplitude to 1 and sets amplitude to 1 with 0
# phase outside support.
#
# USAGE: p_A = P_Amod(input,u)
#
# Nonstandard Matlab function calls:
class P_Amod(ProxOperator):
def __init__(self,config):
self.support_id = config['support_idx']
def work(self,u0):
p_A= np.ones_like(u)
p_A[self.support_idx] = u[self.support_idx]/abs(u[input.support_idx])
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