mythenDetector Class Reference

#include <mythenDetector.h>

Inheritance diagram for mythenDetector:

slsDetector List of all members.

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_modulereadTrimFile (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)

Constructor & Destructor Documentation

mythenDetector::mythenDetector ( int  id = 0  )  [inline]

(default) constructor

mythenDetector::~mythenDetector (  )  [inline]

destructor


Member Function Documentation

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())

Parameters:
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

Parameters:
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

Parameters:
mp already merged postions
mv already merged data
me already merged errors (squared sum)
mm multiplicity of merged arrays
Returns:
FAIL or the

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

Parameters:
reference to diffractometer direction
angconv array that will be filled with the angular conversion constants
Returns:
0 if angular conversion disabled, >0 otherwise

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

Parameters:
pos array which will contain the encoder positions
Returns:
number of positions

Implements slsDetector.

void* mythenDetector::processData ( int  delflag = 1  )  [virtual]

function for processing data

Parameters:
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

Parameters:
fname file to be read
See also:
angleConversionConstant

Implements slsDetector.

int mythenDetector::readCalibrationFile ( string  fname,
float &  gain,
float &  offset 
) [virtual]

reads a calibration file

Parameters:
fname file to be read
gain reference to the gain variable reference to the offset variable
See also:
sharedSlsDetector

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

Parameters:
name of the file to be read
data array of data values
Returns:
OK or FAIL if it could not read the file or data=NULL

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

Parameters:
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
Returns:
OK or FAIL if it could not read the file or data=NULL

Implements slsDetector.

sls_detector_module* mythenDetector::readTrimFile ( string  fname,
sls_detector_module myMod = NULL 
) [virtual]

reads a trim file

Parameters:
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
Returns:
the pointer to myMod or NULL if reading the file failed

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();

Parameters:
mp already merged postions
mv already merged data
me already merged errors (squared sum)
mm multiplicity of merged arrays
Returns:
OK or FAIL

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

Parameters:
fname file with angular conversion constants ("" disable)
Returns:
0 if angular conversion disabled, >0 otherwise

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

Parameters:
nPos number of positions
pos array with the encoder positions
Returns:
number of positions

Implements slsDetector.

int mythenDetector::writeAngularConversion ( string  fname = ""  )  [virtual]

writes an angular conversion file

Parameters:
fname file to be written
See also:
angleConversionConstant

Implements slsDetector.

int mythenDetector::writeCalibrationFile ( string  fname,
float  gain,
float  offset 
) [virtual]

writes a clibration file

Parameters:
fname file to be written
gain 
offset 
See also:
sharedSlsDetector

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

Parameters:
name of the file to be written
data array of data values
Returns:
OK or FAIL if it could not write the file or data=NULL

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

Parameters:
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
Returns:
OK or FAIL if it could not write the file or data=NULL

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

Parameters:
fname name of the file to be written
imod module number
Returns:
OK or FAIL if the file could not be written
See also:
sls_detector_module sharedSlsDetector

Implements slsDetector.

int mythenDetector::writeTrimFile ( string  fname,
sls_detector_module  mod 
) [virtual]

writes a trim file

Parameters:
fname name of the file to be written
mod module structure which has to be written to file
Returns:
OK or FAIL if the file could not be written
See also:
sls_detector_module

Implements slsDetector.


The documentation for this class was generated from the following file:
Generated on Tue Dec 1 15:31:44 2009 by  doxygen 1.4.7