CFEL - ASG Software Suite  2.5.0
CASS
alignment.h
Go to the documentation of this file.
1 // Copyright (C) 2010 Jochen Kuepper
2 // Copyright (C) 2010-2013 Lutz Foucar
3 
4 /**
5  * @file alignment.h processors that calculate laser alignment parameters
6  *
7  * @author Lutz Foucar
8  */
9 
10 #ifndef _ALGINMENT_POSTPROCESSOR_H_
11 #define _ALGINMENT_POSTPROCESSOR_H_
12 
13 #include "processor.h"
14 #include "cass_event.h"
15 
16 namespace cass
17 {
18 /** \f$\cos^2\theta\f$ of a requested image.
19  *
20  * @PPList "200":\f$\cos^2\theta\f$ of a requested image.
21  *
22  * This processor reduces the running average of the requested image
23  * to a scalar that represents the \f$\cos^2\theta\f$ (degree of alignment).
24  *
25  * @see Processor for a list of all commonly available cass.ini
26  * settings.
27  *
28  * @cassttng Processor/\%name%/{ImageName}\n
29  * The name of the Processor that contains the image to calculate
30  * \f$\cos^2\theta\f$ from. Default is 104.
31  * @cassttng Processor/\%name%/{ImageXCenter|ImageYCenter}\n
32  * values for the center of the image. Default is 0,0
33  * @cassttng Processor/p\%name%/{SymmetryAngle}\n
34  * value for the symmetry angle. Default is 0.
35  * @cassttng Processor/\%name%/{MaxIncludedRadius|MinIncludedRadius}\n
36  * values for the interesting radius range. Default is 0,0
37  *
38  * @author Per Johnsson
39  * @author Lutz Foucar
40  */
41 class pp200 : public Processor
42 {
43 public:
44  /** Construct processor for Gaussian height of image */
45  pp200(const name_t &);
46 
47  /** calculate \f$\cos^2\theta\f$ of averaged image */
48  virtual void process(const CASSEvent&, result_t &);
49 
50  /** load the histogram settings from CASS.ini*/
51  virtual void loadSettings(size_t);
52 
53 protected:
54  /** center of the image in histogram coordinates */
55  std::pair<size_t, size_t> _center;
56 
57  /** the range of radia used */
58  std::pair<float,float> _radiusRange;
59 
60  /** symmetry angle for calculation */
61  float _symAngle;
62 
63  /** the width of the image */
64  size_t _imageWidth;
65 
66  /** the number of angular points that we include in the distribution */
68 
69  /** the number of radial, determinded by the _radiusRange */
71 
72  /** pp containing image that we will calculate the \f$\cos^2\theta\f$ from */
74 };
75 
76 
77 
78 
79 /** angular distribution of a requested image.
80  *
81  * @PPList "201":angular distribution of a requested image.
82  *
83  * this processor will iterate through the requested radius set and
84  * all angles. Then it transforms the phi,r to kartesian coordinates to find
85  * the pixel in the image that the r,phi values corrospond to. It will do a
86  * 2D interpolation to be able to weight the content of the pixel correctly.
87  * The weighing factor is determined from the distance that the transformed
88  * kartesian coordinates have from the neighboring pixels. 0 deg is up.
89  *
90  * @see Processor for a list of all commonly available cass.ini
91  * settings.
92  *
93  * @cassttng Processor/\%name%/{ImageName}\n
94  * The name of the Processor that contains the image that
95  * the angluar distribution should be retrieved from.
96  * @cassttng Processor/\%name%/{ImageXCenter|ImageYCenter}\n
97  * values for the center of the image. Default is 500,500
98  * @cassttng Processor/\%name%/{MaxIncludedRadius|MinIncludedRadius}\n
99  * values for the interesting radius range. Default is 10,0
100  * @cassttng Processor/\%name%/{NbrAngularPoints}\n
101  * The number of Bins in the resulting histogram
102  *
103  * @author Per Johnsson
104  * @author Marc Vrakking
105  * @author Lutz Foucar
106  */
107 class pp201 : public Processor
108 {
109 public:
110  /** Construct processor for Gaussian height of image */
111  pp201(const name_t &);
112 
113  /** calculate \f$\cos^2\theta\f$ of averaged image */
114  virtual void process(const CASSEvent&, result_t &);
115 
116  /** load the histogram settings from CASS.ini*/
117  virtual void loadSettings(size_t);
118 
119 protected:
120  /** center of the image in histogram coordinates */
121  std::pair<size_t, size_t> _center;
122 
123  /** the rane of radia used */
124  std::pair<float,float> _radiusRange;
125 
126  /** the number of angular points that we include in the distribution */
128 
129  /** the number of radial, determinded by the _radiusRange */
131 
132  /** pp containing image that we will the angular distribution from */
134 };
135 
136 
137 
138 
139 
140 /** transform kartesian to poloar coordinates
141  *
142  * @PPList "202":transform kartesian to poloar coordinates
143  *
144  * This processor transforms the kartesian coordinates of an image to its
145  * polar representation. It transforms the phi, r to kartesian coordinates to
146  * find the pixel in the image that the r,phi values corrospond to. It will
147  * do a 2D interpolation to be able to weight the content of the pixel
148  * correctly. The weighing factor is determined from the distance that the
149  * transformed kartesian coordinates have from the neighboring pixels. 0 deg
150  * is up.
151  *
152  * @see Processor for a list of all commonly available cass.ini
153  * settings.
154  *
155  * @cassttng Processor/\%name%/{ImageName}\n
156  * The name of the Processor that contains the image that
157  * the angluar distribution should be retrieved from.
158  * @cassttng Processor/\%name%/{ImageXCenter|ImageYCenter}\n
159  * values for the center of the image. Default is 500,500
160  * @cassttng Processor/\%name%/{NbrAngularPoints}\n
161  * The number of Bins along the phi axis in the resulting histogram.
162  * Default is 360.
163  * @cassttng Processor/\%name%/{NbrRadialPoints}\n
164  * The number of Bins along the r axis in the resulting histogram.
165  * Default is 500.
166  *
167  * @author Per Johnsson
168  * @author Marc Vrakking
169  * @author Lutz Foucar
170  */
171 class pp202 : public Processor
172 {
173 public:
174  /** Construct processor for Gaussian height of image */
175  pp202(const name_t &);
176 
177  /** calculate \f$\cos^2\theta\f$ of averaged image */
178  virtual void process(const CASSEvent&, result_t &);
179 
180  /** load the histogram settings from CASS.ini*/
181  virtual void loadSettings(size_t);
182 
183 protected:
184  /** center of the image in user coordinates */
185  std::pair<float, float> _userCenter;
186 
187  /** center of the image in histogram coordinates */
188  std::pair<size_t, size_t> _center;
189 
190  /** the maximal radius possible */
191  float _maxRadius;
192 
193  /** the number of angular points that we include in the distribution */
195 
196  /** the number of radial, determinded by the _radiusRange */
198 
199  /** pp containing image that we will the angular distribution from */
201 };
202 
203 }//end namespace
204 
205 #endif
Event to store all LCLS Data.
Definition: cass_event.h:32
std::pair< size_t, size_t > _center
center of the image in histogram coordinates
Definition: alignment.h:188
size_t _nbrRadialPoints
the number of radial, determinded by the _radiusRange
Definition: alignment.h:130
virtual void process(const CASSEvent &, result_t &)
calculate of averaged image
Definition: alignment.cpp:99
file contains declaration of the CASSEvent
shared_pointer _image
pp containing image that we will the angular distribution from
Definition: alignment.h:133
of a requested image.
Definition: alignment.h:41
virtual void loadSettings(size_t)
load the histogram settings from CASS.ini
Definition: alignment.cpp:136
float _symAngle
symmetry angle for calculation
Definition: alignment.h:61
size_t _nbrAngularPoints
the number of angular points that we include in the distribution
Definition: alignment.h:194
pp201(const name_t &)
Construct processor for Gaussian height of image.
Definition: alignment.cpp:130
float _maxRadius
the maximal radius possible
Definition: alignment.h:191
size_t _nbrAngularPoints
the number of angular points that we include in the distribution
Definition: alignment.h:67
std::pair< size_t, size_t > _center
center of the image in histogram coordinates
Definition: alignment.h:55
virtual void process(const CASSEvent &, result_t &)
calculate of averaged image
Definition: alignment.cpp:178
base class for processors.
Definition: processor.h:39
virtual void loadSettings(size_t)
load the histogram settings from CASS.ini
Definition: alignment.cpp:38
std::pair< float, float > _userCenter
center of the image in user coordinates
Definition: alignment.h:185
angular distribution of a requested image.
Definition: alignment.h:107
size_t _imageWidth
the width of the image
Definition: alignment.h:64
size_t _nbrRadialPoints
the number of radial, determinded by the _radiusRange
Definition: alignment.h:70
shared_pointer _image
pp containing image that we will calculate the from
Definition: alignment.h:73
size_t _nbrAngularPoints
the number of angular points that we include in the distribution
Definition: alignment.h:127
file contains processors baseclass declaration
pp202(const name_t &)
Construct processor for Gaussian height of image.
Definition: alignment.cpp:217
virtual void process(const CASSEvent &, result_t &)
calculate of averaged image
Definition: alignment.cpp:269
transform kartesian to poloar coordinates
Definition: alignment.h:171
size_t _nbrRadialPoints
the number of radial, determinded by the _radiusRange
Definition: alignment.h:197
std::pair< float, float > _radiusRange
the rane of radia used
Definition: alignment.h:124
virtual void loadSettings(size_t)
load the histogram settings from CASS.ini
Definition: alignment.cpp:223
std::string name_t
define the name type
Definition: processor.h:46
std::tr1::shared_ptr< Processor > shared_pointer
a shared pointer of this
Definition: processor.h:43
std::pair< size_t, size_t > _center
center of the image in histogram coordinates
Definition: alignment.h:121
pp200(const name_t &)
Construct processor for Gaussian height of image.
Definition: alignment.cpp:32
shared_pointer _image
pp containing image that we will the angular distribution from
Definition: alignment.h:200
std::pair< float, float > _radiusRange
the range of radia used
Definition: alignment.h:58