OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
LaserProfile.h
Go to the documentation of this file.
1 #ifndef OPAL_LASERPROFILE_HH
2 #define OPAL_LASERPROFILE_HH
3 // ------------------------------------------------------------------------
4 // $RCSfile: LaserProfile.h,v $
5 // ------------------------------------------------------------------------
6 // $Revision: 1.3.4.1 $
7 // ------------------------------------------------------------------------
8 // Copyright: see Copyright.readme
9 // ------------------------------------------------------------------------
10 //
11 // Class: LaserProfile
12 //
13 // ------------------------------------------------------------------------
14 
15 #include "Algorithms/Vektor.h"
16 
17 #include <gsl/gsl_rng.h>
18 #include <gsl/gsl_histogram2d.h>
19 #include <string>
20 #include "hdf5.h"
21 
22 
23 class LaserProfile {
24 
25 public:
26  LaserProfile(const std::string &fileName,
27  const std::string &imageName,
28  double intensityCut,
29  short flags);
30 
31  ~LaserProfile();
32 
33  void getXY(double &x, double &y);
34 
35  enum {FLIPX = 1,
36  FLIPY = 2,
37  ROTATE90 = 4,
38  ROTATE180 = 8,
39  ROTATE270 = 16};
40 private:
41  unsigned short * readFile(const std::string &fileName,
42  const std::string &imageName);
43  unsigned short * readPGMFile(const std::string &fileName);
44  unsigned short * readHDF5File(const std::string &fileName,
45  const std::string &imageName);
46  void flipX(unsigned short *image);
47  void flipY(unsigned short *image);
48  void swapXY(unsigned short *image);
49  void filterSpikes(unsigned short *image);
50  void normalizeProfileData(double intensityCut, unsigned short *image);
51  void computeProfileStatistics(unsigned short *image);
52  void fillHistrogram(unsigned short *image);
53  void setupRNG();
54  void printInfo();
55 
56  void saveData(const std::string &fname, unsigned short *image);
57  void saveHistogram();
58  void sampleDist();
59 
60  unsigned short getProfileMax(unsigned short *image);
61 
62  hsize_t sizeX_m, sizeY_m;
63  gsl_histogram2d *hist2d_m;
64  gsl_rng *rng_m;
65  gsl_histogram2d_pdf *pdf_m;
66 
69 };
70 #endif
hsize_t sizeY_m
Definition: LaserProfile.h:62
void normalizeProfileData(double intensityCut, unsigned short *image)
void getXY(double &x, double &y)
void saveData(const std::string &fname, unsigned short *image)
void fillHistrogram(unsigned short *image)
Vector_t centerMass_m
Definition: LaserProfile.h:67
void flipY(unsigned short *image)
LaserProfile(const std::string &fileName, const std::string &imageName, double intensityCut, short flags)
void flipX(unsigned short *image)
gsl_histogram2d * hist2d_m
Definition: LaserProfile.h:63
unsigned short * readPGMFile(const std::string &fileName)
unsigned short * readFile(const std::string &fileName, const std::string &imageName)
gsl_rng * rng_m
Definition: LaserProfile.h:64
void swapXY(unsigned short *image)
unsigned short getProfileMax(unsigned short *image)
hsize_t sizeX_m
Definition: LaserProfile.h:62
unsigned short * readHDF5File(const std::string &fileName, const std::string &imageName)
Vector_t standardDeviation_m
Definition: LaserProfile.h:68
void computeProfileStatistics(unsigned short *image)
void saveHistogram()
gsl_histogram2d_pdf * pdf_m
Definition: LaserProfile.h:65
void filterSpikes(unsigned short *image)