qse  0.5.4
qsedatadeglitcher.cpp
Go to the documentation of this file.
1 #include "qsedatadeglitcher.h"
2 #include "qsedataset.h"
3 #include "qsescan.h"
4 
6 (QseDataSet* inData, QseDataSet* outData, const QString& name, QObject* parent)
7  : QseEXAFSOperator(inData, outData, name, parent)
8 {
9 }
10 
12 {
13  m_OutputData -> clear();
14 
15  int ns = m_InputData -> scanCount();
16 
17  for (int s = 0; s < ns; s++) {
18  QseScan *osc = m_OutputData -> appendScan();
19 
20  deglitchScan(s, osc);
21  }
22 
23  m_OutputData -> emitOperationCompleted();
24 }
25 
27 {
28 // QseScan *sc = m_InputData->scan(n);
29 
30 // if (sc) {
31 // int nc = sc -> columnCount();
32 // int energycol = -1;
33 
34 // for (int c = 0; c < nc; c++) {
35 // QseColumn *col = sc -> column(c);
36 
37 // if (matchesEnergyColumn(col)) {
38 // energycol = c;
39 // }
40 // }
41 
42 // if (energycol < 0) {
43 // emit message(QString("No energy column found for scan %1").arg(n));
44 // } else {
45 // osc -> mergeHeaders(sc->header());
46 // osc -> setScanNumber(sc->scanNumber());
47 
48 // QseColumn *energy = osc -> appendColumn("Energy", sc -> column(energycol));
49 // QseColumn *normal = osc -> appendColumn("Norm");
50 // QseColumn *detect = osc -> appendColumn("Detector");
51 // QseColumn *seconds = osc -> appendColumn("Seconds");
52 
53 // energy -> multiplication(energyScalingRatio());
54 
55 // int nnorm = 0, ndet = 0, nsecs = 0;
56 
57 // for (int c = 0; c < nc; c++) {
58 // QseColumn *col = sc -> column(c);
59 
60 // if (matchesNormalizationColumn(col)) {
61 // nnorm += 1;
62 // normal -> addition(col);
63 // } else if (matchesDetectorColumn(col)) {
64 // ndet += 1;
65 // detect -> addition(col);
66 // } else if (matchesSecondsColumn(col)) {
67 // nsecs += 1;
68 // seconds -> addition(col);
69 // }
70 // }
71 
72 // if (nnorm > 0) {
73 // QseColumn *ratio = osc -> appendColumn("Ratio", detect);
74 
75 // ratio -> division(normal);
76 
77 // emit message(QString("Scan %1 had %2 detector columns, was normalized by %3 ion chambers").arg(n).arg(ndet).arg(nnorm));
78 // } else if (nsecs > 0) {
79 // QseColumn *ratio = osc -> appendColumn("Ratio", detect);
80 
81 // ratio -> division(seconds);
82 // emit message(QString("Scan %1 had %2 detector columns, was normalized by counting time").arg(n).arg(ndet));
83 // } else {
84 // QseColumn *ratio = osc -> appendColumn("Ratio", detect);
85 
86 // emit message(QString("Scan %1 had %2 detector columns, no normalization performed").arg(n).arg(ndet));
87 // }
88 // }
89 // }
90 }
QseDataDeglitcher(QseDataSet *inData, QseDataSet *outData, const QString &name, QObject *parent=0)
void deglitchScan(int n, QseScan *out)
QseDataSet * m_InputData
QseDataSet * m_OutputData