10 m_ScanPattern(
this,
"scanpattern",NULL),
11 m_MinScanRowCount(
this,
"minscanrowcount", NULL),
12 m_MaxScanRowCount(
this,
"maxscanrowcount", NULL),
13 m_MinScanColumnCount(
this,
"minscancolumncount", NULL),
14 m_MaxScanColumnCount(
this,
"maxscancolumncount", NULL),
15 m_InputEnergyUnits(
this, QStringList()<<
"eV"<<
"keV",
16 "inputenergyunits", NULL),
17 m_OutputEnergyUnits(
this, QStringList()<<
"eV"<<
"keV",
18 "outputenergyunits", NULL)
20 m_InputEnergyUnits.setValue(1);
21 m_OutputEnergyUnits.setValue(1);
37 for (
int s = 0; s < ns; s++) {
65 if (ok1 && (nrows < minVal)) {
69 if (ok2 && (nrows > maxVal)) {
80 if (ok1 && (ncols < minVal)) {
84 if (ok2 && (ncols > maxVal)) {
114 if (ok1 && (nrows < minVal)) {
118 if (ok2 && (nrows > maxVal)) {
129 if (ok1 && (ncols < minVal)) {
133 if (ok2 && (ncols > maxVal)) {
153 int nc = sc -> columnCount();
156 for (
int c = 0; c < nc; c++) {
165 emit
message(QString(
"No energy column found for scan %1").arg(n));
167 osc -> mergeHeaders(sc->
header());
171 osc -> setScanDateTime(QDateTime::currentDateTime());
173 QseColumn *energy = osc -> appendColumn(
"Energy", sc -> column(energycol));
174 QseColumn *normal = osc -> appendColumn(
"Norm");
175 QseColumn *detect = osc -> appendColumn(
"Detector");
176 QseColumn *seconds = osc -> appendColumn(
"Seconds");
180 int nnorm = 0, ndet = 0, nsecs = 0;
182 for (
int c = 0; c < nc; c++) {
187 normal -> addition(col);
190 detect -> addition(col);
193 seconds -> addition(col);
198 QseColumn *ratio = osc -> appendColumn(
"Ratio", detect);
200 ratio -> division(normal);
202 emit
message(QString(
"Scan %1 had %2 detector columns, was normalized by %3 ion chambers").arg(n).arg(ndet).arg(nnorm));
203 }
else if (nsecs > 0) {
204 QseColumn *ratio = osc -> appendColumn(
"Ratio", detect);
206 ratio -> division(seconds);
207 emit
message(QString(
"Scan %1 had %2 detector columns, was normalized by counting time").arg(n).arg(ndet));
209 QseColumn *ratio = osc -> appendColumn(
"Ratio", detect);
211 emit
message(QString(
"Scan %1 had %2 detector columns, no normalization performed").arg(n).arg(ndet));
214 for (
int c=0; c<nc; c++) {
244 }
else if (inp == 0 && otp == 1) {
246 }
else if (inp == 1 && otp == 0) {
QseScan * scan(int n) const
QStringList header() const
QseRegExpParameter m_ScanPattern
bool matchesScanPattern(int n)
QseStringParameter m_MinScanColumnCount
bool matchesCopyTotalCountsColumn(const QseColumn *col, int colnum)
QseColumn * appendColumn(const QString &name, const QseColumn *proto=NULL)
double energyScalingRatio()
void message(const QString &msg)
bool matchesCopyRateColumn(const QseColumn *col, int colnum)
void multiplication(const QseColumn *col)
bool matchesDetectorPattern(const QseColumn *col, int colnum)
bool matchesEnergyColumn(const QseColumn *col, int colnum)
void division(const QseColumn *col)
bool matchesCopyColumn(const QseColumn *col, int colnum)
void setName(const QString &name)
QseNormalizer(QseDataSet *inData, QseDataSet *outData, const QString &name, QObject *parent=0)
bool matchesDetectorColumn(const QseColumn *col, int colnum)
QString scanCommand() const
bool matchesCopyNormalizedColumn(const QseColumn *col, int colnum)
bool matchesCopyRatePattern(const QseColumn *col, int colnum)
bool matchesSecondsPattern(const QseColumn *col, int colnum)
QseColumnRole exceptionalColumnRole(int s, int c)
QseEnumParameter m_InputEnergyUnits
QHash< const QseColumn *, QseColumnRole > m_Exceptions
bool matchesCopyPattern(const QseColumn *col, int colnum)
QseColumnRole patternColumnRole(int s, int c)
QHash< const QseScan *, QseScanRole > m_ScanExceptions
void setScanException(int s, QseScanRole role)
bool matchesCopyTotalCountsPattern(const QseColumn *col, int colnum)
bool matchesScanException(int s)
QseStringParameter m_MaxScanRowCount
bool matchesCopyNormalizedPattern(const QseColumn *col, int colnum)
QseColumn * column(int n) const
void setColumnException(int s, int c, QseColumnRole role)
bool matchesNormalizationPattern(const QseColumn *col, int colnum)
QseStringParameter m_MinScanRowCount
QseColumnRole columnRole(int s, int c)
QseStringParameter m_MaxScanColumnCount
bool matchesNormalizationColumn(const QseColumn *col, int colnum)
QseDataSet * m_OutputData
void normalizeScan(int n, QseScan *out)
bool matchesSecondsColumn(const QseColumn *col, int colnum)
bool matchesEnergyPattern(const QseColumn *col, int colnum)
QseEnumParameter m_OutputEnergyUnits
bool matchesColumnException(int s, int c)