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

TinaPLI

Germany
4 Posts

Posted - 02/20/2004 :  05:14:46 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello everybody;

I wrote a labtalk script to perform fits on an array of about 30x30 spectra, which works perfect with one exemption: For some spectra an error message number 28037 appears indicating that the initial parameter set is not appropriate. No problem, after the fit I set the parameters new if nlsf.cor is < 0.9 and repeat the fit until nlsf.cor is >0.9. How can I suppress the message box and forse the script to go on to the next command automatically. I do not want to hit 20 times the okay button as the script is suppose to run over night.

Who can help me, I would like to stay with lab talk for the moment.

Thanks
Martina

crusila part of the script:

nlsf.cleanupfitdata();
//nlsf.msgPrompt=0;
//nlsf.msgPrompt=2;
nlsf.fitData$ = %r_int$(l);
Zaehler=0;
repeat 15 {
zaehler=zaehler+2;
nlsf.simplex(400);
type %s;
nlsf.xmode = 2;
nlsf.funcx$ = %r_lambdac; //use as X dataset
nlsf.funccol$ = %r_fit$(l); //dataset to store fitted Y values
nlsf.makecurve(func); //dataset generated for the fitted curve
If (nlsf.cor > 0.9) {window -cd %h;
break;
}
NLSF.P2=720.0-12+Zaehler;
//NLSF.P3=1.27;
//NLSF.P4=6000;
}

Mike Buess

USA
3037 Posts

Posted - 02/20/2004 :  08:16:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Martina,

I see you commented out nlsf.msgprompt=0. Didn't that work?

Mike Buess
Origin WebRing Member
Go to Top of Page

TinaPLI

Germany
4 Posts

Posted - 02/24/2004 :  11:51:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
unfortunately not, the system claimed to be busy and I had to use the task manager to stop the program.
Tina

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/24/2004 :  1:51:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Tina,

You might try to trap the nlsf errors. The following modification to your script is probably just a start...

nlsf.cleanupfitdata();
nlsf.msgPrompt=0;
nlsf.fitData$ = %r_int$(l);
Zaehler=0;
repeat 15 {
zaehler=zaehler+2;
nlsf.simplex(400);
type %s;
if( nlsf.err ) {
type error $(nlsf.err);
break;
};
nlsf.xmode = 2;
nlsf.funcx$ = %r_lambdac; //use as X dataset
nlsf.funccol$ = %r_fit$(l); //dataset to store fitted Y values
nlsf.makecurve(func); //dataset generated for the fitted curve
if (nlsf.cor > 0.9) {
window -cd %h;
break;
}
NLSF.P2=720.0-12+Zaehler;
//NLSF.P3=1.27;
//NLSF.P4=6000;
}

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 02/24/2004 1:55:59 PM
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