Stale Data

145 views
Skip to first unread message

aviation76

unread,
May 4, 2012, 8:50:52 AM5/4/12
to ia...@googlegroups.com
Hello,
 
I would like to incorporate a feature to indicate when the data is stale for a given parameter.  Reading through various threads, I encountered the "GetDataStatus" function.  I wanted to make sure I understand this function correctly before I implement it.
 

GetDataStatus( "A" )

Here's the return values:
 StatusOk = 0
 NoDataAvailable = 1
 DataNotYetAvailable = 2
 EquationError = 3

Which return value would be a better indicator of stale data?  1 or 2?

So I can build an equation like this:

GetDataStatus( "A") == 1 ? TRUE : FALSE

Thus of the statement is true (==1), then the data is stale.  Am I understanding this correctly?  Can I conversely utilize "1" or "0" instead of "TRUE" or "FALSE"?  How many previous points is this fuction sampling before the data is considered "stale"?

I also came across this funciton in another discussion:

AIsStale ? Prev(A,1)*3.14 : A * 3.14

I am not certain how to interpret this.  According to this statement, if the parameter "A" has been stale for the previous point, then multiply the parameter by 3.14.  Is that a correct interpretation?  All I am trying to produce is a parameter to indicate stale data and drop it on the "visible" property of the control.  So I am not really sure if I need this statement.

Thanks for your help!

James Bretz

unread,
May 4, 2012, 9:08:04 AM5/4/12
to ia...@googlegroups.com
Actually, GetDataStatus tells you whether you ever had data or not.

The "Prev" function is what you want:

Param != Prev( Param, 1 ) ? TRUE : FALSE

This equates to "if the parameter is not equal to the previous value then
return TRUE (not stale) else FALSE (stale)". Drop that equation on the
Visibility property of a display.

Jim

--------------------------------------------------
From: "aviation76" <z_a...@hotmail.com>
Sent: Friday, May 04, 2012 5:50 AM
To: <ia...@googlegroups.com>
Subject: [IADS] Stale Data
> --
> You received this message because you are subscribed to the Google Groups
> "IADS" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/iads/-/TUYR5PjJsaYJ.
> To post to this group, send email to ia...@googlegroups.com.
> To unsubscribe from this group, send email to
> iads+uns...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/iads?hl=en.
>
>

Michael Jones

unread,
May 4, 2012, 12:48:24 PM5/4/12
to ia...@googlegroups.com, James Bretz
If you need to make the decision of 'staleness' over a longer period of time, or more points, you could also take a look at the Variance function and/or Average Deviation functions.

Variance Function

The Variance function is used to determine if a parameter has changed during a given range of time or number of data points. Of course, this could be accomplished using the FirstDerivative function also, but Variance is based on the average of the data values that it's calculating over, so it's easier to "tune" the threshold (for this example 0.1) to get consistent results.

Syntax

Variance(Parameter, nPoints)

To utilize the Variance function:

We could use this function to determine if the pilot held the aileron/flap/elevon position (or airspeed) steady for a given amount of time. We could also use this function to detect the point at which the weapons doors (or landing gear) opened or closed (or detect whenever they are in motion).

IsParameterChanging = Variance(Param, GetUpdateRate(Param)*Ns ) > 0.1 ? TRUE : FALSE Where Ns is the number of seconds to detect change over.. For example, Is_ParmA_Changing = Variance(ParmA, GetUpdateRate(ParmA)*0.25 ) > 0.1 ? TRUE : FALSE

DidPilotHoldAirpeedSteadyForLastNSeconds = Variance(Param, GetUpdateRate(Param)*Ns) < 0.1 ? TRUE : FALSE Where Ns is the number of seconds


Mike

aviation76

unread,
May 16, 2012, 1:08:52 PM5/16/12
to ia...@googlegroups.com, James Bretz
In the statement for VARIANCE, what does the "0.1" indicate in the example?  If this value is increased or decreased, how does this affect fidelity?

James Bretz

unread,
May 16, 2012, 1:35:03 PM5/16/12
to ia...@googlegroups.com
The variance is the square of the standard deviation, so it gives you an
estimate of how distributed the values are within the range. A variance of
'0' denotes that the value didn't change over the entire period measured.
0.1 indicates small differences. To get a intuitive feel for the value,
you'll probably have to do some research.

The best approach might be to read the wiki page.

http://en.wikipedia.org/wiki/Variance
http://en.wikipedia.org/wiki/Standard_deviation

If you want to measure "absolute staleness" of a data, compare Variance to
the value of 0 (zero). That will tell you that the value remained constant
over the period measured.
Jim

--------------------------------------------------
From: "aviation76" <z_a...@hotmail.com>
Sent: Wednesday, May 16, 2012 10:08 AM
To: <ia...@googlegroups.com>
Cc: "James Bretz" <j...@iads-soft.com>
Subject: Re: [IADS] Stale Data
> --
> You received this message because you are subscribed to the Google Groups
> "IADS" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/iads/-/VqxvCYqrajgJ.

aviation76

unread,
May 28, 2012, 12:20:36 PM5/28/12
to ia...@googlegroups.com
Thanks to everyone for their assistance. I utilized the Variance technique, compared to zero, and achieved the desired results.
Reply all
Reply to author
Forward
0 new messages