Author |
Topic |
|
Phillip T.
Germany
19 Posts |
Posted - 08/30/2022 : 03:14:54 AM
|
Hello, I have an issue with the integ1 function not working (giving 0 as all result values) and deleting my x values in the process. Weirdly I used almost the same skript on other datasets and it worked; although also deleting the x-axis values.
//START CODE
IRno= 128; //$([%H]IR!wks.nCols); newsheet name:= integration; //range IRtime = [%H]IRintnorm!col(A); //col(A)= IRtime; col(A)[L]$ = IR Time;
//highWN = 3808; //lowWN = 3625; sheet$ = IRintnorm; comment$ = ""; Intno = 1;
wks.addcol();
getn (high WN) highWN (low WN) lowWN (Integration No.) Intno (Sheet) sheet$ (comment) comment$;
page.active$ = %(sheet$);
loop(ii,1,wks.nRows) {
if($([%H]%(sheet$)!cell($(ii),1)) < $(highWN)){ highCN = $(ii);
}; if($([%H]%(sheet$)!cell($(ii),1)) < $(lowWN)){ lowCN = $(ii);
};
};
//type -b "$(IRno)";
page.active$ = integration; colno = $(intno)+1;
col($(colno))[L]$ = "$(highWN)"+"-"+"$(lowWN)"+"%(comment$)";
loop(ii,2,$(IRno)) {
integ1 iy:= [%H]%(sheet$)!(col(A),col($(ii)))[$(highCN):$(lowCN)] baseline:=1;
jj= $(ii)-1; [%H]integration!cell($(jj),$(colno)) = $(integ1.area);
};
intno= $(intno) +1;
//END CODE
Regards, Phillip |
Edited by - Phillip T. on 08/30/2022 03:15:34 AM |
|
YimingChen
1623 Posts |
Posted - 08/30/2022 : 12:13:27 PM
|
Can you provide some sample data for us to test? I couldn't reproduce the issue. Thanks.
James |
|
|
Phillip T.
Germany
19 Posts |
|
YimingChen
1623 Posts |
Posted - 08/31/2022 : 09:26:15 AM
|
In the line below, are you sure highCN value is smaller than lowCN. Otherwise, the input range is falsely defined. integ1 iy:= [%H]%(sheet$)!(col(A),col($(ii)))[$(highCN):$(lowCN)] baseline:=1;
Second, can you remove [%H] in the line: [%H]integration!cell($(jj),$(colno)) = $(integ1.area);
James |
Edited by - YimingChen on 08/31/2022 09:30:34 AM |
|
|
Phillip T.
Germany
19 Posts |
Posted - 09/01/2022 : 05:01:08 AM
|
Ah right. The data in my other files was ordered the other way around
Thank you. |
|
|
|
Topic |
|