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
 LabTalk Forum
 Problems with subrange in peak finder
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

pblz

2 Posts

Posted - 12/07/2017 :  06:43:23 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: Origin Pro 2016 (64bit) SR 1
Operating System: Windows 7

Hello everyone,

I have measurements of a damped oscillation and try to extract the position of the maxima of each of the peaks with help of LabTalk. The data is simple XY and each measurement consists of 4000 rows and all the measurements are written below each other. So 1st [1:4000], 2nd [4003:8002], 3rd [8005:12004] etc. I have already written a script which works well for the individual measurements. My problem is that the subrange does not work. If I execute it for the 2nd measurement the results of the 1st part get deleted.

Script:
range aa = col(4)[1:4000];
range bb = col(2)[1:4000];
range cc = col(5)[1:4000];
range dd = col(6)[1:4000];
pkFind iy:=bb method:=max ocenter:=aa ocenter_x:=cc ocenter_y:=dd dir:=p npts:=10 filter:=num value:=10;

range aa = col(4)[4003:8002];
range bb = col(2)[4003:8002];
range cc = col(5)[4003:8002];
range dd = col(6)[4003:8002];
pkFind iy:=bb method:=max ocenter:=aa ocenter_x:=cc ocenter_y:=dd dir:=p npts:=10 filter:=num value:=10;

I am new to writing scripts so please do not laugh about it

I hope I could make my problem clear and am thankful for every help

yuki_wu

896 Posts

Posted - 12/08/2017 :  9:29:31 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Please take a look at this page:
https://www.originlab.com/doc/X-Function/ref/pkFind
You can find that the output type is a vector while the input type is an XY range, so we can only output the value to a whole column not just a part of the column.

I think you can output the value of these measurements to different sheets and then copy them to the range where you desired.

Hope it helps.

Regards,
Yuki
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