| T O P I C R E V I E W |
| Dizzy |
Posted - 11/23/2004 : 05:14:51 AM Origin Version (Select Help-->About Origin): 6.0 (maybe 7.0 or 7.5 is available soon) Operating System: Win XP SP2 Hi! Iīm completely new to programming and would like to learn how to import, fit and afterwards display the data of the fit (parameter) with Labtalk or Origin C. I have a series of 300 data files. It will be convenient to fit automatically instead of fitting by hand. This is a temperature series of one sample excited by Laser, so the fits are either gauss, lorentz or voigt in the whole series. Also I may need to extract data first depending on the shape of the spectra the samples emit. These can be two peaks or more and they have to be fitted seperately. All this seems too difficult to be done by a newbie. Please help - thanks a lot... Best regards Tom |
| 6 L A T E S T R E P L I E S (Newest First) |
| Dizzy |
Posted - 12/02/2004 : 05:03:22 AM Hi all, here is another problem: As I sometimes need to see the quality of the fits, a graph with the data and corresponding fitcurve would be helpful. The Origin-help says that nlsf command produces a graph, but in the loop only one graph with all fitcurves is created. So how can it be changed that every data with its corresponding fitcurve is shown in their own graphwindow? I wonder why this isnīt done automatically.
for (test=2; test<=%(data2,@#); test++){ %A=data2!wks.col$(test).label$; Result2_a[test-1]="%A"; nlsf.begin(); nlsf.func$="gauss"; nlsf.fitdata$=%(data2,test); nlsf.x$="data2_A"; nlsf.constr$=""; nlsf.p1=100; nlsf.p2=3.7; nlsf.p3=0.02; nlsf.p4=780; nlsf.tolerance=0; nlsf.fit(15); Result2_b[test-1]=nlsf.p4; Result2_c[test-1]=nlsf.p3; nlsf.end(); }
Thanks for any idea... Tom |
| Dizzy |
Posted - 11/29/2004 : 04:41:03 AM Hi Mike, thanks for helping a "blind" man  Some how I get confused when I consider all help files including *.chm downloaded from Origin-homepage. All the Information on LabTalk are a bit scattered on many files. OK now I found all I need.
Thanks
Tom |
| Mike Buess |
Posted - 11/26/2004 : 08:11:49 AM Hi Tom,
Don't know where you found that script but you missed the part that created the output worksheet. The script expects it to exist and gives an error when it can't be found. Go back to where you found the script and find out where and how a worksheet called output was created.
The nlsf object is Origin's curve fitting tool...
LabTalk Help->Object Reference->Alphabetical Listing->NLSF
Mike Buess Origin WebRing Member |
| Dizzy |
Posted - 11/26/2004 : 06:58:05 AM Thanks for your replies. I found a script for fitting, but canīt get it to run on my needs.
for (test=2; test<=%(SPECTRA,@#); test++){ %A=SPECTRA!wks.col$(test).label$; output_ps[test-1]="%A"; nlsf.begin(); nlsf.func$="gauss"; nlsf.setDepend(y,%(SPECTRA,test)); nlsf.x$="SPECTRA_A"; nlsf.constr$=""; nlsf.p1=4025; nlsf.p2=429; nlsf.p3=6.8; nlsf.p4=40618; nlsf.tolerance=0; nlsf.fit(150); output_peak[test-1]=nlsf.p2; output_error[test-1]=nlsf.e2; nlsf.end(); }
The lines with "output_..." give me the message, that a column name cannot be blank. When delete these lines it works good on one column. How can I get an output now where all the parameter are stored into a worksheet? When I saw this first, I wondered where to find the syntax like "nlsf.begin()" and similar. In the labtalk.chm is nothing. Also this "output..." command wasnīt there. What is @#? Where can I look it up?
Did I overlook some information?
Thanks
Tom |
| greg |
Posted - 11/23/2004 : 11:39:01 AM Check out the BATCH.OGS file found in your BUTTONS folder.
Open the Script Window and enter
run.section(%YButtons\batch,main)
(Origin 7.5 users : %A = system.path.program$; run.section(%AButtons\batch,main); }
|
| easwar |
Posted - 11/23/2004 : 11:16:17 AM Hi Tom,
So what you are looking for is code that will handle importing of multiple data files, extracting sections of the data such as identifying multiple peaks in the data, then fitting with specific nonlinear functions, and then generating a table of fit parameters for all the files imported...this is quite a bit of code to be able to discss on the forum.
There are many code segments that touch upon some of these areas in the LabTalk and Origin C forums that you may want to search for and try to adopt to your needs. You could then post specific questions.
I also want to point out that our distributor in Germany can help by providing custom code on a consulting basis to you. You may want to contact them and discuss.
Looks like your tasks will be easier to implement with version 7.5 where the import wizard feature can be used and programmed to perform custom analysis at the end of each import.
Easwar OriginLab
|