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
 Origin Forum
 Quick Fit - Labtalk
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

vart3

6 Posts

Posted - 04/15/2016 :  6:36:26 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Origin 9.1 (64 Bits)
Operating System: Windows

I need to do a linear fit for several curves. I am using the quick fit gadget for this. The fit is done for the closest three points around the origin of the plot, but since the sampling is different for each curve, the sizes of the ROIs in each curve needs to be different to select only these three points in each curve.

I tried to merge all the curves after including the ROI in each independent plot window with the specific size to pick three points around the origin of the plot. The previously established ROIs and their sizes for each plot seems to be conserved in the new merged plot window. To take advantage of the batch processing I am using the "new output for all layers (L)" option. For this, I need to select the play button of one of the ROIs and it seems OriginPro is taking the size of ROI associated with the button I selected to fit all the curves, and not the independent ROIs as I am intending to do.

As I could not make by using this graphical approach, I wrote a script for this and I executed it in the Command Window with no success so far. The code I am using for this is shown as follows,


doc -ef LB


{


gadget gg = rect; //declare LT gadget variable
gg.output();


}


The fit is done for the the first plot but it stops after this and I getting an error saying:

GG:failed to add variable to local stack!

I would appreciate to read any advice you might have to take advantage at least partially (as I had to select the size of the ROI for each plot, in one-by-one manner) of the batch processing in this described scenario.

Thanks in advance for your answer.

Liamn

19 Posts

Posted - 04/17/2016 :  10:52:32 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, I think you need to change "doc -ef LB" to "doc -e LW" in your script.

By the way, you can also use the "Regional data selector" tool to select your ROI for each plot, and then use Linear Fit tool to perform fitting:
1. Plot all of your data into one graph.
2. Go to Data menu, you can see all data sets are listed in the end of the menu.
3. Make sure the 1st data set is selected (there is a tick mark in front), select the Regional data selector tool (the 7th button on Tools toolbar), drag a rectangle to include your 3 points around the origin. You can see 2 red vertical lines are added to the graph - you can double click on one of the lines to make further adjustments.
4. Go to Data menu and select your 2nd data set, and do step 3.
5. Repeat 3 and 4 to select all data sets.
6. Go to Analysis menu, select Fitting: Linear Fit to open dialog. Expand the Input Data branch to make sure all of your data sets are correctly selected. Click OK to perform fitting on all selected ranges.

I hope this works for you.

Edited by - Liamn on 04/20/2016 9:30:05 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