Here is my first pass of a possible method for finding the Onset Point. The script calculated the below graph
Names Default To Here( 1 );
dt = Current Data Table();
dt << clear select;
// Set the number of places to look ahead for calculations
lookAhead = 6;
// Loop across all rows, finding possible Onset Points
// temp[x] < temp[x+1] & temp[x] < Mean of the next 6 values of temp - 1.5 STD of those points
// When found, select those rows
For( i = 1, i <= N Rows( dt ) - lookAhead, i++,
If(
:Temperature Actual[i] < :Temperature Actual[i + 1] & :Temperature Actual[i] >
Mean( :Temperature Actual[Index( i + 1, i + 1 + lookAhead )] )
-Std Dev( :Temperature Actual[Index( i + 1, i + 1 + lookAhead )] ) * 1.5,
Row State( i ) = Selected State( 1 )
)
);
// Get the list of the selected rows
suspectRows = dt << get selected rows();
// The target criteria for the Onset is where the max temp values for the suspect rows
maxTemp = Max( :temperature Actual[suspectRows] );
// Get the time value for the selected suspect Row
timeval = :"time (s)"n[suspectRows[Loc( :temperature Actual[suspectRows], maxTemp )[1]]];
// Clear all selected rows
dt << clear select;
// Generate the Graph Builder Chart
gb = Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables(
X( :"Time (s)"n ),
Y( :Temperature Actual ),
Y( :Ram Travel Actual, Position( 1 ), Side( "Right" ) )
),
Elements( Points( X, Y( 1 ), Legend( 5 ) ), Points( X, Y( 2 ), Legend( 9 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model( 5, Properties( 0, {Line Color( 21 )}, Item ID( "Temperature Actual", 1 ) ) )}
)
)
);
// Add a verticle reference line at the calculated Onset Point
Report( gb )[AxisBox( 1 )] << add ref line( timeval, solid, green, "", 3 );
// Select the row in the data table that is the calculated Onset Point
Row State( suspectRows[Loc( :temperature Actual[suspectRows], maxTemp )[1]] ) = Selected State( 1 );
Jim