CFwhm:new


The new method constructs a new instance of a CFwhm object. The CFwhm class includes properties that control calculation of a FWHM value and its centroid position. Two different constructor overloads are available to create a new CFwhm and initialize the properties.

Syntax

F = CFwhm:new()

F = CFwhm:new( CFwhm2 )

where

    F is the new CFwhm object.

    The first form, with no arguments, creates a default CFwhm F with properties initialized to default values.

    When CFwhm2 is passed, a new CFwhm F is created and initialized to the properties of the existing CFwhm2 object (in place of CFwhm2, use the name of the actual object to be copied ). If you pass something other than nil or another CFwhm object, then the default constructor is used.

Example

The following script illustrates using the 2 constructors and changes the bPositive property for the second (copied) one:

 

F1 = CFwhm:new()

-- create CFwhm A with default values

F2 = CFwhm:new( F1 )

-- copy A to a new CFwhm B

F2.bPositive = false

-- change the value from true to false

Printf("F1 sign= %d", F1.bPositive )

-- result: F1 sign = 1

Printf("F2 sign= %d", F2.bPositive )

-- result: F2 sign = 0

Related Topics

delete

CFwhm Class