TANGO
Device Server



 

 

 

 

DataFitter
User's Guide
 


DataFitter Class
 

Revision: - Author: buteau
Implemented in C++





 

 

Introduction:




Class Identification:


 

Class Inheritance:


 

 

 

Properties:




Device Properties
Property name
Property type
Description
DeviceAttributeNameX Tango::DEV_STRING Path to the attribute X of the device providing the X values of the spectrum.
DeviceAttributeNameY Tango::DEV_STRING Path to the attribute Y of the device providing the Y values of the spectrum.
DeviceAttributeNameSigma Tango::DEV_STRING Path to the attribute Sigma of the device providing the Sigma values of the spectrum.
UseSigma Tango::DEV_BOOLEAN This property indicate of sigma values are provided.
AutoSaveData Tango::DEV_BOOLEAN This porperty is used to define if the experimental data and the fitted data must be saved after each fit If this property is set to : true, the properties : FilePath (path to the directory to save the data) ExperimentalDataFileName (filename for the experimental data file) FittedDataFileName (filename for the fitted data file) each filename will be postfixed by a number to avoid losing an old file
FilePath Tango::DEV_STRING The path to the directory where to save the data
ExperimentalDataFileName Tango::DEV_STRING The filename to use to save the experimental data This filename will be postfixed by _number.txt
FittedDataFileName Tango::DEV_STRING The filename to used to save the fitted data This filename will be postfixed by _number.txt






Device Properties Default Values:
Property Name Default Values
DeviceAttributeNameX No default value
DeviceAttributeNameY No default value
DeviceAttributeNameSigma No default value
UseSigma false
AutoSaveData false
FilePath No default value
ExperimentalDataFileName No default value
FittedDataFileName No default value



There is no Class properties.





 

 

States:




States
Names
Descriptions
ALARM The fit may is probably not good.
FAULT Unable to at least reach one of the X, Y or Sigma proxies.
STANDBY The device is in standby state. This the normal state. The device is ready to accept requests.

 

 

Attributes:


