coronene_config.py 6.88 KB
Newer Older
jansen31's avatar
jansen31 committed
1
2
# This is the input file that the user sees/modifies.  It should be simple,
# avoid jargon or acronyms, and should be a model for a menu-driven GUI
3
4
5

new_config = {

6
7
8
9
10
    # We start very general.
    # ==========================================
    # Problem parameters
    # ==========================================
    # What is the name of the data file?
jansen31's avatar
jansen31 committed
11
12
    'data_filename': 'coronene_homo1.tif',  # In the directory '../../../InputData/OrbitalTomog/'
    'from intensity data': False,  # File gives field amplitudes
13
14
15
16
17
18
19
20

    # What type of object are we working with?
    # Options are: 'phase', 'real', 'nonnegative', 'complex'
    'object': 'complex',

    # What type of constraints do we have?
    # Options are: 'support only', 'real and support', 'nonnegative and support',
    #              'amplitude only', 'sparse real', 'sparse complex', and 'hybrid'
jansen31's avatar
jansen31 committed
21
    #              'symmetric sparse real', 'symmetric sparse complex'
jansen31's avatar
jansen31 committed
22
    'constraint': 'sparse real',
23
24
25
26

    # What type of measurements are we working with?
    # Options are: 'single diffraction', 'diversity diffraction',
    #              'ptychography', and 'complex'
Matthijs's avatar
Matthijs committed
27
28
    # Orbital imaging options are: '2D ARPES', '3D ARPES', '2D time', and '3D time''
    'experiment': '2D ARPES',
29

Matthijs's avatar
Matthijs committed
30
31
    # 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.
32
33
34
35
36
    # Are the measurements in the far field or near field?
    # Options are: 'far field' or 'near field',
    'distance': 'far field',

    # What are the dimensions of the measurements?
jansen31's avatar
jansen31 committed
37
38
    'Nx': 64,
    'Ny': 64,
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

    # 'fresnel_nr' : 0,

    # moved this to phase
    # if(strcmp('distance,'near field'))
    #    'fresnel_nr' : 1*2*pi*'Nx,
    # else
    #    'fresnel_nr' :  0, #1*2*pi*'Nx,

    # 'magn' : 1,

    # What are the noise characteristics (Poisson or Gaussian)?
    'noise': 'Poisson',
    # ==========================================
    #  Algorithm parameters
    # ==========================================
    # Now set some algorithm parameters that the user should be
    # able to control (without too much damage)

    # Algorithm:
Russell Luke's avatar
Russell Luke committed
59
    'algorithm': 'DRl',  # used to be 'Projection',
60
61
62
63
64
    '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.

jansen31's avatar
jansen31 committed
65
66
67
68
69
70
71
72
    # # 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:
73
74
    # if(strcmp('method,'RAAR')||strcmp('method,'AP')||...
    #        strcmp('method,'HPR')||strcmp('method,'HAAR'))
75
76
77
    # 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.  
78
79
80
    # 'problem_family' : 'Phase',
    # else # moreregularization parameters for Thorsten's algorithms:
    #   prbl' : complete_itreg_par(prbl),
81
82
    # This is just a patch to Thorsten's tools.  May want to change this
    # later
83
84
    # 'problem_family='Hohage',
    # end
85

86
87
    # if(strcmp('problem_family,'Phase'))
    # maximum number of iterations and tolerances
Russell Luke's avatar
Russell Luke committed
88
    'MAXIT': 500,
89
    'TOL': 1e-10,
90

91
92
    # relaxaton parameters in RAAR, HPR and HAAR
    'beta_0': 0.85,  # 0.95              # starting relaxation prameter (only used with
Russell Luke's avatar
Russell Luke committed
93
    'lambda_0': 0.85,  # 0.95              # starting relaxation prameter (only used with
94
    # HAAR, HPR and RAAR)
95
    'beta_max': 0.50,  # maximum relaxation prameter (only used with
96
    # HAAR, RAAR, and HPR)
Russell Luke's avatar
Russell Luke committed
97
    'lambda_max': 0.50,
98
    'beta_switch': 30,  # iteration at which beta moves from beta_0 -> beta_max
Russell Luke's avatar
Russell Luke committed
99
    'lambda_switch': 100,
100

jansen31's avatar
jansen31 committed
101
    'sparsity_parameter': 40,
jansen31's avatar
jansen31 committed
102
    'use_sparsity_with_support': False,
jansen31's avatar
jansen31 committed
103
    'symmetry_type': 1,  # -1 for antissymmetric functions, 1 for symmetric ones.
jansen31's avatar
jansen31 committed
104
105
    'symmetry_axis': -1,  # which axis is symmetric. (mirror plane perpendicular to this axis)

106
107
108
109
    # parameter for the data regularization
    # need to discuss how/whether the user should
    # put in information about the noise
    'data_ball': .999826,
110
111
112
113
114
115
116
117
118
119
120
    # '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.
121
122
123
124
125
    # elseif(strcmp('problem_family,'Hohage'))
    #    'alpha0' : 1e4,
    #    'N_CG' : 70,
    # end

jansen31's avatar
jansen31 committed
126
127
128
    # # ==========================================
    # # parameters for plotting and diagnostics
    # # ==========================================
129
130
131
132
133
134
135
136
137
138
139
140
141
142
    # '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
    #
jansen31's avatar
jansen31 committed
143
144
145
    # # ==========================================
    # # parameters for plotting and diagnostics
    # # ==========================================
146
147
148
149
    'diagnostic': True,
    'verbose': 1,  # options are 0 or 1
    'graphics': 1,  # whether or not to display figures, options are 0 or 1.
    # default is 1.
150
    'anim': 2,  # whether or not to display ``real time" reconstructions
151
152
    # options are 0=no, 1=yes, 2=make a movie
    # default is 1.
153
154
    'graphics_display': 'Phase_graphics',  # name of the plotting routine
    'dataprocessor_plotting': True,
jansen31's avatar
jansen31 committed
155
156
    'interpolate_result': True,
    'zoomin_on_result': True
157
158
159

}

jansen31's avatar
jansen31 committed
160
# =====================================================================
161
#  Technical/software specific parameters
jansen31's avatar
jansen31 committed
162
# =====================================================================
163
164
165
166
# Given the parameter values above, the following technical/algorithmic
# parameters are automatically set.  The user does not need to know
# about these details, and so probably these parameters should be set in
# a module one level below this one.