4.8.2 Batch Processing Multiple Files using Analysis Template


Video Image.png Video Text Image.png Website blog icon circle.png Blog Image 33x33px.png

Summary

Origin can perform Batch Analysis utilizing a previously-created Analysis Template, by either importing multiple files or loading existing datasets.
This tutorial covers importing multiple text files with a common file structure, then processing them one-by-one using an Analysis Template set up to perform linear curve fitting.

While not offering as many options as the Batch Processing tool, you can "clone" import and analysis operations in the active workbook, using the procedure outlined in this tutorial.

What You Will Learn

This tutorial will show you how to:

  • Make an analysis template which contains a Result Summary Sheet to collect the output of batch processing.
  • Perform batch processing with multiple data files using an analysis template

Steps

This tutorial is divided into two parts:

  1. Set up an Analysis Template. The template is an empty framework that includes a Summary sheet to collect the analysis output of batch processing operations.
  2. Perform the Batch Processing of multiple files using the previously-saved Analysis Template.

Preparing an Analysis Template containing a Result Summary Sheet

  1. Since batch operations work on similarly-structured data files, the first step is to import a typical data file. Create a new workbook and click Data: Connect to File: Text/CSV. Browse to <Origin EXE folder>\Samples\Curve Fitting\Sensor01.dat and choose the file. Accept CSV Import Options defaults and click OK to import your data.
  2. Now we'll perform a linear fit on the data. Highlight column B(Y) and choose Analysis: Fitting: Linear Fit. Set Recalculate = Auto and then click OK (note that by choosing Auto, we have assured that new input will trigger automatic recalculation of results). Answer Yes to the reminder message and open the FitLinear1 report sheet.
  3. We'll now add a Results sheet to our workbook where we will collect key statistics from our batch analysis. Go to FitLinear1 and next to the Summary table, click the downward-pointing arrow button and choose Create Copy as New Sheet. Click the Button Add New Columns.png button TWICE to add two new columns to your Summary sheet.
  4. We'd like to add Pearson's r value to our summary so return to FitLinear1, find the Statistics table, then click the caption beside the value and right-click and choose Copy. Go to Summary, right-click in the Parameters cell of column G(Y) and Paste Link. Copy the Pearson's r value and Paste Link into row 1 of column G(Y).
  5. We'll now add a data plot with fit curve to our summary sheet. Return to FitLinear1, scroll down to the Fitted Curves Plot, right-click on the plot and choose Copy. Return to the summary sheet and in row 1 of column H(Y), right-click and choose Paste Link. To the Long Name cell in this column, add Fitted Curve.
  6. To save the workbook as an Analysis Template, choose File: Save Workbook as Analysis Template, accept the default \User Files location and name the template as Sensor Analysis. Click Save.

Performing Batch Processing with Multiple Data Files

We'll now use our Analysis Template to batch process a number of data files and obtain summary output.

  1. Start a new project and choose File: Batch Processing... or click the Button Batch Processing.png button on the Standard toolbar.
  2. Set Batch Processing Mode = Load Analysis Template, then browse to your User Files folder and choose Sensor Analysis.ogwu.
  3. Set Data Source = Import from Files and use the browse button to the right of File List to <Origin EXE Folder>\Samples\Curve Fitting and add files Sensor02.dat through Sensor07.dat.
  4. Set Dataset Identifier = File Name to tag output in our Summary sheet with the source file name.
  5. Set Data Sheet = Sensor01 and Result Sheet to Summary.
  6. Check the Delete Intermediate Workbook (Note that since Origin 2018 you have the option of using the Open Book(s) button in the Summary sheet to regenerate individual intermediate workbooks, if needed).
    Tutorial BatchProcessing 007-2.PNG
  7. Click OK. All data files will be processed a Summary workbook generated to summarize analysis of each file.
    Tutorial BatchProcessing 007.png