OpenXRD programming

OpenXRD is developed in C++ using the Qt-Toolkit . We follow a strict object oriented approach. Therefore, the GUI may differ somewhat from what one is used to from the common Windows pull-down menus. Most of the functionality is provided by context menus offering only choices that apply to the specific object.

Basic classes

One of the basic classes is scanDataPoint:

class scanDataPoint {
     scanDataPoint( double angle, double intensity, double background );

     void   setIntensity( double intens ) { rawIntensity_ = intens; }
     void   setNetIntensity(double intens ) { netIntensity_ = intens; }
     void   setBackgroundIntensity( double intens ) { backgroundIntensity_ = intens; }
     void   update();
     double rawIntensity() const {return rawIntensity_;}
     double netIntensity() const {return netIntensity_;}
     double backgroundIntensity() const {return backgroundIntensity_;}
     double angle() const {return angle_;}
     double error() const {return error_;}

     //! The 2theta angle
     double angle_;
     double rawIntensity_;
     double netIntensity_;
     double backgroundIntensity_;
     double error_;

Class scanDataPoint is used in xrdScan, the most important object:

class XRDscan {
    void determineBackground();
    void findPeaks();
    void openScanFile(const QString filename, const QString format);
    void setWavelength(double wavelength){waveLength_=wavelength;}
    void setWavelengthName(const QString name){wavelengthName_=name;}
    void setStartAngle(double angle) {startAngle_=angle;}
    void setEndAngle(double angle) {endAngle_=angle;}
    void setStepSize(double step) {stepSize_=step;}
    void appendDataPoint(scanDataPoint* p){scanData_.append(p);}
    void setMaxIntensity(double m){maxIntensity_=m;}
    void setMinIntensity(double m){minIntensity_=m;}
    void setAverageIntensity(double m){averageIntensity_=m;}
    void setNumOfPoints(int i){numOfPoints_=i;}
    void setBackgroundIterations(int n){ backgroundIterations_=n;}
    void setBackgroundInterval(int n){ backgroundInterval_=n;}

    int  backgroundIterations(){return backgroundIterations_;}
    int  backgroundInterval(){return backgroundInterval_;}
    int numOfPoints(){return numOfPoints_;}
    double maxIntensity(){return maxIntensity_;}
    double minIntensity(){return minIntensity_;}
    double averageIntensity(){return averageIntensity_;}
    double waveLength()const {return waveLength_;}
    double calcD(double angle);
    QString wavelengthName() const {return wavelengthName_;}
    double startAngle() {return startAngle_;}
    double endAngle() {return endAngle_;}
    double stepSize() {return stepSize_;}
    QString getComment() const {return comment_;}
    QString getScanFileName() const {return ScanFileName_;}
    QString getScanName() const {return ScanName_;}
    QList<scanDataPoint> scanData(){return scanData_;}
    QList<xrdPeak> peakList(){return peakList_;}
    void setScanVisible(bool v){scanVisible_=v;}
    bool scanVisible(){return scanVisible_;}
    void setPeaksVisible(bool v){peaksVisible_=v;}
    bool peaksVisible(){return peaksVisible_;}
    void setBackgroundVisible(bool v){backgroundVisible_=v;}
    bool backgroundVisible(){return backgroundVisible_;}

    bool valid;


   //! The name of the scan file.
   QString ScanFileName_;
   QString ScanName_;
   //! Some comment describing the experiment.
   QString comment_;
   double waveLength_;
   QString wavelengthName_;
   double startAngle_;
   double endAngle_;
   double stepSize_;
   double maxIntensity_;
   double minIntensity_;
   double averageIntensity_;
   QList<scanDataPoint> scanData_;
   QList<xrdPeak> peakList_;
   int numOfPoints_;
   bool scanVisible_;
   bool backgroundVisible_;
   bool peaksVisible_;
   int backgroundInterval_;
   int backgroundIterations_;

The source code is available via CVS from Sourceforge


Stefan Krumm
Geology Dept.
University of Erlangen
Schlossgarten 5
91054 Erlangen