#include <mythenDetector.h>
Inheritance diagram for mythenDetector:
Public Member Functions | |
mythenDetector (int id=0) | |
~mythenDetector () | |
int | readConfigurationFile (string const fname) |
int | writeConfigurationFile (string const fname) |
int | dumpDetectorSetup (string const fname) |
int | retrieveDetectorSetup (string const fname) |
sls_detector_module * | readTrimFile (string fname, sls_detector_module *myMod=NULL) |
int | writeTrimFile (string fname, sls_detector_module mod) |
int | writeTrimFile (string fname, int imod) |
int | writeDataFile (string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1) |
int | writeDataFile (string fname, int *data) |
int | readDataFile (string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0) |
int | readDataFile (string fname, int *data) |
int | readCalibrationFile (string fname, float &gain, float &offset) |
int | writeCalibrationFile (string fname, float gain, float offset) |
int | readAngularConversion (string fname="") |
int | writeAngularConversion (string fname="") |
int | setAngularConversion (string fname="") |
int | getAngularConversion (int &direction, angleConversionConstant *angconv=NULL) |
char * | getAngularConversion () |
float | setGlobalOffset (float f) |
float | setFineOffset (float f) |
float | getFineOffset () |
float | getGlobalOffset () |
int | setPositions (int nPos, float *pos) |
int | getPositions (float *pos=NULL) |
float | setBinSize (float bs) |
float | getBinSize () |
int | resetMerging (float *mp, float *mv, float *me, int *mm) |
int | addToMerging (float *p1, float *v1, float *e1, float *mp, float *mv, float *me, int *mm) |
int | finalizeMerging (float *mp, float *mv, float *me, int *mm) |
void * | processData (int delflag=1) |
void | acquire (int delflag=1) |
mythenDetector::mythenDetector | ( | int | id = 0 |
) | [inline] |
(default) constructor
mythenDetector::~mythenDetector | ( | ) | [inline] |
destructor
void mythenDetector::acquire | ( | int | delflag = 1 |
) | [virtual] |
performs the complete acquisition and data processing moves the detector to next position
starts and reads the detector
reads the IC (if required)
reads the encoder (iof required for angualr conversion)
processes the data (flat field, rate, angular conversion and merging processData())
delflag | if 1 the data are deleted, else left there for further processing (or plotting?) |
Implements slsDetector.
int mythenDetector::addToMerging | ( | float * | p1, | |
float * | v1, | |||
float * | e1, | |||
float * | mp, | |||
float * | mv, | |||
float * | me, | |||
int * | mm | |||
) | [virtual] |
merge dataset
p1 | angular positions of dataset | |
v1 | data | |
e1 | errors | |
mp | already merged postions | |
mv | already merged data | |
me | already merged errors (squared sum) | |
mm | multiplicity of merged arrays |
Implements slsDetector.
int mythenDetector::dumpDetectorSetup | ( | string const | fname | ) | [virtual] |
not yet implemented
should dump to a file all the current detector parameters
Implements slsDetector.
int mythenDetector::finalizeMerging | ( | float * | mp, | |
float * | mv, | |||
float * | me, | |||
int * | mm | |||
) |
calculates the "final" positions, data value and errors for the emrged data
mp | already merged postions | |
mv | already merged data | |
me | already merged errors (squared sum) | |
mm | multiplicity of merged arrays |
Reimplemented from slsDetector.
char* mythenDetector::getAngularConversion | ( | ) | [inline, virtual] |
returns the angular conversion file
Implements slsDetector.
int mythenDetector::getAngularConversion | ( | int & | direction, | |
angleConversionConstant * | angconv = NULL | |||
) | [virtual] |
get angular conversion
reference | to diffractometer direction | |
angconv | array that will be filled with the angular conversion constants |
Implements slsDetector.
float mythenDetector::getBinSize | ( | ) | [inline, virtual] |
return detector bin size used for merging (approx angular resolution)
Implements slsDetector.
float mythenDetector::getFineOffset | ( | ) | [inline, virtual] |
get detector fine offset
Implements slsDetector.
float mythenDetector::getGlobalOffset | ( | ) | [inline, virtual] |
get detector global offset
Implements slsDetector.
int mythenDetector::getPositions | ( | float * | pos = NULL |
) | [inline, virtual] |
get positions for the acquisition
pos | array which will contain the encoder positions |
Implements slsDetector.
void* mythenDetector::processData | ( | int | delflag = 1 |
) | [virtual] |
function for processing data
delflag | if 1 the data are deleted, else left there for further processing (or plotting?) |
Implements slsDetector.
int mythenDetector::readAngularConversion | ( | string | fname = "" |
) | [virtual] |
reads an angular conversion file
fname | file to be read |
Implements slsDetector.
int mythenDetector::readCalibrationFile | ( | string | fname, | |
float & | gain, | |||
float & | offset | |||
) | [virtual] |
reads a calibration file
fname | file to be read | |
gain | reference to the gain variable reference to the offset variable |
Implements slsDetector.
int mythenDetector::readConfigurationFile | ( | string const | fname | ) | [virtual] |
Purely virtual function Should be implemented in the specific detector class /sa mythenDetector::readConfigurationFile
Implements slsDetector.
int mythenDetector::readDataFile | ( | string | fname, | |
int * | data | |||
) | [virtual] |
reads a data file
name | of the file to be read | |
data | array of data values |
Implements slsDetector.
int mythenDetector::readDataFile | ( | string | fname, | |
float * | data, | |||
float * | err = NULL , |
|||
float * | ang = NULL , |
|||
char | dataformat = 'f' , |
|||
int | nch = 0 | |||
) | [virtual] |
reads a data file
name | of the file to be read | |
data | array of data values to be filled | |
err | array of arrors on the data. If NULL no errors are expected on the file | |
ang | array of angular values. If NULL data are expected in the form chan-val(-err) otherwise ang-val(-err) | |
dataformat | format of the data: can be 'i' integer or 'f' float (default) | |
nch | number of channels to be written to file. if <=0 defaults to the number of installed channels of the detector |
Implements slsDetector.
sls_detector_module* mythenDetector::readTrimFile | ( | string | fname, | |
sls_detector_module * | myMod = NULL | |||
) | [virtual] |
reads a trim file
fname | name of the file to be read | |
myMod | pointer to the module structure which has to be set. If it is NULL a new module structure will be created |
Implements slsDetector.
int mythenDetector::resetMerging | ( | float * | mp, | |
float * | mv, | |||
float * | me, | |||
int * | mm | |||
) | [virtual] |
sets the arrays of the merged data to 0. NB The array should be created with size >= 360./getBinSize();
mp | already merged postions | |
mv | already merged data | |
me | already merged errors (squared sum) | |
mm | multiplicity of merged arrays |
Implements slsDetector.
int mythenDetector::retrieveDetectorSetup | ( | string const | fname | ) | [virtual] |
not yet implemented
should retrieve from a file all the current detector parameters
Implements slsDetector.
int mythenDetector::setAngularConversion | ( | string | fname = "" |
) | [virtual] |
set angular conversion
fname | file with angular conversion constants ("" disable) |
Implements slsDetector.
float mythenDetector::setBinSize | ( | float | bs | ) | [inline, virtual] |
set detector bin size used for merging (approx angular resolution)
Implements slsDetector.
float mythenDetector::setFineOffset | ( | float | f | ) | [inline, virtual] |
set detector fine offset
Implements slsDetector.
float mythenDetector::setGlobalOffset | ( | float | f | ) | [inline, virtual] |
set detector global offset
Implements slsDetector.
int mythenDetector::setPositions | ( | int | nPos, | |
float * | pos | |||
) | [inline, virtual] |
set positions for the acquisition
nPos | number of positions | |
pos | array with the encoder positions |
Implements slsDetector.
int mythenDetector::writeAngularConversion | ( | string | fname = "" |
) | [virtual] |
writes an angular conversion file
fname | file to be written |
Implements slsDetector.
int mythenDetector::writeCalibrationFile | ( | string | fname, | |
float | gain, | |||
float | offset | |||
) | [virtual] |
writes a clibration file
fname | file to be written | |
gain | ||
offset |
Implements slsDetector.
int mythenDetector::writeConfigurationFile | ( | string const | fname | ) | [virtual] |
Every detector should have a basic configuration file containing: type (mythen, pilatus etc.) hostname portnumber communication type (default TCP/IP) eventually secondary portnumber (e.g. mythen stop function) number of modules installed if different from the detector size (x,y)
to be changed
Implements slsDetector.
int mythenDetector::writeDataFile | ( | string | fname, | |
int * | data | |||
) | [virtual] |
writes a data file
name | of the file to be written | |
data | array of data values |
Implements slsDetector.
int mythenDetector::writeDataFile | ( | string | fname, | |
float * | data, | |||
float * | err = NULL , |
|||
float * | ang = NULL , |
|||
char | dataformat = 'f' , |
|||
int | nch = -1 | |||
) | [virtual] |
writes a data file
name | of the file to be written | |
data | array of data values | |
err | array of arrors on the data. If NULL no errors will be written | |
ang | array of angular values. If NULL data will be in the form chan-val(-err) otherwise ang-val(-err) | |
dataformat | format of the data: can be 'i' integer or 'f' float (default) | |
nch | number of channels to be written to file. if -1 defaults to the number of installed channels of the detector |
Implements slsDetector.
int mythenDetector::writeTrimFile | ( | string | fname, | |
int | imod | |||
) | [virtual] |
writes a trim file for module number imod - the values will be read from the current detector structure
fname | name of the file to be written | |
imod | module number |
Implements slsDetector.
int mythenDetector::writeTrimFile | ( | string | fname, | |
sls_detector_module | mod | |||
) | [virtual] |
writes a trim file
fname | name of the file to be written | |
mod | module structure which has to be written to file |
Implements slsDetector.