Lots of assumptions made
/*""" Optimize the computation
author: jthi
date: 2024-09-05
url: https://community.jmp.com/t5/Discussions/Optimize-the-computation/m-p/795219
keywords/tags: [semiconductor,wafer,distance,matrix,die]
Description: Calculate distance from center of wafer (coordinates) to corner of die
"""*/
Names Default To Here(1);
dt_temp = Open("$DOWNLOADS/XYCoord.jmp");
die_width = 1.160;
die_height = 0.810;
dt = dt_temp << Summary(
Group(:U1_x, :U1_y),
Freq("None"),
Weight("None"),
Link to original data table(0),
output table name("Coords")
);
dt << Delete Scripts(dt << Get Table Script Names);
// Use Update to join the distances back using U1_x and U1_y as linking ids
Close(dt_temp, no save); // Close as not needed for this demo
m_x = Column(dt, "U1_x") << get values;
m_y = Column(dt, "U1_y") << get values;
// Origo to 0, 0 and coordinates to "real" measures
// This most likely will require some adjustments but you know your data so you should be able to modify this as needed
xcoords = (m_x - Max(m_x) / 2) * die_width + die_width / 2;
ycoords = (m_y - Max(m_y) / 2) * die_height + die_height / 2;
// Distance from center to each of the corners of rectangle
// assumes that the "coordinate" is at the center of die
top_left = xcoords - die_width / 2 || ycoords + die_height / 2;
bottom_left = xcoords - die_width / 2 || ycoords - die_height / 2;
top_right = xcoords + die_width / 2 || ycoords + die_height / 2;
bottom_right = xcoords + die_width / 2 || ycoords - die_height / 2;
d_tl = Sqrt(Distance(top_left, [0 0]));
d_bl = Sqrt(Distance(bottom_left, [0 0]));
d_tr = Sqrt(Distance(top_right, [0 0]));
d_br = Sqrt(Distance(bottom_right, [0 0]));
// Assume that furthest part of die is the determining factor for distance
die_distance_to_center = Round(V Max((d_tl || d_bl || d_tr || d_br)`));
dt << New Column("D", Numeric, Ordinal, Values(die_distance_to_center));
nw = New Window("Demo",
H List Box(
dt << Data Filter(
Add Filter(columns(:D), Display(:D, N Items(15), Find(Set Text(""))))
),
gb = dt << Graph Builder(
Size(528, 463),
Show Control Panel(0),
Lock Scales(1),
Variables(X(:U1_x), Y(:U1_y)),
Elements(Points(X, Y, Legend(4))),
SendToReport(
Dispatch({}, "U1_x", ScaleBox,
{Format("Fixed Dec", 12, 0), Min(-2.87573722663528), Max(261.04),
Inc(50), Minor Ticks(1)}
),
Dispatch({}, "U1_y", ScaleBox,
{Format("Fixed Dec", 12, 0), Min(-3.300675), Max(380), Inc(100),
Minor Ticks(4)}
)
)
)
)
);
Write();
-Jarmo