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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 masking data for nlsf fitting

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ChristianB Posted - 03/11/2009 : 1:39:56 PM
Origin Ver. and Service Release (Select Help-->About Origin): v7.0552 (B552)
Operating System:Windows XP

Hello.
I've got the following problem. I have got a dataset with a spectrum in each column. You can see the plot of one example spectrum in the graph "BeforeFitting" in the picture at the bottom.
I want to create a dataset, which only contains the dips, that you can see in the spectrum. Therefore i use a nonlinear least square fitting script, which you can see in the scriptwindow.
This works fine, without the lines

window -a DATA;                           //
worksheet -s 1 45 500 175;         // selektiert Range 
mark -w1 DATA;                      // maskiert Range


Which means i use the whole dataset for the gauss fit.

So far so good. But my data are not precise enough, because i include the data of those dips for the fit. This is, where those quoted lines come in. I use them to mask the range around those dips, so they are not used for the fit. But it seems like it works diffrent than when i manually use the gaussian fit from the "analysis" menu for a column with masked data. Because, if i use it manually for a column, it simply ignores those data for the fit, but the curve of the fit expands over the whole area, including the masked ones. In my script though, it seems as if this area is completely deleted. To illustrate this i have ploted the fitting data of the last fit in the graph "FITplot", where you can see the gap. As a result i can't create the dataset, that should show the dips.

So, what do i do wrong? Is there a problem in my script? How can i fix it? I simply want to mask those peaks for the fit...


1   L A T E S T    R E P L I E S    (Newest First)
ChristianB Posted - 03/11/2009 : 1:46:22 PM
I thought i'd better add the code of the fitting script in written form too, not just the picture....



DATA!wks.col(C1);
DATA!wks.insert(A);
worksheet -t $(1) 4;
col(A)=data(1,end-start+1,1);


window -n data FIT;  
FIT!wks.addcol(A);
worksheet -t $(1) 4;
FIT!wks.addcol(B);
col(A)=data(1,end-start+1,1);


for(j=1;j<=all;j+=1) {


nlsf.func$ = GaussAmp; 
//y0=0;
//xc=10;
//w=200;
//A=1;
nlsf.cleanupfitdata();
nlsf.fitdata$ = DATA_C$(j); 
nlsf.iterate(100); 
nlsf.funcx$ = DATA_A; //use as X dataset
nlsf.xmode = 2; 
nlsf.funccol$ = FIT_B;  //Store fitted y data
nlsf.makecurve(func);    //dataset generated for the fitted curve

DATA_C$(j)-=FIT_B;

};

window -cd;
delete DATA_A;

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000