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
 Origin Forum
 Generate Spline data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

a.abc.b35

175 Posts

Posted - 08/06/2014 :  2:52:21 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8.5.1
Operating System: Windows 7

I am not sure how to achieve the following and your help in this regard will be much appreciated:

I want to subtract a spline baseline from a data-set. Let's say my original data is in two columns with long names: X-Original and Y-Original. Now I plot this data, and then using the Draw feature in Origin, draw a background data by clicking below the data points. Let's call the X, Y column of new draw-set as X-Draw and Y-Draw respectively. I would like to subtract the Draw data from the original data -- problem is the X-values are different!!!
I figured if I could access the internal parameters of the spline function for the Draw-data and then use the X-Original values for generating the Y-Background then I shall have background points at the same X as the original data and then i can subtract them easily.

Is there a way to do it in origin using the script window? say, having something like:

Y-Background=Use internal spline parameters on the spline data of Draw-data

Basically I want Y-background as the same spline function of the "X-draw vs. Y-draw" data but at X-positions of the "X-Original vs. Y-Original" dataset.

Can anyone please help me with that?
Thanks in advance.

AB

lkb0221

China
497 Posts

Posted - 08/06/2014 :  3:07:48 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

1). Plot a spline line plot by original X&Y.
2). Select the plot, right click and choose Create Spline Data.
3). Use Analysis: Mathematics: Interpolate/Extrapolate Y from X to get the spline value at each original X position.
4). Subtract it from original Y.

No script window way, I'm afraid.

Zheng
OriginLab

Edited by - lkb0221 on 08/06/2014 3:08:13 PM
Go to Top of Page

a.abc.b35

175 Posts

Posted - 08/06/2014 :  3:18:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I think I need to clarify -- I may have guided you in the wrong path. sorry about that.

I have a dataset with X-Original and Y-Original say. It's like an exponential decaying function but then it has got a hump in the middle. I do not want that hump (for whatever reason) and would love to replace that part with the smoothly varying function. But the data set is not exponential or any known function to begin with. So, I went to the method of "SPLINE". After plotting X-original vs. Y-Original, i DRAW a background function for the whole data range. The background is how the data should look like (say). My data is good for beginning and end part and only in the middle hump part, I would like to replace it with the SPLINE data.

Is that possible to do?

Below is a sample. i would like to get down the middle hump in Original data to the level of Draw background.



AB

Edited by - a.abc.b35 on 08/06/2014 3:27:37 PM
Go to Top of Page

lkb0221

China
497 Posts

Posted - 08/06/2014 :  3:52:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Then you just use Analysis: Mathematics: Interpolate/Extrapolate Y from X to get the points you want and replace the original ones by them.

Use data reader to read the points on the graph if you do not know the index range of that part.

Zheng
OriginLab
Go to Top of Page

a.abc.b35

175 Posts

Posted - 08/06/2014 :  4:12:12 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The x values for "Original" and "Draw" data are different!!!

AB
Go to Top of Page

lkb0221

China
497 Posts

Posted - 08/06/2014 :  4:15:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Or, you can try using the Create Baseline method of Peak Analyzer, by manually pick the anchor points.

Or, mask the hump range of your original curve and then do a interpolation on it.

Anyway, there are multiple ways to do the similar thing. Not sure which one fits you best.

Zheng
OriginLab
Go to Top of Page

lkb0221

China
497 Posts

Posted - 08/06/2014 :  4:19:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by a.abc.b35

The x values for "Original" and "Draw" data are different!!!

AB



That's why we use the Interpolate/Extrapolate Y from X function, to get Ys on the same X.
Go to Top of Page

a.abc.b35

175 Posts

Posted - 08/06/2014 :  4:46:08 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Cool.. got it now.. that interpolate/extrapolate y from X helped...will let you knwo when i completely figure this out.

AB
Go to Top of Page

a.abc.b35

175 Posts

Posted - 08/07/2014 :  11:56:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Works like a charm..Thanks a lot to both of you.

AB
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