mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
Changed everywhere from float to double, even mythenDetectorServer and the standalone files
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@206 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -1545,16 +1545,16 @@ int multiSlsDetector::setROI(int nroi, int *xmin, int *xmax, int *ymin, int *yma
|
||||
*/
|
||||
|
||||
|
||||
float* multiSlsDetector::decodeData(int *datain, float *fdata) {
|
||||
float *dataout;
|
||||
double* multiSlsDetector::decodeData(int *datain, double *fdata) {
|
||||
double *dataout;
|
||||
if (fdata)
|
||||
dataout=fdata;
|
||||
else
|
||||
dataout=new float[thisMultiDetector->numberOfChannels];
|
||||
dataout=new double[thisMultiDetector->numberOfChannels];
|
||||
|
||||
// int ich=0;
|
||||
|
||||
float *detp=dataout;
|
||||
double *detp=dataout;
|
||||
int *datap=datain;
|
||||
|
||||
|
||||
@ -1605,8 +1605,8 @@ float* multiSlsDetector::decodeData(int *datain, float *fdata) {
|
||||
|
||||
|
||||
int multiSlsDetector::setFlatFieldCorrection(string fname){
|
||||
float data[thisMultiDetector->numberOfChannels], xmed[thisMultiDetector->numberOfChannels];
|
||||
float ffcoefficients[thisMultiDetector->numberOfChannels], fferrors[thisMultiDetector->numberOfChannels];
|
||||
double data[thisMultiDetector->numberOfChannels], xmed[thisMultiDetector->numberOfChannels];
|
||||
double ffcoefficients[thisMultiDetector->numberOfChannels], fferrors[thisMultiDetector->numberOfChannels];
|
||||
int nmed=0;
|
||||
int idet=0, ichdet=-1;
|
||||
char ffffname[MAX_STR_LENGTH*2];
|
||||
@ -1743,9 +1743,9 @@ int multiSlsDetector::setFlatFieldCorrection(string fname){
|
||||
|
||||
|
||||
|
||||
int multiSlsDetector::setFlatFieldCorrection(float *corr, float *ecorr) {
|
||||
int multiSlsDetector::setFlatFieldCorrection(double *corr, double *ecorr) {
|
||||
int ichdet=0;
|
||||
float *p, *ep;
|
||||
double *p, *ep;
|
||||
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
||||
if (detectors[idet]) {
|
||||
if (corr!=NULL)
|
||||
@ -1771,9 +1771,9 @@ int multiSlsDetector::setFlatFieldCorrection(float *corr, float *ecorr) {
|
||||
|
||||
|
||||
|
||||
int multiSlsDetector::getFlatFieldCorrection(float *corr, float *ecorr) {
|
||||
int multiSlsDetector::getFlatFieldCorrection(double *corr, double *ecorr) {
|
||||
int ichdet=0;
|
||||
float *p, *ep;
|
||||
double *p, *ep;
|
||||
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
||||
if (detectors[idet]) {
|
||||
if (corr!=NULL)
|
||||
@ -1862,10 +1862,10 @@ angleConversionConstant * multiSlsDetector::getAngularConversionPointer(int imod
|
||||
|
||||
|
||||
|
||||
int multiSlsDetector::flatFieldCorrect(float* datain, float *errin, float* dataout, float *errout){
|
||||
int multiSlsDetector::flatFieldCorrect(double* datain, double *errin, double* dataout, double *errout){
|
||||
|
||||
int ichdet=0;
|
||||
float *perr=errin;//*pdata,
|
||||
double *perr=errin;//*pdata,
|
||||
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
||||
if (detectors[idet]) {
|
||||
#ifdef VERBOSE
|
||||
@ -1887,8 +1887,8 @@ int multiSlsDetector::flatFieldCorrect(float* datain, float *errin, float* datao
|
||||
|
||||
|
||||
|
||||
int multiSlsDetector::setRateCorrection(float t){
|
||||
// float tdead[]=defaultTDead;
|
||||
int multiSlsDetector::setRateCorrection(double t){
|
||||
// double tdead[]=defaultTDead;
|
||||
|
||||
if (t==0) {
|
||||
thisMultiDetector->correctionMask&=~(1<<RATE_CORRECTION);
|
||||
@ -1909,7 +1909,7 @@ int multiSlsDetector::setRateCorrection(float t){
|
||||
}
|
||||
|
||||
|
||||
int multiSlsDetector::getRateCorrection(float &t){
|
||||
int multiSlsDetector::getRateCorrection(double &t){
|
||||
|
||||
if (thisMultiDetector->correctionMask&(1<<RATE_CORRECTION)) {
|
||||
#ifdef VERBOSE
|
||||
@ -1925,7 +1925,7 @@ int multiSlsDetector::getRateCorrection(float &t){
|
||||
return 0;
|
||||
};
|
||||
|
||||
float multiSlsDetector::getRateCorrectionTau(){
|
||||
double multiSlsDetector::getRateCorrectionTau(){
|
||||
|
||||
if (thisMultiDetector->correctionMask&(1<<RATE_CORRECTION)) {
|
||||
#ifdef VERBOSE
|
||||
@ -1957,10 +1957,10 @@ int multiSlsDetector::getRateCorrection(){
|
||||
|
||||
|
||||
|
||||
int multiSlsDetector::rateCorrect(float* datain, float *errin, float* dataout, float *errout){
|
||||
int multiSlsDetector::rateCorrect(double* datain, double *errin, double* dataout, double *errout){
|
||||
|
||||
int ichdet=0;
|
||||
float *perr=errin;
|
||||
double *perr=errin;
|
||||
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
||||
if (detectors[idet]) {
|
||||
if (errin)
|
||||
@ -2157,8 +2157,8 @@ int multiSlsDetector::getAngularConversion(int &direction, angleConversionCons
|
||||
|
||||
|
||||
|
||||
float multiSlsDetector::setDAC(float val, dacIndex idac, int imod) {
|
||||
float ret, ret1=-100;
|
||||
double multiSlsDetector::setDAC(double val, dacIndex idac, int imod) {
|
||||
double ret, ret1=-100;
|
||||
|
||||
int id=-1, im=-1;
|
||||
int dmi=0, dma=thisMultiDetector->numberOfDetectors;
|
||||
@ -2180,8 +2180,8 @@ float multiSlsDetector::setDAC(float val, dacIndex idac, int imod) {
|
||||
return ret1;
|
||||
}
|
||||
|
||||
float multiSlsDetector::getADC(dacIndex idac, int imod) {
|
||||
float ret, ret1=-100;
|
||||
double multiSlsDetector::getADC(dacIndex idac, int imod) {
|
||||
double ret, ret1=-100;
|
||||
|
||||
int id=-1, im=-1;
|
||||
int dmi=0, dma=thisMultiDetector->numberOfDetectors;
|
||||
@ -2234,8 +2234,8 @@ int multiSlsDetector::setChannel(long long reg, int ichan, int ichip, int imod)
|
||||
\returns the actual value
|
||||
*/
|
||||
|
||||
float multiSlsDetector::setAngularConversionParameter(angleConversionParameter c, float v) {
|
||||
float ret=slsDetectorUtils::setAngularConversionParameter(c,v);
|
||||
double multiSlsDetector::setAngularConversionParameter(angleConversionParameter c, double v) {
|
||||
double ret=slsDetectorUtils::setAngularConversionParameter(c,v);
|
||||
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
||||
|
||||
if (detectors[idet]) {
|
||||
@ -2248,10 +2248,10 @@ float multiSlsDetector::setAngularConversionParameter(angleConversionParameter c
|
||||
|
||||
|
||||
|
||||
// float* multiSlsDetector::convertAngles(float pos) {
|
||||
// float *ang=new float[thisMultiDetector->numberOfChannels];
|
||||
// double* multiSlsDetector::convertAngles(double pos) {
|
||||
// double *ang=new double[thisMultiDetector->numberOfChannels];
|
||||
|
||||
// float *p=ang;
|
||||
// double *p=ang;
|
||||
// int choff=0;
|
||||
|
||||
// for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
||||
@ -3286,7 +3286,7 @@ int multiSlsDetector::writeConfigurationFile(string const fname){
|
||||
|
||||
|
||||
|
||||
int multiSlsDetector::writeDataFile(string fname, float *data, float *err, float *ang, char dataformat, int nch) {
|
||||
int multiSlsDetector::writeDataFile(string fname, double *data, double *err, double *ang, char dataformat, int nch) {
|
||||
|
||||
#ifdef VERBOSE
|
||||
cout << "using overloaded multiSlsDetector function to write formatted data file " << endl;
|
||||
@ -3295,7 +3295,7 @@ int multiSlsDetector::writeDataFile(string fname, float *data, float *err, float
|
||||
|
||||
ofstream outfile;
|
||||
int choff=0, off=0; //idata,
|
||||
float *pe=err, *pa=ang;
|
||||
double *pe=err, *pa=ang;
|
||||
int nch_left=nch, n, nd;
|
||||
|
||||
if (nch_left<=0)
|
||||
@ -3381,7 +3381,7 @@ int multiSlsDetector::writeDataFile(string fname, int *data) {
|
||||
}
|
||||
|
||||
|
||||
int multiSlsDetector::readDataFile(string fname, float *data, float *err, float *ang, char dataformat){
|
||||
int multiSlsDetector::readDataFile(string fname, double *data, double *err, double *ang, char dataformat){
|
||||
|
||||
#ifdef VERBOSE
|
||||
cout << "using overloaded multiSlsDetector function to read formatted data file " << endl;
|
||||
@ -3392,7 +3392,7 @@ int multiSlsDetector::readDataFile(string fname, float *data, float *err, float
|
||||
//int interrupt=0;
|
||||
string str;
|
||||
int choff=0, off=0;
|
||||
float *pe=err, *pa=ang;
|
||||
double *pe=err, *pa=ang;
|
||||
|
||||
#ifdef VERBOSE
|
||||
std::cout<< "Opening file "<< fname << std::endl;
|
||||
|
@ -119,7 +119,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
/** threaded processing flag (i.e. if data are processed and written to file in a separate thread) */
|
||||
int threadedProcessing;
|
||||
/** dead time (in ns) for rate corrections */
|
||||
float tDead;
|
||||
double tDead;
|
||||
|
||||
|
||||
|
||||
@ -147,17 +147,17 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
/** angular direction (1 if it corresponds to the encoder direction i.e. channel 0 is 0, maxchan is positive high angle, 0 otherwise */
|
||||
int angDirection;
|
||||
/** beamline fine offset (of the order of mdeg, might be adjusted for each measurements) */
|
||||
float fineOffset;
|
||||
double fineOffset;
|
||||
/** beamline offset (might be a few degrees beacuse of encoder offset - normally it is kept fixed for a long period of time) */
|
||||
float globalOffset;
|
||||
double globalOffset;
|
||||
/** bin size for data merging */
|
||||
float binSize;
|
||||
double binSize;
|
||||
|
||||
|
||||
/** number of positions at which the detector should acquire */
|
||||
int numberOfPositions;
|
||||
/** list of encoder positions at which the detector should acquire */
|
||||
float detPositions[MAXPOS];
|
||||
double detPositions[MAXPOS];
|
||||
|
||||
|
||||
|
||||
@ -309,7 +309,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
|
||||
int getMaxNumberOfChannels(){return thisMultiDetector->maxNumberOfChannels;};
|
||||
|
||||
float getScanStep(int index, int istep){return thisMultiDetector->scanSteps[index][istep];};
|
||||
double getScanStep(int index, int istep){return thisMultiDetector->scanSteps[index][istep];};
|
||||
/** returns the detector offset (in number of channels)
|
||||
\param pos position of the detector
|
||||
\param ox reference to the offset in x
|
||||
@ -622,7 +622,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
\param ecorr if !=NULL the flat field correction errors will be filled with ecorr (1 otherwise)
|
||||
\returns 0 if ff correction disabled, >0 otherwise
|
||||
*/
|
||||
int setFlatFieldCorrection(float *corr, float *ecorr=NULL);
|
||||
int setFlatFieldCorrection(double *corr, double *ecorr=NULL);
|
||||
|
||||
/**
|
||||
get flat field corrections
|
||||
@ -630,7 +630,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
\param ecorr if !=NULL will be filled with the correction coefficients errors
|
||||
\returns 0 if ff correction disabled, >0 otherwise
|
||||
*/
|
||||
int getFlatFieldCorrection(float *corr=NULL, float *ecorr=NULL);
|
||||
int getFlatFieldCorrection(double *corr=NULL, double *ecorr=NULL);
|
||||
|
||||
|
||||
|
||||
@ -644,7 +644,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
\param t dead time in ns - if 0 disable correction, if >0 set dead time to t, if <0 set deadtime to default dead time for current settings
|
||||
\returns 0 if rate correction disabled, >0 otherwise
|
||||
*/
|
||||
int setRateCorrection(float t=0);
|
||||
int setRateCorrection(double t=0);
|
||||
|
||||
|
||||
/**
|
||||
@ -652,14 +652,14 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
\param t reference for dead time
|
||||
\returns 0 if rate correction disabled, >0 otherwise
|
||||
*/
|
||||
int getRateCorrection(float &t);
|
||||
int getRateCorrection(double &t);
|
||||
|
||||
|
||||
/**
|
||||
get rate correction tau
|
||||
\returns 0 if rate correction disabled, otherwise the tau used for the correction
|
||||
*/
|
||||
float getRateCorrectionTau();
|
||||
double getRateCorrectionTau();
|
||||
/**
|
||||
get rate correction
|
||||
\returns 0 if rate correction disabled, >0 otherwise
|
||||
@ -703,17 +703,17 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
|
||||
int writeAngularConversion(string fname);
|
||||
|
||||
// float* convertAngles(float pos);
|
||||
// double* convertAngles(double pos);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
decode data from the detector converting them to an array of floats, one for each channle
|
||||
decode data from the detector converting them to an array of doubles, one for each channle
|
||||
\param datain data from the detector
|
||||
\returns pointer to a float array with a data per channel
|
||||
\returns pointer to a double array with a data per channel
|
||||
*/
|
||||
float* decodeData(int *datain, float *fdata=NULL);
|
||||
double* decodeData(int *datain, double *fdata=NULL);
|
||||
|
||||
|
||||
|
||||
@ -728,7 +728,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
\param fferr erro on ffcoefficient
|
||||
\returns 0
|
||||
*/
|
||||
// int flatFieldCorrect(float datain, float errin, float &dataout, float &errout, float ffcoefficient, float fferr);
|
||||
// int flatFieldCorrect(double datain, double errin, double &dataout, double &errout, double ffcoefficient, double fferr);
|
||||
|
||||
/**
|
||||
flat field correct data
|
||||
@ -738,7 +738,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
\param errout error on corrected data (if not NULL)
|
||||
\returns 0
|
||||
*/
|
||||
int flatFieldCorrect(float* datain, float *errin, float* dataout, float *errout);
|
||||
int flatFieldCorrect(double* datain, double *errin, double* dataout, double *errout);
|
||||
|
||||
|
||||
|
||||
@ -752,7 +752,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
\param t acquisition time (in ns)
|
||||
\returns 0
|
||||
*/
|
||||
// int rateCorrect(float datain, float errin, float &dataout, float &errout, float tau, float t);
|
||||
// int rateCorrect(double datain, double errin, double &dataout, double &errout, double tau, double t);
|
||||
|
||||
/**
|
||||
rate correct data
|
||||
@ -762,7 +762,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
\param errout error on corrected data (if not NULL)
|
||||
\returns 0
|
||||
*/
|
||||
int rateCorrect(float* datain, float *errin, float* dataout, float *errout);
|
||||
int rateCorrect(double* datain, double *errin, double* dataout, double *errout);
|
||||
|
||||
/**
|
||||
turns off server
|
||||
@ -785,7 +785,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
/////////////////////////////////////// int setTotalProgress(); ////////////// from slsDetectorUtils!
|
||||
|
||||
/** returns the current progress in % */
|
||||
////////////////////////////////float getCurrentProgress();////////////// from slsDetectorUtils!
|
||||
////////////////////////////////double getCurrentProgress();////////////// from slsDetectorUtils!
|
||||
|
||||
|
||||
/**
|
||||
@ -795,7 +795,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
\param imod module number (if -1 alla modules)
|
||||
\returns current DAC value
|
||||
*/
|
||||
float setDAC(float val, dacIndex index, int imod=-1);
|
||||
double setDAC(double val, dacIndex index, int imod=-1);
|
||||
/**
|
||||
set dacs value
|
||||
\param val value (in V)
|
||||
@ -803,7 +803,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
\param imod module number (if -1 alla modules)
|
||||
\returns current DAC value
|
||||
*/
|
||||
float getADC(dacIndex index, int imod=0);
|
||||
double getADC(dacIndex index, int imod=0);
|
||||
/**
|
||||
configure channel
|
||||
\param reg channel register
|
||||
@ -903,7 +903,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
\returns the actual value
|
||||
*/
|
||||
|
||||
float setAngularConversionParameter(angleConversionParameter c, float v);
|
||||
double setAngularConversionParameter(angleConversionParameter c, double v);
|
||||
|
||||
/**
|
||||
|
||||
@ -913,13 +913,13 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
\param err array of arrors on the data. If NULL no errors will be written
|
||||
|
||||
\param ang array of angular values. If NULL data will be in the form chan-val(-err) otherwise ang-val(-err)
|
||||
\param dataformat format of the data: can be 'i' integer or 'f' float (default)
|
||||
\param dataformat format of the data: can be 'i' integer or 'f' double (default)
|
||||
\param nch number of channels to be written to file. if -1 defaults to the number of installed channels of the detector
|
||||
\returns OK or FAIL if it could not write the file or data=NULL
|
||||
\sa mythenDetector::writeDataFile
|
||||
|
||||
*/
|
||||
int writeDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1);
|
||||
int writeDataFile(string fname, double *data, double *err=NULL, double *ang=NULL, char dataformat='f', int nch=-1);
|
||||
|
||||
|
||||
/**
|
||||
@ -940,13 +940,13 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
\param err array of arrors on the data. If NULL no errors are expected on the file
|
||||
|
||||
\param ang array of angular values. If NULL data are expected in the form chan-val(-err) otherwise ang-val(-err)
|
||||
\param dataformat format of the data: can be 'i' integer or 'f' float (default)
|
||||
\param dataformat format of the data: can be 'i' integer or 'f' double (default)
|
||||
\param nch number of channels to be written to file. if <=0 defaults to the number of installed channels of the detector
|
||||
\returns OK or FAIL if it could not read the file or data=NULL
|
||||
|
||||
\sa mythenDetector::readDataFile
|
||||
*/
|
||||
int readDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f');
|
||||
int readDataFile(string fname, double *data, double *err=NULL, double *ang=NULL, char dataformat='f');
|
||||
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user