CFwhm:Calc
The Calc method computes the FWHM, Peak, Background and, optionally, the x and y centroid coordinates in the image. The starting coordinate (x,y) is passed as arguments of this method. The other parameters are stored in the CFwhm class.
nFwhm, bSuccess = CFwhm:Calc( CImage, nX0, nY0 ) where |
CImage is the image object to measure.
nX0 and nY0 are initial guesses for the centroid coordinate (x,y), measured in pixels coordinates.
FWHM is the returned value of the FWHM. On failure, nFwhm=0.
bSuccess is the returned success code. On success it is true, otherwise false.
This method returns a boolean success flag, followed by the FWHM value. Since the success flag is returned first, you can test for successful return value by testing the first return value as shown in the example below. Upon a successful calculation, the FWHM, Peak, Background, X, and Y values are stored in class properties that can be retrieved using various class methods.
Assume that an image exists as the CImage objectI. The example below shows calculation of the FWHM. The results returned by the functional call and those saved in class members should be identical.
|
-- create a CFwhm object |
|
-- point near the centroid position |
|
-- calculate using peaks, not valleys |
|
-- calculate the FWHM and optional success |
|
-- if successful, print the result |
|
-- returned by the method |
|
-- stored in the class, should be same |
|
|
|
-- clean up memory |