CLsqFit:GetPtStatusStr
The GetPtStatusStr method returns a string describing the status of a sample point, specificaly, "Use", "Rej", and "Del".
sStatus = CLsqFit:GetPtStatusStr( nIndex ) sStatus = CLsqFit:GetPtStatusStr( 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.
sStatus is a string giving the status string for the point.
The point status has three states: Used ("Use"), Rejected ("Rej"), or Deleted ("Del"). When a point is added to the sample it acquires the "Use" status. If data rejection is enabled and the point is rejected, it acquires a "Rej" status 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 "Del". A deleted or rejected point's status may be changed to "Use" by SetPtStatus and UndeletePt .
The GetPtStatusStr 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 with 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 rejected) |
|
-- result: Status= 'Rej' |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.