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
 syntax using Integ1 with baseline
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Nilsdalby

Denmark
23 Posts

Posted - 03/16/2016 :  12:55:39 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin 2015 SR2 on a win 7 platform

Hi Im running a script to determine FWHM of Peaks from many columns (one peak per col). Im in doubt of the syntax to use for a single column. I wish to use a straight horizontal baseline and the syntax could be something like:

integ1 iy=col(2)[i1:i2] baseline:=1;

Questions:

1) Is it possible to extrapolate the baseline, knowing its horizontal ? That is, i1 is known, i2 is not.
2) I wish to redirect the resulting FWHM, integ.dx or dx, to a cell, is there a special syntax for this?

Thanks, Nils

Edited by - Nilsdalby on 03/16/2016 1:52:23 PM

SeanMao

China
288 Posts

Posted - 03/16/2016 :  11:38:31 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Please see the script below:


// end will denote data till the end
integ1 iy:=col(2)[5:end] type:=abs x0:=xcenter dx:=FWHM;

// You can store output as variables
wks.ncols=5;
col(4)[L]$="Peak Center";
col(4)[1]=xcenter;
col(5)[L]$="FWHM";
col(5)[1]=FWHM;



Regards!

Sean

OriginLab Tech.

Edited by - SeanMao on 03/16/2016 11:39:06 PM
Go to Top of Page

Nilsdalby

Denmark
23 Posts

Posted - 03/17/2016 :  05:44:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Sean

Many thanks for looking into this. Your code work (ofcourse), but i didnt explain the the problem very well, so ive included a graph below. This is a typical trace, and its the FWHM of the peak between i1 and i2 that is of interest, hence this part should be limited by the horizontal baseline. i1 and the Y-value of the baseline are known, i2 varies for all traces and is unknown. Extrapolating baseline to the end gives a wrong FWHM, i need the intersection of graph and baseline. I can find i2 by use of the treplace threshold function but this is not entirely unproblematic as the trace is not monotonic. Is it possible to include the baseline intersection with the graph in the syntax for integ1, without specifically calculating i2 ?
Thanks in advance

Edited by - Nilsdalby on 03/17/2016 06:17:15 AM
Go to Top of Page

SeanMao

China
288 Posts

Posted - 03/18/2016 :  03:34:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Currently this is not supported since the number of intersection points could be more than 2.

We do have another X function levelcrossing can help you easily obtain the X coordinate crossing the given level:

http://www.originlab.com/doc/X-Function/ref/levelcrossing

Give this a try and see how it goes!

Regards!

Sean
Go to Top of Page

Nilsdalby

Denmark
23 Posts

Posted - 03/18/2016 :  05:24:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ahh, havent seen that function but it is going to be my new favorite X-function, works beautifully, many thanks
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