CLsqFit:SetPtStatus
The SetPtStatus method sets the status of am existing sample point.
CLsqFit:SetPtStatus( nIndex, sStatus ) CLsqFit:SetPtStatus( nIndex, sStatus, nChannel ) |
nIndex is the index of the point in the sample, beginning at index 1.
sStatus is a string indicating the status value to assign the point. If the data is multi-channel and the nChannel argument is not specified, then you should combine status values for all channels into a single comma-separated string.
nChannel is the optional channel to select for multi-channel data.
The point status has 3 states: Use, Rejected, and Deleted. The corresponding names used in a script are "Use", "Rej", and "Del". The current method may be used to switch between different status values. 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, the present method may be used to manually delete a point so it is not used in the fit. A deleted or rejected point's status may be changed to "Use" by the current method or using the UndeletePt method.
The GetPtStatus method uses the index of the target point. The 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 point has a single channel value (i.e., typical numeric data) or you want to sets the status of only a single channel, pass a single value for the status. If the point involves multi-channel data, up to 4 status values may be passed by combining them in a multi-channel string separated by commas.
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 |
|
|
-- Fit the line |
-- do something with the fit results |
|
|
-- find the point (if we don't know it has index 1) |
|
-- mark the point as "deleted" |
|
-- get a new fit with the point deleted |
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.