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 ) |
CImage is the image object to measure.
nX0 and nY0 are initial guesses for the centroid coordinate (x,y), in pixels coordinates.
The returned values nX and nY are the actual pixel coordinates that were used (may be centroid coordinates).
On successful calculation, this method returns the FWHM and true.
On failure, nFwhm=0 and false are returned.
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
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.