I have tried looking this up in the help guide, and it looks like I am applying it correctly, but it does not seem to be working. Could someone please check if I am missing something?
I have a column that I created from another column and rounded the values. I need to keep only a range of the rows based off of values in the new column. I want to keep only New Y values that are between 50000, and 50999 and delete the rest of the rows.
Here is the part of my script that has this command, but it is not working. You can see the commented out line prior to the current one I am working on this was working, but now there could be other values in the range of 50000's that I need to keep.
I also attached my whole script if needed as a reference.
dt = Current Data Table();
Column( dt, "X coordinate" ) << data type( Numeric ) << Modeling Type( Continuous ) << Format( Best, 12 );
dt << New Column( "New Y", Numeric, Nominal, Width( 5 ), Formula( Round( Y coordinate ) ) );
//dt << select where( :New Y != 50503 );
dt << select where( :New Y < 50000 & :New Y > 50999 );
dt << delete rows;
dt << New Column( "Normalized", Numeric, Continuous, Width( 10 ), Precision( 7 ), Formula( IntenCD / Col Max( IntenCD ) ) );
Thanks in advance for any help with this.
Clear Symbols();
Names Default To Here( 1 );
framex_value = "";
lotid_value = "";
w = New Window( "Requested Information", // opens a window with a title and this content...
<<Return Result,
Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing
V List Box( // V and H lists nest to organize the display boxes
H Center Box( Text Box( "Requested Information..." ) ), // a second title, centered
Spacer Box( size( 1, 20 ) ), // a little vertical space
H List Box( Text Box( " Lot#: " ), lotid = Number Edit Box( ) ), // data entry
Spacer Box( size( 1, 10 ) ), // a little vertical space
H List Box( Text Box( "Frame size X: " ), framex = Number Edit Box( ) ), // data entry
Spacer Box( size( 1, 10 ) ), // a little vertical space
H Center Box( // center the button
Button Box( "Create graph", // this script runs when the button is pressed...
lotid_value = lotid << get;
framex_value = framex << get;
dt = Current Data Table();
Column( dt, "X coordinate" ) << data type( Numeric ) << Modeling Type( Continuous ) << Format( Best, 12 );
dt << New Column( "New Y", Numeric, Nominal, Width( 5 ), Formula( Round( Y coordinate ) ) );
//dt << select where( :New Y != 50503 );
dt << select where( :New Y < 50000 & :New Y > 50999 );
dt << delete rows;
dt << New Column( "Normalized", Numeric, Continuous, Width( 10 ), Precision( 7 ), Formula( IntenCD / Col Max( IntenCD ) ) );
// Determine Matrix
xMat = Matrix( 76200 - (framex_value / 2) ) |/ Matrix( 76200 - (framex_value / 2) ) |/ Matrix( 76200 + (framex_value / 2) ) |/
Matrix( 76200 + (framex_value / 2) );
// The yMat is static
yMat = [1, 0.92, 0.92, 1];
// The overall delta
overallDelta = Col Max( dt:Normalized ) - Col Min( dt:Normalized );
//The delta between the lines
withinOrangeDelta = Col Max(
If( dt:X coordinate > (76200 - (framex_value / 2)) & dt:X coordinate < (76200 + (framex_value / 2)),
dt:Normalized,
.
)
) - Col Max( dt:Normalized ) - Col Min( dt:Normalized ) + 1;
Col Min( If( dt:X coordinate > (76200 - (framex_value / 2)) & dt:X coordinate < (76200 + (framex_value / 2)), dt:Normalized, . ) );
// Graph Builer and Delta display
gb = dt << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( dt:X Coordinate ), Y( dt:Normalized ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
);
Report( gb )[FrameBox( 1 )] << Add Graphics Script(
Pen Color( "orange" );
Pen Size( 2 );
Line( xmat, ymat );
// Add the results to the chart
Text( Boxed, {75000, .94}, "Overall Delta = " || Char( Format( overallDelta, 7, 4 ) ) );
Text( Boxed, {75000, .93}, "Within Frame Delta = " || Char( Format( withinOrangeDelta, 7, 4 ) ) );
);
Report( gb )[AxisBox( 2 )] << Min( .91 );
Report( gb )<<save picture( "\\bofs23b\aera_data\Pellicle_Transmission/" || Char( lotid_value ) ||".jpg", "jpg" );
//allTransmissions = Format( overallDelta, 7, 4, withinOrangeDelta, 7, 4);
//A = [1 2 3]; B = [4 5 6]; Concat To( A, B ); Show( A );
A = Char( Format( overallDelta, 7, 4 ) );
B = ",";
C = " ";
D = Char( Format( withinOrangeDelta, 7, 4 ) );
Concat To(A, B, C, D);
Save Text File( "\\bofs23b\aera_data\Pellicle_Transmission\" || Char( lotid_value ) ||".txt", A);
w << closeWindow;
)
)
)
)
);
... View more