-
Notifications
You must be signed in to change notification settings - Fork 3
/
Query Raw Data from Reedholm_PCM Cleaning.jsl
156 lines (132 loc) · 3.71 KB
/
Query Raw Data from Reedholm_PCM Cleaning.jsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
//!
Names Default To Here(1);
// Define the DBTool database connection string
conn = "DSN=Reedholm_x64;UID=owt_read;PWD=owtread;APP=JMP;WSID=THORIUM;DATABASE=RIWEBSQL";
/*
Lot_Name = "1405-4";
Device_Name = "D.SIL6MDH27AAB.Product";
Process_Name = "P.SIL6MDH27AAB";
StepName = "PS.6in.M3";
sqlString1 = Concat Items(
{"EXECUTE dbo.[_TPH_GetLotID]
@Lot_Name = '", Lot_Name, "',
@Device_Name = '", Device_Name, "',
@Process_Name = '", Process_Name, "',
@StepName = '", StepName, "'"}, "");
Show(sqlString1);
dt1 = Open Database(conn, sqlString1, "tempTable");
temp = dt1:Lot_ID[1];
Close(dt1, No Save);
*/
//temp = 10170;
//Show(temp);
// Prompt user for Lot IDs
a = New Window(
"Enter the Reedholm Lot ID:",
<< Modal,
Text Box("Enter the Reedholm Lot ID:"),
editBox = Number Edit Box(),
Button Box( "OK" ),
Button Box( "Cancel" )
);
// Stop the script if the user cancels
If( a["Button"] == -1,
Stop()
);
// Get the contents of the Number Edit Box
lot_id = editBox << get;
Show(lot_id);
// Create the SQL string that we're going to execute
sqlString2 = Concat Items(
{"EXECUTE dbo.[_TPH_ExportLotData]
@Lot_ID = ", Char(lot_id)},
"");
Show(sqlString2);
// Execute the string into a table with the tablename = lot_id
dt1 = Open Database(conn, sqlString2, Char(lot_id));
// Take the Die_Name column and parse it for die coords
xCoordCol = New Column("X Coord (Column)");
xCoordCol << Set Formula(
Num(Substr(:Die_Name, 2, Munger(:Die_Name, 0, "y") - 2))
);
xCoordCol << EvalFormula;
yCoordCol = New Column("Y Coord (Row)");
yCoordCol << Set Formula(
Num(Substr(:Die_Name, Munger(:Die_Name, 0, "y") + 1))
);
yCoordCol << EvalFormula;
// Figure out what mask we're using and then set the equation for Radius.
// No need to create new columns - we should only have 1 mask per lot.
// Take the 7th through 11th characters of the Device_Name
// (D.SIL607G13TPJ.Product.Ron) to get the mask.
mask = Substr( Column( "Device_Name" )[1], 7, 5);
Show(mask);
// Lookup the Die Size (X, Y). Assume 07G11 if not found.
dieSize = Match(
mask,
"MDH27", {4.34, 6.44},
"07G11", {2.43, 3.3},
"07G13", {4.37, 6.47},
"07G14", {2.33, 2.07},
"07G16", {5.02, 8.49},
{2.43, 3.3}
);
// Look up the CenterXY coord. Assume 07G11 if not found.
centerXY = Match(
mask,
"MDH27", {18.5, 12.5},
"07G11", {29, 21},
"07G13", {16.5, 9.5},
"07G14", {30.5, 33.5},
"07G16", {14.3386, 8.5589},
{2.43, 3.3}
);
// Add a Radius (mm) column.
radiusCol = New Column("Radius (mm)");
radiusCol << Set Formula(
Root(
(dieSize[1] * (:Name("X Coord (Column)") - centerXY[1])) ^ 2
+
(dieSize[2] * (:Name("Y Coord (Row)") - centerXY[2])) ^ 2,
Empty()
)
);
radiusCol << EvalFormula;
// Add a Radius^2 column.
radius2Col = New Column("Radius^2");
radius2Col << Set Formula(
:Name( "Radius (mm)" )^2
);
radius2Col << EvalFormula;
/*
Start some data cleaning for PCM
*/
// Select which items I want to remove
dt1 << Select Where(
(:Test_Name != "PCM.CV.Fit.Return.Y-Int" & :Result <= 0)
| :Result >= 1e12
| :FailCode != 0
);
For Each Row(
// If an item is selected, then set the hidded and excluded row states.
If( Selected( Row State() ) == 1,
Hidden( Row State() ) = 1;
Excluded( Row State() ) = 1;
);
);
dt1 << Invert Row Selection;
dt2 = dt1 << Subset(Selected Rows(1));
dt3 = dt2 << Split(
Split By( :IntraDie_Name, :Test_Name ),
Split( :Result ),
Remaining Columns( Keep All ),
Copy formula (1),
Output Table( Concat(Char(lot_id), " PCM" ))
);
dt3 << Sort(
replace table,
By( :Lot_Name, :Wafer_Name, :DieOrder ),
Order( Ascending, Ascending, Ascending )
);
Close(dt2, NoSave);
Close(dt1, NoSave);