CLsqFit:GetPtStatus
The GetPtStatus method returns an integer representing the status of a sample point. To get a string representation, use GetPtStatusStr .
nStatus = CLsqFit:GetPtStatus( nIndex ) nStatus = CLsqFit:GetPtStatus( nIndex, nChannel ) |
nIndex is the index of the point in the sample, beginning at index 1.
nChannel is the optional channel to select for multi-channel data.
nStatus is an integer giving the status of the point.
The point status has three states: 0 ("use"), 1 ("rej"), or 2 ("del") for used, rejected, or deleted. When a point is added to the sample it acquires a status value of 0 (used). If data rejection is enabled and the point is rejected, it acquires a status of 1 (rejected) and is not used in the fit. Likewise, if you explicitly delete a point so it is not used in the fit, the status will become 2 (deleted). A deleted or rejected point's status may be changed to 0 (used) by SetPtStatus and UndeletePt .
The GetPtStatus method uses the index of the target point. The point's index must either be known from the order that points were added to the sample, or determined by matching the target point's values using FindPt or a more complicated procedure involving GetResid or other method.
Two forms are provided. If the data have a single channel, as in typical numeric data, then you may specify only the point index. If you fit multi-channel data, as for an RGB array, then the channel must be specified as 1 through 4 to return the point status for that channel.
The following example illustrates how to change the status of a sample point. In this case, the target point's index is found by matching its values:
|
-- create a CLsqFit object |
|
-- set 2 coefficients to fit a line |
|
-- add a point for x = 3.5, y = 5.15, weight = 1 |
-- add more points to the fit |
|
|
-- enable bad data rejection using default values |
|
-- Fit the line |
-- do something with the fit results |
|
|
-- find the point (if we don't know it has index 1) |
|
-- get the status (assume it was deleted) |
|
-- result: Status= 1 (rejected) |
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.