偏移站點 1 數據你好,
我有一個 jmp 腳本,它根據參考數據表的值來偏移測試結果。
它會:
1.讀取數據表和參考數據表
2.生成一個新窗口選擇站點編號,
3. 根據用戶輸入(站點編號 1 或 2),將這些數據與參考數據表值對齊
以晶圓 ID 取平均值,將偏移量應用於主數據表
這是腳本:它不會產生預期的輸出
Names Default To Here( 1 );
dt1 = Data Table( "Reference data table" );
dt2 = Current Data Table();
For( i = 1, i <= N Rows( dt1 ), i++,
theTest = dt1:Tests[i];
Try( Column( dt2, theTest ) << set property( "TheMean", dt1:mean[i] ) );
);
New window( "", modal,
ct = checkbox({"1","2"}),
Buttonbox ("Ok",
get = ct << Get Selected ();
)
);
sitenum = Transform Each({str}, get, Num(str));
Col_List1 = dt2 << Get Column Names( "String" );
For( c = 1, c <= N Col( dt2 ) - 1, c++,
theMatrix = [];
name = Column( Col_List1[c] ) << Get name;
If( Contains( Col_List1[c], "IL" ),
mean = .;
Try( mean = Column( dt2, col_list1[c] ) << get property( "theMean" ) );
// Don't process if a value for theMean does not exist
If( Is Missing( mean ) == 0,
For Each Row(
If( Contains(sitenum, dt2:SiteNumber), // Something needs to be changed here *****
r = Row();
//mean = dt1:Mean[dt1 << Get Rows Where( :Tests == name )];
//measure = mean - Col Mean( If( dt2:Strips == dt2:Strips[r], Column( dt2, c ), . ) );
measure = mean - Col Mean( As Column( dt2, c ), :Wafer ID );
theMatrix = theMatrix || Column( dt2, c )[r] + measure;
);
);
Column( dt2, c ) << Set Values( theMatrix );
);
);
);腳本回复:偏移站點 1 數據我處理這個問題的方法是將 show 語句放在代碼中,以確定我在什麼時候沒有得到正確的結果。例如,在每個變換後,放入 show(sitenum)。通過這種方式,您可以跟踪邏輯的進程並查看它失敗的地方。或者,您可以使用調試器工具來執行相同的任務。
回复:偏移站點 1 數據@txnelson如果你能提供建議,我將不勝感激
回复:偏移站點 1 數據Names Default To Here( 1 );
dt1 = Data Table( "Reference data table" );
dt2 = Current Data Table();
For( i = 1, i <= N Rows( dt1 ), i++,
theTest = dt1:Tests[i];
Try( Column( dt2, theTest ) << set property( "TheMean", dt1:mean[i] ) );
);
New Window( "",
modal,
ct = Check Box( {"1", "2"} ),
Button Box( "Ok", get = ct << Get Selected() )
);
sitenum = Transform Each( {str}, get, Num( str ) );
Col_List1 = dt2 << Get Column Names( "String" );
For( c = 1, c <= N Col( dt2 ) - 1, c++,
theMatrix = [];
name = Column( Col_List1[c] ) << Get name;
// The following code is never executed since none of the column names
// have the value "IL" in their name
If( Contains( Col_List1[c], "IL" ),
mean = .;
Try( mean = Column( dt2, col_list1[c] ) << get property( "theMean" ) );
// Don't process if a value for theMean does not exist
If( Is Missing( mean ) == 0,
For Each Row(
If( Contains( sitenum, dt2:SiteNumber ), // Something needs to be changed here *****
r = Row();
//mean = dt1:Mean[dt1 << Get Rows Where( :Tests == name )];
//measure = mean - Col Mean( If( dt2:Strips == dt2:Strips[r], Column( dt2, c ), . ) );
measure = mean - Col Mean( As Column( dt2, c ), :Wafer ID );
theMatrix = theMatrix || Column( dt2, c )[r] + measure;
)
);
Column( dt2, c ) << Set Values( theMatrix );
);
);
);回复:偏移站點 1 數據@txnelson對不起。 代碼中有錯字。
下面是正確的說法:
// The following code is never executed since none of the column names
// have the value "IL" in their name
If( Contains( Col_List1[c], "Current" ),
回复:偏移站點 1 數據您需要使用 Show() 函數單步執行代碼以查看設置的值,然後確定邏輯出錯的位置,或者使用 JMP 調試器進行分析。
這就是我或論壇上的任何其他人必須做的方法。並且您具有了解您期望輸出的優勢。
回复:偏移站點 1 數據您還可以使用JMP 調試器使用斷點或單步執行代碼來檢查或觀察變量。
回复:偏移站點 1 數據你真的應該學習如何提出更好的問題......並學習如何調試腳本。 話雖如此,這是一個可以滿足您需要的工作腳本:
Names Default To Here( 1 );
dt1 = Data Table( "Reference data table" );
dt2 = Current Data Table();
For( i = 1, i <= N Rows( dt1 ), i++,
theTest = dt1:Tests[i];
Try( Column( dt2, theTest ) << set property( "TheMean", dt1:mean[i] ) );
);
New Window( "",
modal,
ct = Check Box( {"1", "2"} ),
Button Box( "Ok", get = ct << Get Selected() )
);
sitenum = Transform Each( {str}, get, Num( str ) );
Col_List1 = dt2 << Get Column Names( "String" );
For( c = 1, c <= N Col( dt2 ) - 1, c++,
If( Contains( Col_List1[c], "Current" ),
mean = .;
Try( mean = Column( dt2, col_list1[c] ) << get property( "theMean" ) );
// Don't process if a value for theMean does not exist
If( !Is Missing( mean ),
For(k=1, k<= n items(sitenum), k++,
rows = dt2 << Select Where( :SiteNumber == sitenum[k] ) << Get Selected Rows;
dt2 << Clear Select();
NewValues = Column( dt2, c )[rows]+mean;
For(i=1, i<= n items(NewValues), i++,
Column( dt2, c )[rows[i]] = NewValues[i]
);
);
);
);
);