Author |
Topic  |
|
alex_eagle
Austria
36 Posts |
Posted - 02/22/2002 : 06:50:59 AM
|
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
|
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:
- Decide which baseline creation method you would like to use.
- Open a new document in any text editor (e.g. Notepad).
- Copy the desired baseline creation method section to the text editor along with the Create, Initialize, Tab.BaseLn.Subtract.OnClick, and CheckI sections.
- 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.
- Create a [Main] section which calls the baseline creation section and then the subtract section.
- 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.
|
 |
|
|
Topic  |
|
|
|