27.3 Batch Processing
See more related video:Batch Processing, Batch Processing of Peak Data using Theme
Contents
- 1 The Batch Processing Dialog Box
- 2 Examples
- 2.1 Example 1: Import .DAT files and perform nonlinear curve fitting
- 2.2 Example 2: Perform batch analysis on groups of CSV files
- 2.3 Example 3: Perform batch analysis and create reports using a custom MS Word template
- 2.4 Example 4: Perform batch processing on worksheets in your project file
- 2.5 Example 5: Perform batch processing on datasets grouped by worksheet column
The Batch Processing tool allows you to perform repeat analysis on multiple datasets using an existing Analysis Template and optionally output analyzed results to a Word Template for reporting. You can process multiple data files from disk, or loop over data already in your project.
To create an Analysis Template, perform an operation (e.g., curve fitting) and set Recalculate to Auto or Manual. You can optionally add a Result Sheet, which contains paste-linked results (e.g., the file name, or a subset of values from the parameter table generated by a curve fitting) from the analysis operation. You can then use the Batch Processing tool to create a Summary Report compiling Result Sheet data from multiple files or datasets.
Optionally you can choose to output analyzed results directly into a Word/PDF file using bookmarks in a Word template. The bookmarks in a Word template can only be utilized when added to a specified analysis template using Add Word Bookmarks to Analysis Template dialog. An additional Bookmarks worksheet will be automatically generated to store the bookmarks, analysis results cell-linked from the analysis report and sizes of graphs to be exported.
When the tool is used to process multiple disk files, the import settings (e.g., custom ASCII settings, or filter settings from the Import Wizard) can be saved as part of the Analysis Template. Variables extracted while importing can be paste-linked into the Result Sheet, and this information will then appear in the Summary report create by the Batch Processing tool.
The Analysis Template can include:
- The Raw Data worksheet.
- The Analysis Report worksheet. These are report sheets generated by analysis procedures (e.g., nonlinear fitting).
- An optional Result Sheet containing analysis results cell-linked from the analysis report, and import variables, such as the file name or any parameters extracted from the file header.
- An optional Bookmarks worksheet automatically generated when adding bookmarks from a Word template to the analysis template. The Bookmarks worksheet contains a Bookmarks column to store bookmarks from the Word template, a Links column to store analysis results cell-linked from the analysis report and a GraphWidth column to adjust the size of graphs to be exported to word/pdf files.
After completing all desired settings in the Batch Processing dialog and click OK, every setting except Batch Processing Mode and contents in File list will be saved into the analysis template for future use. For Batch Processing Mode set to Repeatedly Import into Active Window, the analysis template will be saved to UFF by default. For Batch Processing Mode set to Load Analysis Template, it will update the original template (in this case the analysis template should not be in Origin installation folder or subfolder, otherwise it will be saved to UFF).
Note:
|
While not as flexible or powerful as the Batch Processing, you can "clone" import and analysis operations in the active workbook, using the procedure outlined in this tutorial. |
The Batch Processing Dialog Box
To open, click File, and then click Batch Processing.
| Batch Processing Mode | Specifies how to perform batch processing.
| |
|---|---|---|
| Analysis Template | Available when Batch Processing Mode is set to Load Analysis Template. Use this to specify the analysis template for the batch processing. | |
| Export to | Only available when active/loaded analysis template contains a sheet named Bookmarks. Use this option to specify which file type the analysis report to be exported, options are:
| |
| Word Template | Only available when active/loaded analysis template contains a sheet named Bookmarks. Use this option to specify the Word template for reporting the batch analysis results. | |
| Export Path | Only available when active/loaded analysis template contains a sheet named Bookmarks. Use this option to specify where to export batch analyzed results using bookmarks in a Word template. Note the Word and PDF files will be exported to same location. | |
| Export as multi-page File |
Check this box to combine all PDF or Word files into a single file. | |
| Data Source | Data source can be
| |
| Use Import Setting in Workbook | Only available when Data Source is Import Specified Files. Specify whether to use the last data import settings. | |
| File List | Available when Import Specified Files is used. Select data files for batch processing. *.dat, *.txt, *.csv, *.xls, *.xlsx, *.xlsm files are supported.
Beginning with Origin 2018b, you can embed matrices in workbooks, including Analysis Templates and these matrices can supply the source data that drive your batch analysis. Because matrices can store data or images, you can import data files (*.dat, *.txt, etc.) to a matrix that is set to display in data mode or image mode; or you can import image files (*.jpg, *.tif, etc.). You can import files into matrices in either Batch Processing Mode. | |
| Folder | Available when Data Source is Import All Files from Folder. Specify the folder for the imported files. | |
| File Extension | Available when Data Source is Import All Files from Folder. Specify the extension for the imported files. It supports multiple extensions separated by semicolon.
For example: *.dat*; *.csv* | |
| Input | Available when Data Source is set to Use Existing XY(Z) Datasets. Specify the XY(Z) Range for analysis from anywhere in the project, such as the current sheet, current book, or any selection performed with the Dataset Browser tool. (To access the Dataset Browser tool, click the arrow to the right of Input , and then click Select Columns... ) | |
| Worksheets | Available when Data Source is set to Use Existing Worksheets. Click the rightward-pointing arrow to filter by Sheets in Book, Sheets in Folder, Sheets in Folder(Recursive) or Sheets in Project. Alternately, you can choose Select Worksheets to open the Sheet Browser. Reset will clear the selection window. | |
| Fixed Range | Available when Data Source is set to Use Existing Ranges. Specify the fixed ranges which will just be copied to the corresponding columns in the data sheet of template but do not take part in calculation during each processing loop. | |
| Batch Range | Available when Data Source is set to Use Existing Ranges. Specify the batch ranges which are used as input for the calculation during batch processing. | |
| Dataset Identifier | Specify whether to add a column with the Long Name "Dataset" to the Result Worksheet for identifying each analysis dataset.
| |
| Designation | This control is added when you set Dataset Identifier to a displayed Column Label Row in the Analysis Template (not available when Mode = Repeatedly Import... and Source = Import Specified Files or Import All Files from Folder).
Use to specify which column supplies the dataset identifier. Default <auto> uses the current setting. | |
| Data Sheet(s) | Specify the name of the sheet in the Analysis Template into which the raw data should be imported. If there are multiple data sheets in the Template, option <auto> should be selected so that grouped files can be imported sequentially into corresponding data sheets. Furthermore, there is another option <custom> which can be used to add and remove the data sheets found by the default option <Auto>.
Files can be sorted by Name, Size or Date by clicking column headings in the lower panel of the Open dialog, when selecting files to import (under Data Source). Note that you can save import settings, such as custom ASCII import settings or Import Wizard filters, to the data sheet in your Analysis Template. See saving ASCII settings and Save Filters page for more details. | |
| Result Sheet | Specify a Result Sheet (optional) in the Analysis Template, to contain the information you want to summarize for each dataset or file processed by the Batch Processing tool. When Result Sheet is <none>, Data Identifier is disabled. | |
| Output Sheet | Content from the Result Sheet will be appended to the Output Sheet specified in this field:
When Result Sheet is <none>, Output Sheet is unavailable.
| |
| Delete Intermediate Workbook |
Specify whether to delete the intermediate analysis outputs after the process. See the "Note" under Output Sheet, above. | |
| Options | Including:
| |
| Script | Including:
|
Examples
Example 1: Import .DAT files and perform nonlinear curve fitting
In this example, we will import three .dat files and perform a nonlinear curve fitting.
- On the main menu, click File, and then click Batch Processing... to open the Batch Processing dialog.
- Make sure Load Analysis Template is selected. Click the
button to the right of Analysis Template. Navigate to the Origin installation folder, and then \ Samples\ Curve Fitting to select Linear Regression.ogw. - Make sure Data Source is set to Import From Files. Click the
button to the right of File List, and then navigate to \ Samples\ Curve Fitting to add Sensor01.dat, Sensor02.dat, and Sensor03.dat. Set the remaining dialog values as in the image below:
- Click OK to process the three .dat files and output statistics to a Result Sheet.
Example 2: Perform batch analysis on groups of CSV files
This Tutorial illustrates how to perform batch analysis on grouped datasets using an analysis template with multiple data sheets.
Example 3: Perform batch analysis and create reports using a custom MS Word template
This tutorial illustrates how to perform batch analysis with Word template for reporting.
Example 4: Perform batch processing on worksheets in your project file
If you have already imported source data into multiple worksheets in the project, or you want to perform batch processing on multiple worksheets which are the intermediate results of pre-processing, Data Source = Use Existing Worksheets is used. The following example shows you how to perform batch processing on mulitple worksheets.
We use Excel file HouseholdCareSamples.xls under folder <Origin installation folder>\Origin2018\Samples\Statistics\ in this example. The Excel file contains multiple worksheets, each has the cleaning product stocks of a super market. We are going to calculate stocks of different kinds of every market and summarize them in a result sheet.
We need to prepare the analysis template first
- Select Data: Import from File: Excel(XLS, XLSX, XLSM)... from the main menu. Specify as follow and click OK
- Browse and select <Origin installation folder>\Origin2018\Samples\Statistics\HouseholdCareSamples.xls for File Name.
- Expand File Info: File Sheet(s) and select only HQ Family Mart to import the first sheet of the file.
- Expand Header Lines branch. Set Number of Subheader Lindes to 1 and Long Names to 1 to set the first line as Long Name,
- With the imported HQ Family Mart worksheet active, highlight col("Number") and select Statistics: Descriptive Statistics: Statistics on Columns. In the dialog that opens, specify as follow and click OK.
- On the Input tab, select column E(Y): Category for Group,
- On the Quantities tab, make sure N total, Sum, Minimum, Median and Maximum are checked and uncheck Mean and Standard Deviation.
- The DescStatsQuantities worksheet is the result sheet we want. Rename it to StatsResult'. And rename HQ Family Mart worksheet to Data. Right click on the title bar of the workbook window and select Sav as Analysis Template to save it to MyDesStats.ogwu.
We can then import the whole Excel file and perform batch processing.
- Select Data: Import from File: Excel(XLS, XLSX, XLSM)... from the main menu to import file <Origin installation folder>\Origin2018\Samples\Statistics\HouseholdCareSamples.xls. Specify as follow and click OK.
- Set Multi-File (except 1st) Import Mode to Start New Sheets, *Expand Header Lines branch. Set Number of Subheader Lindes to 1 and Long Names to 1,
- check Apply Header to All Sheets.
- With the imported workbook active, select File: Batch Processing... from the main menu to open the Batch Processing dialog.
- Make sure Load Analysis Template is selected. Click
button to the right of Analysis Template, and then select the analysis template we saved in the previous steps.
- Change Data Source to Use Existing Worksheets. Click the triangle button of Worksheet and select Sheets in Book from the fly-out menu to add all sheets.
- Set Dataset Identifier to Sheet Name, Data Sheet(s) to Data and Result Sheet to StatsResult. Click OK to process the 9 sheets and output statistics to a Result Sheet.
Example 5: Perform batch processing on datasets grouped by worksheet column
Select Help:Origin Central - Analysis Samples tab, set Samples in to Batch Processing, and then click Batch Processing Grouping Columns to see an example of how to use multiple ranges with grouping info as input to perform batch statistics.




