-
Notifications
You must be signed in to change notification settings - Fork 0
User Guide
.. rst-class:: headerbody-sup Using .. rst-class:: headerbody Spectral Analysis with OriginC |
Last Update: 19.03.2022 (v1.2.3)
This is an OriginC library providing several scripts for importing, handling, and evaluating spectroscopic data. No warranty is given for functionality or correctness, please verify all results generated with this script manually.
All methods have been tested with OriginPro 2021-2022; older program versions should be updated anyways.
Contents
-
Copy the file
build/Spectral Analysis.opxto a location on your computer. -
Run OriginPro.
-
Drag and drop
Spectral Analysis.opxinto OriginPro. The installation process will start automatically and add all required files to the User Folder Workspace.If any errors occur, the script will show a prompt. Please contact the script provider with the displayed error code.
-
All scripts will now be available after each start of OriginPro.
-
Open the Script Window.
(Window / Script Window or Shortcut Alt + Shift + 3)
-
Type the name of a script (see Methods) into the window and confirm with Enter.
(Each Enter inside the Script Window will be interpreted as a command call. If the current row does not contain a valid script name, an error will be printed.)
This package can easily be extended by other code modules.
See the Developer Guide and the Example Plugin code in the src directory.
If you need to debug the runtime of any function from this library or
your own, you can use the timer(string label) method.
-
Skipping the label parameter resets the timer without output:
timer(); // no output
-
To generate output, pass a descriptor to the label parameter:
timer("Transpose Sheet"); // output: "Transpose Sheet: 19 ms"
All callable methods can be looked up in the file main.c and do not
require any parameters to be passed when calling them.
Helper methods are in the header files ( *.h ) in the corresponding
subfolders. They can in principle also be called from the Script Window,
however, in this case the function parameters must be passed immediately.
Automates data import from a variety of sources. The import functions for spectra, 3D-maps and XY-λ-I data support pushing header lines to the OriginPro worksheet user parameters with the pseudo-syntax ParamName:{TAB}Value.
Parameter Description Target WorkbookName of the workbook to append the imported data to. If not set, will create a new workbook. Target WorksheetName of the worksheet to append the imported data to. If not set, will create a new worksheet. Data TypeThe source type of the data (see b). DelimiterThe column value delimiter of the source file (usually Tab, sometimes Whitespace). Dec. SeparatorThe decimal separator of the source file. Constant X-AxesIf checked, removes the X-columns of all imported files except the first. Create Sparklines?If checked, creates sparklines for all imported data columns. (Use with caution, creates heavy CPU load!)
Data Type Description Spectra FilesE.g., spectra from LabSpec or UVProbe. Imported file names will be written to the column comments. 3D-MapsE.g., time traces from LabSpec, peak maps from NT-MDT or Raman images generated with the Raman Live Tool Set. The file structure must be XY-I ... File names are used as worksheet names. XY-coordinates and other axes are written to the user parameters. 4D-MapsE.g., raw map data from NT-MDT (XY-λ-I ...). File names are used as worksheet names. XY-coordinates are written to the user parameters. Note that NT-MDT data must be exported from Image Analysis as a MATLAB file (*.m)! TracksXML-Files generated via ImageJ TrackMate containing particle tracking information. Metadata (e.g., time axis and XY-coordinates) are written to the user parameters.
Manipulates all datasets in a selectable worksheet of the active workbook. For each selected method, the results are stored in a new worksheet, which is then used as the data source worksheet for the subsequent correction method.
Parameter Description Data SourceDropdown field to select the source data worksheet. WorksheetDropdown field to select the reference data worksheet (only in selected methods). ParameterDropdown field to select the user parameter containing the reference data (in the current worksheet) or connecting the data and reference worksheets (only in selected methods).
Method Description Masked Data RemovalClears all cells of the source worksheet that have been masked (e.g., in a graph window) and fills them with mean values (averaging window: 10 data points). Background SubtractionSubtracts reference data from all datasets.
The Reference mode uses reference spectra connected via a selectable user parameter.
Parameters: Worksheet, Parameter
The Median mode uses the median value of the user defined spectral subregion.
Parameters: Start, Stop
The Constant mode uses a fixed value.
Parameters: Value
Spike RemovalAutomatically removes spikes from the worksheet. This method is based on the Whitaker-Hayer algorithm, see Chemolab 2018.
Parameters: Z-Threshold, Averaging Width
Setup CorrectionApplies a setup calibration curve to the source data by division. If no reference user label is selected, this method defaults to the first two columns of the reference worksheet.
Parameters: Worksheet, Parameter
Filter CorrectionCorrects the source data with a set of neutral density filter transmission curves by division. The transmission data of the filters must be absolute values.
Parameters: Worksheet, Parameter
Integration CorrectionDivides all datasets by the integration time provided in a user parameter of the source worksheet. The selected user label must only contain numerical data!
Parameters: Parameter
Jacobian TransformationPerforms a Jacobian Transformation to the energy space on all source datasets (Caution! Not to be used for PLE or absorption data.).
Parameters: none
NormalisationNormalises all source datasets by dividing them by their respective maximum value.
Parameters: none
Executes simple spectroscopic analytics on the current worksheet.
Parameter Description Dataset NameThe name that will appear in the long name of the result column in the evaluation sheet. MethodThe mathematical evaluation method to apply to the data. Skip Abscissae?If checked, does not generate new abscissa in the result sheet, e.g., if they have already been generated with the last run of the method. X-AbscissaThe name of the user label that holds the data representing the new X values of the evaluation result. Y-AbscissaSee X-Abscissa. If set to none, values in the result sheet will be assigned Y, if set, values will be assigned Z (e.g., for map analysis).X Start ValueThe lower bound of X values to evaluate; if 0, will default to the first data row. X Stop ValueThe upper bound of X values to evaluate; if 0, will default to the last data row.
Method Description Peak PositionFinds the point with the highest Y value in the given range. Mass CentreCalculates the centroid in the given range. Peak IntensityReturns the highest Y value in the given range. Peak AreaSummarizes all Y values in the given range (pseudo-area) Peak FWHMCalculates the full width at half maximum by finding the Peak Position Ymax in the given range and iterating to higher and lower X values until Y ≤ 0.5 × Ymax in both directions.
Transforms the datasets in the currently active worksheet to a different representation (e.g., generate 3D-Map from XYZ columns).
Parameter Description MethodDropdown field to select the data conversion method.
Method Description XYZ-Data to MatrixTransforms a Z dataset into an XYZ-Map. XY data can be extracted from the column designations or from user input. 4D-LinescanExtracts a line scan along one axis from an imported XY-λ-I map (e.g., from NT-MDT or LabView).
Interpolates all XY-datasets in the currently active worksheet onto a new X-axis. The new axis must be included in the same worksheet.
Parameter Description New X-AxisThe source column containing the new X-axis data.
Convenience method for peak fitting that collects a selected column from all PeakProperties* worksheets in the currently active workbook. The data are collected in a new sheet, transposed and some basic statistics (mean and standard deviation) are calculated. All results are auto-updated such that adjustments to individual fittings will directly be reflected.
Parameter Description NameThe dataset identifier used to name the result sheets. Target ColumnThe source column from the PeakProperties sheet.
Replaces all values in the active worksheet smaller than lowerBound with 0.
lowerBound defaults to 0 if omitted (all negative data are set to 0).
Parameter Description lowerBound (0)This parameter must be passed when calling the method, there is no user dialog.
Renames the Short Name field of all workbooks in the current folder based on their Long Names (e.g., to enable sorting in the Horiba Fluoressence software).
Reduces the project's CPU load by deleting (!) all sparklines in the project and hiding all windows.
.. rst-class:: footerbody-left © 2017-2022 Alexander Schmitz-Wunderlich, University of Duisburg-Essen |
.. rst-class:: footerbody-right ###Page### of ###Total### |