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

alex_eagle

Austria
36 Posts

Posted - 02/22/2002 :  06:50:59 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I am working on a script, which loads several spectra into a worksheet and fits the peaks with a gaussian/lorentzian function. But first I need to do a baseline correction for all of my spectra in the worksheet ! How is this done best with script ?

rtoomey

USA
184 Posts

Posted - 02/26/2002 :  11:18:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Origin's Baseline Tool (Tools:Baseline) allows one to create a baseline and then subtract it from the original data. I think the easiest way to accomplish your task would be to utilize the script which runs behind the scenes when these actions are being performed in the tool.

To explain, there are three baseline creation methods on the Baseline tab of the Baseline Tool. They are "Automatic", "User Defined Equation", and "Use Existing Dataset". When the Create Baseline** button is clicked, corresponding sections in Baseline.OGS are called. The sections are: [AutoBaseline], [UserDefined], and [ExistingDataset]. All three sections in turn call the [Create] section, which then calls the [Initialize] section.

There is also a button called "Subtract". When this button is clicked, the [Tab.BaseLn.Subtract.OnClick] section is run. This section in turn calls the [Initialize] and [CheckI] sections.

To customize these sections for your own use, here's what you might want to do:

  1. Decide which baseline creation method you would like to use.

  2. Open a new document in any text editor (e.g. Notepad).

  3. Copy the desired baseline creation method section to the text editor along with the Create, Initialize, Tab.BaseLn.Subtract.OnClick, and CheckI sections.

  4. Modify each section so that it works for you. This would include replacing all string and numeric variable initializations with your own. It might also involve renaming the sections to simpler names.

  5. Create a [Main] section which calls the baseline creation section and then the subtract section.

  6. Save the document as an OGS file in the Origin directory. You can then run the OGS file by executing the run.section(filename,sectionname) method, where the section name is MAIN.



If you have specific questions about this, it might be best to contact your local technical support representative in Austria. For contact information, go to:

http://www.originlab.com/www/services/europe.asp

I hope this information proves helpful.

- rtoomey




**Note: My response assumes you have Origin 6.1 or higher.


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