T O P I C R E V I E W |
a.abc.b35 |
Posted - 01/07/2011 : 6:22:51 PM Hi, I have 10 ASCII files,each with two columns : column1 and column2 (say). column1 is angle in degree and column2 is Intensity. I am able to import the data to a workbook with 10 worksheets. But now I want to do a bit more. 1)I want to convert the column1 to radians (i.e multiply column1 by a constant) and also add another column3 after column2 which will be sqrt(column2) and set as the error of column2. 2) If the above is done, than I want to plot the radians vs Intensity (converted column1 and column2 along with the error bars in column3) to 10 XY graphs. ... I am using the import wizard and there I see a option of including a origin c code. But I dont know how to write the code for the things I want to do. Can anyone help me please ?
AB |
3 L A T E S T R E P L I E S (Newest First) |
easwar |
Posted - 01/12/2011 : 11:39:29 AM Hi AB,
So you are using Origin C code to find and import the 10 files, and then your OC code uses an Import Wizard filter?
If you want to keep everything in OC, you could still use OC to import the raw data, and after the import is finished, use OC to manipulate the data by creating the new columns and deleting unwanted columns etc.
If you need more help contact tech support directly.
Easwar OriginLab |
a.abc.b35 |
Posted - 01/12/2011 : 03:05:08 AM Well, I am more comfortable with Origin C. Labtalk script, I just have no idea when it comes to right a little bit involved things. I have written a somewhat lengthy program in Origin C and my problem is solved partially. only problem is, my worksheets now have 5 columns instead of 3 .which, though not a problem,still eats up more memory. I have created a template and saved it. The template has 5 columns, last 3 of which is set to auto calculate by the formulas : x2 = pi/180* x1; y2 = y1; dy2 = sqrt(y2). Now the origin c code i wrote, it puts data in the 1st two columns,for each ASCII file, it creates a worksheet in the workbook, and does the math. But I dont think the code i worte is a efficient one and may be if you look at it, you can make it better. Would you like me to send the code to you ?
AB |
easwar |
Posted - 01/11/2011 : 10:21:18 AM Hi AB,
You can do this by writing some LabTalk script code on the Advanced Options page of the Import Wizard: http://originlab.com/www/helponline/Origin/en/UserGuide/Import_Wizard_Advanced_Options_Page.html
Then you can save the filter and use that filter to import multiple files, and at the end of each file import, the script will run to transform your data and plot the data. There are script functions such as plotxy to plot data, so you can look up scripting documentation for that. If you need further help post again or contact tech support.
Easwar OriginLab |
|
|