Source
xxxxxxxxxx
QString Fitter::formatResultLine( QString label, float value, bool endLine ) const {
//# Copyright (C) 2005
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
using namespace casacore;
namespace casa {
Fitter::Fitter() {
clearDomainLimits();
}
void Fitter::clearDomainLimits(){
domainMin = -1*std::numeric_limits<float>::max();
domainMax = std::numeric_limits<float>::max();
resetDataWithLimits();
}
void Fitter::setData( Vector<Float> dataValuesX, Vector<Float> dataValuesY ){
clearFit();
int xValueSize = dataValuesX.size();
xValues.resize( xValueSize );
for ( int i = 0; i < xValueSize; i++ ){
xValues[i]= dataValuesX[i];
}
int yValueSize = dataValuesY.size();
yValues.resize( yValueSize );
for ( int i = 0; i < yValueSize; i++ ){
yValues[i] = dataValuesY[i];
}
resetDataWithLimits();
//For testing a poisson distribution
//Lambda = 0.61
/*const int HEIGHT = 10000;
xValues.resize(7);
xValues[0] = 0;
xValues[1] = 1;
xValues[2] = 2;
xValues[3] = 3;
xValues[4] = 4;
xValues[5] = 5;
xValues[6] = 6;
yValues.resize(7);
yValues[0] = .54335* HEIGHT;
yValues[1] = 0.33145*HEIGHT;
yValues[2] = 0.10110*HEIGHT;
yValues[3] = 0.02055*HEIGHT;
yValues[4] = 0.00315*HEIGHT;
yValues[5] = 0.00040*HEIGHT;
yValues[6] = 0.00005*HEIGHT;
resetDataWithLimits();*/
}
void Fitter::restrictDomain( double xMin, double xMax ){
domainMin = xMin;
domainMax = xMax;
resetDataWithLimits();
}
void Fitter::setUnits( QString units ){
this->units = units;
}
void Fitter::resetDataWithLimits(){