Scalar Attributes
Attribute name
Data Type
R/W Type
Expert
deviceAttributeNameX: Name of the attribute which will be fitted by this DataFittingDevice. It may be : a) a fully qualified attribute name . For instance : - D13-1_C07/DT/IMAGEUR.1-ECR/PROFILX b) an alias (if defined in the TANGO Control System): PROFILX
DEV_STRING
WRITE
Yes
deviceAttributeNameY: Name of the attribute which will be fitted by this DataFittingDevice. It may be : a) a fully qualified attribute name . For instance : - D13-1_C07/DT/IMAGEUR.1-ECR/PROFILY b) an alias (if defined in the TANGO Control System): PROFILY
DEV_STRING
WRITE
Yes
deviceAttributeNameSigma: Name of the attribute which will be fitted by this DataFittingDevice. It may be : a) a fully qualified attribute name . For instance : - D13-1_C07/DT/IMAGEUR.1-ECR/PROFILSIGMA b) an alias (if defined in the TANGO Control System): PROFILSIGMA
DEV_STRING
WRITE
Yes
useSigma: This attribute is used to know if error sigma values are provided to the fit. If false, all the values are set to 1.
DEV_BOOLEAN
WRITE
No
nbData
DEV_LONG
READ
No
fittingFunctionType: Type of the function used for fitting (gaussian, lorenzian, sigmoid with or without background)
DEV_STRING
WRITE
No
functionEquation: The equation of the fitting function choosen.
DEV_STRING
READ
No
nbIterationMax: Number of maximum iteration for the fitting algorithm. If the algorithm doesn't go to a final solution after nbIterationMax it is stopped to avoid infinite loop.
DEV_LONG
WRITE
No
epsilon: This value is the stopping value. When the difference between the values of two consecutives steps is under this value, the algorithm stop and succeed.
DEV_DOUBLE
WRITE
No
reverseY: hint given to the fitter which specifies that y-data is reversed regarding the expected shape (generally speaking, when the
DEV_BOOLEAN
WRITE
No
startingX: Starting value for X to generate the fittedDataX spectrum values.
DEV_DOUBLE
WRITE
Yes
resolutionX: Resolution according the X axis to calculate the values of the dataFittedY spectrum.
DEV_DOUBLE
WRITE
Yes
nbPointsToGenerate: Number of points to generate for the fitted functions.
DEV_LONG
WRITE
Yes
fitMode: 0 : Automatic Mode (data are fitted continuously) 1: Manual Mode . You need to do the StartFit command to launch fit calculations
DEV_BOOLEAN
WRITE
Yes
nbParameters: Number of parameters according the choosen fitting function.
DEV_LONG
READ
No
initialsParametersMode: Set the mode for choosing the initials parameters. FALSE = Manual --> the initials parameters (initialParameterPos, initialParameterWidth, initialParameterHeight, initialParameterBackground) are used to initialize the algorithm. TRUE = Automatic --> initials values are choosen automatically by finding the max value in the Y. This value gives the height. The X value associated to this Y value gives the position. Width is taken at a value of 1.0 and background is given by the first Y value.
DEV_BOOLEAN
WRITE
No
initialPosition: The initial value for the parameter position
DEV_DOUBLE
READ_WRITE
No
initialWidth: The initial value for the parameter width
DEV_DOUBLE
READ_WRITE
No
initialHeight: The initial value for the parameter height
DEV_DOUBLE
READ_WRITE
No
initialBackground: The initial value for the parameter background
DEV_DOUBLE
READ_WRITE
No
initialBackgroundA: The initial value of the parameter a where background = a*x+b
DEV_DOUBLE
READ_WRITE
No
initialBackgroundB: The initial value of the parameter b where background = a*x+b
DEV_DOUBLE
READ_WRITE
No
position: The value of the position of the curve fitted
DEV_DOUBLE
READ
No
width: The value of the width of the curve fitted
DEV_DOUBLE
READ
No
height: The value of the height of the curve fitted
DEV_DOUBLE
READ
No
background: The value of the background of the curve fitted
DEV_DOUBLE
READ
No
backgroundA: The value of the parameter a of the background = a*x+b of the curve fitted
DEV_DOUBLE
READ
No
backgroundB: The value of the parameter b of the background = a*x+b of the curve fitted
DEV_DOUBLE
READ
No
fittedDataSameSizeAsData: This attribute is used to indicate if the FittedData are of the same size as the experimental data. If TRUE the attribute startingX, resolutionX, nbPointToGenerate are not used and the startingX value used is the first X value of the experimental data, the number of points generated is the number of point of experimental data
DEV_BOOLEAN
WRITE
Yes
hwhm: the half width at half medium
DEV_DOUBLE
READ
No
fwhm: the full width at half medium
DEV_DOUBLE
READ
No
nbIterations: Number of iteration for the algorithm to converge
DEV_LONG
READ
No
searchStoppingMethod: This attribute is used to choose the search stopping method used : 1 : the test delta method 2 : the gradient method
DEV_LONG
WRITE
Yes
useScaled: If true, the Jacobian matrix is scaled to avoid conditioning problem (must be always set to TRUE)
DEV_BOOLEAN
WRITE
Yes
xLow: The value of the xlow is equal to the intersection between the background and the tangente to the sigmoid. This attribute is only valid for sigmoid(b) fit.
DEV_DOUBLE
READ
No
xHigh: The value of the xhigh is equal to the intersection between the background+height and the tangente to the sigmoid. This attribute is only valid for sigmoid(b) fit.
DEV_DOUBLE
READ
No
determinationQualityFactor: Percentage of quality fit (represent a percentage of matching between experimental and fitted data)
DEV_DOUBLE
READ
No
fStatisticQualityFactor: Other quality factor higher the value better the fit)
DEV_DOUBLE
READ
No
centroid: centroid of the experimental data
DEV_DOUBLE
READ
No
minimum: the minimum value of the experimental data
DEV_DOUBLE
READ
No
minimumPos: the minimum position of the experimental data
DEV_DOUBLE
READ
No
maximum: the maximum value of the experimental data
DEV_DOUBLE
READ
No
maximumPos: the maximum position of the experimental data
DEV_DOUBLE
READ
No
minimumDeriv: the minimum value of the derivative of the fitted data
DEV_DOUBLE
READ
No
minimumDerivPos: the minimum position of the derivative of fitted data
DEV_DOUBLE
READ
No
maximumDeriv: the maximum value of the derivative of the fitted data
DEV_DOUBLE
READ
No
maximumDerivPos: the maximum position of the derivative of fitted data
DEV_DOUBLE
READ
No





Spectrum Attributes
Attribute name
Data Type
X Data Length
Expert
knownFittersList: List of the known functions used for fitting
DEV_STRING
20
No
experimentalDataX: Data copied from original X spectrum attribute
DEV_DOUBLE
100000
No
experimentalDataY: Data copied from original Y spectrum attribute
DEV_DOUBLE
100000
No
experimentalDataSigma: Data copied from original Sigma spectrum attribute
DEV_DOUBLE
100000
No
fittedFunctionParameters: This spectrum is composed of the differents calculated parameters of the function used to fit. The number of parameters depends on the function.
DEV_DOUBLE
10
No
fittedDataX: Spectrum providing the fitted data according the X axis. These datas are calculated thanks to the fitted parameters and the resolutionX, nbPointToGenerate and startingX values.
DEV_DOUBLE
1000000
No
fittedDataY: Spectrum providing the fitted data according the Y axis. These datas are calculated thanks to the fitted parameters and the resolutionX, nbPointToGenerate and startingX values.
DEV_DOUBLE
100000
No
derivedFittedDataY: derivative of the fitted data
DEV_DOUBLE
100000
No






 

 

Commands:



More Details on commands....


Device Commands for Operator Level
Command name
Argument In
Argument Out
Init DEV_VOID DEV_VOID
State DEV_VOID DEV_STATE
Status DEV_VOID CONST_DEV_STRING
StartFit DEV_VOID DEV_VOID
WriteExperimentalData DEV_STRING DEV_VOID
WriteFittedData DEV_STRING DEV_VOID

 



1 - Init



2 - State



3 - Status



4 - StartFit



5 - WriteExperimentalData



6 - WriteFittedData




 

 


TANGO is an open source project hosted by :
Sourceforge logo small
Core and Tools : CVS repository on tango-cs project
Device Servers : CVS repository on tango-ds project