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
 Batch import and interpolate (Origin Pro 8.5)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

amay60

USA
3 Posts

Posted - 08/02/2011 :  6:02:01 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have been using the import wizard (Origin Pro 8.5) to pull x and y columns of data from many ascii files. This works fine but I would like to automatically interpolate the data to make my data processing life easier. So I searched the help and forums then went to advanced options of the import wizard and put down several permutations of:

loop(n, 1,2){interp1xy iy:=Col(n) method:=spline npts:=1000 xmin:=30.2 xmax:=200};

This did not work. I would greatly appreciate any suggestions for getting this to work. Also I am not married to this approach, my ultimate goal is a spreadsheet full of evenly spaced y-axis data imported from many different files.

Sam Fang

293 Posts

Posted - 08/03/2011 :  04:01:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
X-Function interp1xy is used to generate interpolated Y data with specified uniformly-spaced X values. You can specify script in advanced options.

interp1xy iy:=Col(2) method:=spline npts:=1000 xmin:=30.2 xmax:=200 oy:=(<new>,<new>);


It will produce evenly spaced x values and interpolated Y values from x values.

Sam
OriginLab Technical Services
Go to Top of Page

amay60

USA
3 Posts

Posted - 08/03/2011 :  12:34:32 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sam, thank you for your reply. When using the script you gave me interpolated values of column 2 are placed after each data set. So that my spreadsheet looks like this:

X1 Y1 Interp1 X2 Y2 Interp1 X3 Y3 Interp1

I need it to interpolate the subsequent imports not just column 2. That is why I was trying to put it in a loop so that the iy:=Col(2) would change and interpolate the new data.
Go to Top of Page

Sam Fang

293 Posts

Posted - 08/03/2011 :  11:11:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Did each ASCII data file contains only two columns, and you choose "Start New Columns" as Import Mode in Source page?

You can select "run script after each file imported" in Advanced Options, it will loop and interpolate each imported file's column 2 automatically.

If I misunderstood your request, you can send a data file to us, and describe which columns to be interpolated.

To upload a file, click Send File to Tech support button in the forum's top right.

Thanks.

Sam
OriginLab Technical Services

Edited by - Sam Fang on 08/03/2011 11:12:01 PM
Go to Top of Page

amay60

USA
3 Posts

Posted - 08/04/2011 :  1:05:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sam, I have "run script after each file imported" selected and "Start New Columns" is selected as the Import Mode. Each ascii file has 4 columns but I am only importing the middle two, one x and one y.

I believe that Origin is considering column 2 as being from the Origin sheet and not the importing file (note that if I put iy:=Col(3) I get an error message on the first import and then it repeatedly interpolates Origin column 3).

I have sent three sample files via the web form. Thank you again for your time.
Go to Top of Page

Sam Fang

293 Posts

Posted - 08/04/2011 :  11:43:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for your sample data.

I have replied in the email.

Thanks.

Sam
OriginLab Technical Services
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