Commit 7c5f191e authored by Matthijs's avatar Matthijs
Browse files

bugfix

parent cf49a222
......@@ -13,15 +13,15 @@ def data_processor(config):
sensitivity = imread(config['sensitivity_filename'])
# Add the negative K_z part to determine a real-valued orbital?
if 'add_negative_kz' in config and config['add_negative_kz']:
inp, sens = mirror_kspace(inp, sensitivity)
inp, sensitivity = mirror_kspace(inp, sensitivity)
ny, nx, nz = inp.shape
config['data'] = abs(inp)
config['data_zeros'] = sensitivity == 0
# Keep the same resolution?
if 'Ny' not in config or 'Nx' not in config or 'Nz' not in config:
print('Setting problem dimensions based on data')
config['Ny'], config['Nx'], config['Nz'] = ny, nx, nz
print('Setting problem dimensions based on data, i.e. %s' % str(ny, nx, nz))
elif ny != config['Ny'] or nx != config['Nx'] or nz != config['Nz']:
nandata = np.where(config['data_zeros'], np.nan, config['data'])
if not ('from intensity data' in config and config['from intensity data']):
......
......@@ -29,9 +29,8 @@ new_config = {
# Orbital imaging options are: '2D ARPES', '3D ARPES', '2D time', and '3D time'
'experiment': '3D ARPES',
# Next we move to things that most of our users will know
# better than we will. Some of these may be overwritten in the
# data processor file which the user will most likely write.
# Next we move to things that most of our users will know better than we will. Some of these may be overwritten in
# the data processor file which the user will most likely write.
# Are the measurements in the far field or near field?
# Options are: 'far field' or 'near field',
'distance': 'far field',
......@@ -53,88 +52,34 @@ new_config = {
# Algorithm:
'algorithm': 'DRl', # used to be 'Projection',
'numruns': 1, # the only time this parameter will
# be different than 1 is when we are
# benchmarking...not something a normal user
# would be doing.
# be different than 1 is when we are benchmarking... not something a normal user would be doing.
# # The following are parameters specific to RAAR, HPR, and HAAR that the
# # user should be able to set/modify. Surely
# # there will be other algorithm specific parameters that a user might
# # want to play with. Don't know how best
# # to do this. Thinking of a GUI interface, we could hard code all the
# # parameters the user might encounter and have the menu options change
# # depending on the value of the 'method field.
# # do different things depending on the chosen algorithm:
# if(strcmp('method,'RAAR')||strcmp('method,'AP')||...
# strcmp('method,'HPR')||strcmp('method,'HAAR'))
# the following just points this driver to a patch that communicates
# the parameters defined at this level to the structures used in the
# algorithms developed by Russell.
# 'problem_family' : 'Phase',
# else # moreregularization parameters for Thorsten's algorithms:
# prbl' : complete_itreg_par(prbl),
# This is just a patch to Thorsten's tools. May want to change this
# later
# 'problem_family='Hohage',
# end
# if(strcmp('problem_family,'Phase'))
# maximum number of iterations and tolerances
'MAXIT': 500,
'TOL': 1e-15,
# relaxaton parameters in RAAR, HPR and HAAR
'beta_0': 0.85, # 0.95 # starting relaxation prameter (only used with
'lambda_0': 0.85, # 0.95 # starting relaxation prameter (only used with
# HAAR, HPR and RAAR)
'beta_max': 0.50, # maximum relaxation prameter (only used with
# HAAR, RAAR, and HPR)
'lambda_max': 0.50,
'beta_0': 0.85, # starting relaxation prameter (only used with HAAR, HPR and RAAR)
# 'lambda_0': 0.85, # starting relaxation prameter (used e.g. with DRl)
'beta_max': 0.50, # maximum relaxation prameter (only used with HAAR, RAAR, and HPR)
# 'lambda_max': 0.50,
'beta_switch': 30, # iteration at which beta moves from beta_0 -> beta_max
'lambda_switch': 100,
# 'lambda_switch': 100,
'sparsity_parameter': 100,
'use_sparsity_with_support': True,
'symmetry_type': 1, # -1 for antissymmetric functions, 1 for symmetric ones.
'symmetry_type': 1, # -1 for antisymmetric functions, 1 for symmetric ones.
'symmetry_axis': -1, # which axis is symmetric. (mirror plane perpendicular to this axis)
# parameter for the data regularization
# need to discuss how/whether the user should
# put in information about the noise
# parameter for the data regularization.
# Need to discuss how/whether the user should put in information about the noise
'data_ball': .999826,
# 'data_ball' : .9998261e-0,
# the above is the percentage of the gap
# between the measured data and the
# initial guess satisfying the
# qualitative constraints. For a number
# very close to one, the gap is not expected
# to improve much. For a number closer to 0
# the gap is expected to improve a lot.
# Ultimately the size of the gap depends
# on the inconsistency of the measurement model
# with the qualitative constraints.
# elseif(strcmp('problem_family,'Hohage'))
# 'alpha0' : 1e4,
# 'N_CG' : 70,
# end
# the above is the percentage of the gap between the measured data and the
# initial guess satisfying the qualitative constraints. For a number
# very close to one, the gap is not expected to improve much. For a number closer to 0
# the gap is expected to improve a lot. Ultimately the size of the gap depends
# on the inconsistency of the measurement model with the qualitative constraints.
# # ==========================================
# # parameters for plotting and diagnostics
# # ==========================================
# 'plotWhat.n1=2,
# 'plotWhat.n2=3,
# 'plotWhat.plots' : 'PYWpyw',
# 'verbose' : 1, # options are 0 or 1
# 'graphics' : 1, # whether or not to display figures, options are 0 or 1.
# # default is 1.
# 'anim' : 1, # whether or not to disaply ``real time" reconstructions
# # options are 0=no, 1=yes, 2=make a movie
# # default is 1.
# 'graphics_display' : [], # unless specified, a default
# # plotting subroutine will generate
# # the graphics. Otherwise, the user
# # can write their own plotting subroutine
#
# # ==========================================
# # parameters for plotting and diagnostics
# # ==========================================
......
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