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
 fitting multipeaks Gauss
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bea-origin

Spain
2 Posts

Posted - 11/05/2002 :  10:07:11 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi!
I'm a beginner user of Origin LabTalk language.
I'm trying to fit two Gaussian peaks from one spectra. Afterwards I wanted to do it for a lot of spectra but first I have to check if I could do it only for one of them.
I use this script

nlsf.init(); // initialize fit
nlsf.func$=Gauss; // define function to be used during fitting
nlsf.fitData$=A02A1_b; // define data to be fitted
nlsf.numReplica=1; // implies 4 peaks
nlsf.p1=0; // initialize y0
nlsf.p2=280; // init xc1(center 1)
nlsf.p5=290; // init xc2 (center 2)
nlsf.funcX$=A02A1_a; // X data to be used to create fit dataset
nlsf.funcCol$=A02A1_c; // fit dataset;
loop(ii,1,2)
{
nlsf.p$(3*ii)=5; // initialize widths p3 (w1), p6 (w2), p9 (w3), and p12 (w4)
nlsf.p$((3*ii)+1)=50; // initialize Areas p4 (A1), p7 (A2), p10 (A4=3), and p13 (A4)
}
nlsf.fit(20); // perform 20 iterations
nlsf.end(); // report fit results to log and fit label

My spectra have a lot of points but I wanted to fit them in a range of them. How can I change the range to fit? I have tried yet with nslf.dataBegin and nslf.dataEnd and with nslf.xbegin and nslf.xend but it didn't work. I think I have to use the object limit but I didn't find the way. Could you help me?

Mike Buess

USA
3037 Posts

Posted - 11/05/2002 :  11:01:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You might try using the mks1 and mks2 system variables to mark the beginning and end of your fitting range. See this forum topic for details.

Mike Buess
Origin WebRing Member
Go to Top of Page

bea-origin

Spain
2 Posts

Posted - 11/05/2002 :  11:17:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike!
Thank you very much!
Now it works perfectly.

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