CLsqFit:GetPtStatus


The GetPtStatus method returns the status of a sample point.

Syntax

sStatus = CLsqFit:GetPtStatus( nIndex )

sStatus = CLsqFit:GetPtStatus( nIndex, nChannel )

sS1, sS2, sS3, sS4 = CLsqFit:GetPtStatus( nIndex )

where

    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 of the point.

    sS1, sS2, sS3, sS4 are the status values of a point that has multi-channel (e.g., RGB) values. The number of values returned equals the number of channels.

  

The point status has 3 states: Use the point, Rejected, or 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 formats are provided with a different number of return values. If the point uses single-channel data (i.e., typical numeric data) of you specify the channel, then a single status is returned. If the point involves multi-channel data, up to 4 values will be returned. The number of values returned is determined by the SetNumChannels method. The status can be modified using SetPtStatus.

Example

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:

L = CLsqFit:new()

-- create a CLsqFit object

L:SetNumCoefs( 2 )

-- set 2 coefficients to fit a line

L:AddPt( 3.5, 5.15 )

-- add a point for x = 3.5, y = 5.15, weight = 1

 

-- add more points

L:Fit()

-- Fit the line

 

-- do something with the fit results

n = L:FindPt( 3.5, 5.15 )

-- find the point (if we don't know it has index 1)

st = L:GetPtStatus( n )

-- get the status (assume it was deleted)

Printf("status= '%s'\n", st )

-- result: Status= 'Del'

Related Topics

SetPtStatus

AddPt

FindPt

DeletePt

CLsqFit class