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
 Lorentz fit with 2 peaks in multiple curve fitting
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jeanne

France
1 Posts

Posted - 09/16/2003 :  6:13:31 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello!

I try to write a script to fit 400 graphs with the same fitting Lorentz function (2 peaks).
It works if I fit only one graph, but when I try to integrate the fitting routine in a loop it doesnt work anymore.

Can anybody help me?
Thank you in advance !!
Jeanne.

Here is the script:

for (ii=10;ii<32;ii ++)
{

window -n wks jeanne4_$(ii);# new worksheet;
worksheet -a 2;# init column;
open -w G:\home\AS $(ii) 001.txt;# file path;
window -r AS$(ii)001 LOR001$(ii);# rename

worksheet -t 1 4;# column 1= X;# X;
worksheet -n 2 intensity;# Y column name;

worksheet -s 2 0;# select column;
worksheet -p 201; # graph type;

# trace ;

window -r %H GRAS$(ii)001;# graph name;
window -i GRAS$(ii)001; #iconize it ;
window -a LOR001$(ii); #select ;
window -i LOR001$(ii);#iconize it;

#fit bilorentz;

nlsf.init(); // initialize the fit ;
nlsf.func$=Gauss; // define function to be used during fitting ;
nlsf.fitData$=LOR001$(ii)_intensity; // define data to be fitted;
nlsf.numReplica=1; // implies 2 peaks ;
nlsf.p1=150; // initialize y0 ;
nlsf.p2=-88; // init xc1(center 1) ;
nlsf.p5=88; // init xc2 (center 2) ;
nlsf.p3=18; // init w1;
nlsf.p6=23; // init w2;
nlsf.p4=5000; // init A1 ;
nlsf.p7=5000; // init A2 ;
nlsf.funcX$=LOR001$(ii)_a; // X data to be used to create fit dataset ;
nlsf.funcCol$=LOR001$(ii)_c; // fit dataset;

nlsf.fit(20); // perform 20 iterations ;
nlsf.end(); // report fit results to log and fit label;

};

I still have to do the following :

#PURPOSE: put the data in a array:;
#first colunm number of graph 1 to 400;
#2nd height pic1 Y0 en X0;
#3rd width half hight W0;
#4th area pic1 A0;
#5th height pic2 Y1 en X1;
#6th width half hight W1;
#7eme area pic2 A1;
#8eme height average Y3;
#9eme width half hight average W3;
#10eme area average A3;

Mike Buess

USA
3037 Posts

Posted - 09/26/2003 :  10:13:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jeanne,

I think you'll have to tell us where and how the script goes wrong. The script is fairly long and we need a clue about where to focus.

Mike Buess
Origin WebRing Member
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