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 ) |
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 |
|
-- if successful, print the result |
|
-- returned by the method |
|
-- stored in the class, should be same |
|
|
|
-- clean up memory |
CFwhm, Fwhm, Peak, Bg, X, Y, CCentroid, Image Coordinate System, Subpixel Coordinate Definition