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
 Remove background at fixed anchor points : Labtalk
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Nico_22

United Kingdom
2 Posts

Posted - 08/22/2014 :  04:37:58 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 9.0 and Service Release SR1b76
Operating System: Win 8.1

Hi everyone,

My problem is the following:
I have plots with peaks and background that I would like to fit with a routine script. The peaks are always more or less at the same position and I found how to fit them. My main problem is to remove the background that changes from one plot to another.
I would like to fit that background at given anchor points (between the peaks) and then remove it. I tried the blauto function but this one do not allow me to choose the anchor points. I would like to set a vector of let's say 10 values that are the position along the X axis where the background has to be evaluated. Then interpolate that background with spline ideally and finally remove it on my plot to fit the peaks.
Do you have any idea how to do that?

I hope this explanation is clear.

Thank you very much in advance for your help,

Best ,

Nico

jasonzhao

China
262 Posts

Posted - 08/25/2014 :  04:19:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Nico,

Please see the following examples which shown the way of:
1. create the spline with anchor points
2. interpolate and connect the spline
3. subtract the baseline(spline) from the original data

for(int i=2;i<5;i++)
{
spline ix:=1!Col(5) iy:=1!(Col(1), Col($(i))) ox:=2!<new>;  
//Col(5) is X for anchor points, create the Y values for anchor points by spline 
interp1 ix:=1!Col(1) iy:=(1!Col(5), 2!Col($(i-1))) ox:=3!<new>; 
//bridge the anchor point to baseine, using original X as baseline X  
range a1=1!Col($(i));
range a2=3!Col($(i-1));   // substract the curve by baseline.
a1=a1-a2;
};




Best regards,
Jason Zhao
OriginLab Tech Service
Go to Top of Page

Nico_22

United Kingdom
2 Posts

Posted - 08/26/2014 :  05:09:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jason,

thank you very much, this works perfectly!

Just to make sure because I wasn't, the values in the Anchor X column (column5) are the proper values of X (wavelength here) and not the index of the row giving wavelength values in column 1 in that example.

Best regards,

Nicolas
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 08/27/2014 :  03:02:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Nicolas,

Yes, the values in the Anchor X column are the values of X (wavelength).

Best regards,
Jason Zhao
OriginLab Tech Service

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