The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 integ 1 deletes x values
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Phillip T.

Germany
19 Posts

Posted - 08/30/2022 :  03:14:54 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can you provide some sample data for us to test? I couldn't reproduce the issue. Thanks.

James
Go to Top of Page

Phillip T.

Germany
19 Posts

Posted - 08/31/2022 :  02:05:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sure here you go:

https://drive.google.com/drive/folders/1Vd74YV8hocm4zVbdAelmsT1ponWRu03C?usp=sharing

I imported all files into one sheet and deleted all X axis exept the first.
Go to Top of Page

YimingChen

1623 Posts

Posted - 08/31/2022 :  09:26:15 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Phillip T.

Germany
19 Posts

Posted - 09/01/2022 :  05:01:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ah right. The data in my other files was ordered the other way around

Thank you.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000