APE Matlab Scripts

The following Matlab commands are available with installed APE Toolkit:
Overview of all APE components
% [ EC ] = APEaddDose(datasetname, doseIn) % % allows to add a new variable containing X-ray dose received by % the sample. most usefull for kinetic data. % % INPUT datasetname : .mat file to process % [doseIn] : avoid GUI and enter dose directly for % single spectrum [optional] % % OUTPUT EC : Error Code (0 = OK, 1 = Error) % (c) F. Dworkowski, 2012 % Version 1.0, 2012-03-19
%[ EC ] = APEanimateAVI( anidatax, anidatay, framerate, outname ) % % Script to animate kinetic datasets to an AVI video file % % INPUT anidatax : X data for animation % anidatay : Y data for animation % outname : filename for AVI % frmrate : frames per second of AVI ([30]) % qulity : Quality in percent ([75]) % includeaxis : 0 = only plot area % [1]= include Axis etc. % % OUTPUT EC : error code (0 = success, 1 = error) % % (c) F. Dworkowski, 2011 % Version 1.0, 2011-09-26
% [ EC ] = APEbatchALS(lambda, p, itter) % % Script to batch-convert all .sif files in one folder to APE-.mat format % as well as to CSV or Excel % % INPUT lambda : Lambda paramter of ALS routine (def= 10000) % (opt.) p : p paramter of ALS routine (def= 0.01) % itter : Itterations (def= 10) % % OUTPUT EC : error code (0 = success, 1 = error) % % (c) F. Dworkowski, 2011 % Version 1.1, 2011-08-02
% generates overviews for all files in chosen folder using % APEgenerateoverview
% [ EC ] = APEbatchloadsif( savetype ) % % Script to batch-convert all .sif files in one folder to APE-.mat format % as well as to CSV or Excel % % INPUT savetype : 0 = only .mat % 1 = .mat & CSV % 2 = .mat & Excel (.xls) % % OUTPUT EC : error code (0 = success, 1 = error) % % (c) F. Dworkowski, 2011 % Version 1.0, 2011-07-20
% [ EC ] = APEbatchramanshift( exwavelength ) % % Converts the raw datax in datasetname from assumed wavelength in nm to % Raman shift in cm^-^1 using the Laser Excitation Wavelength % exwavelength in nm. % The result will be saved in the same file as ramandatax. % % INPUT exwavelength : Laser excitation wavelength in nm % % OUTPUT EC : Error Code. (0=success, 1=error) % DEPENDENCIES - ramanshift.m % (c) F. Dworkowski, 2012 % Version 1.1, 2012-03-20
% [ EC ] = APEcombinedatasets( ) % % Allows for semi-interactive combination of APE datasets into a single % file. % ATTENTION: % Not robust! User has to make sure beforehand that all datafiles % intended to be combined have the same X- and Y-content and -scale !! % % OUTPUT EC : Error Code (0 = OK, 1 = Error) % (c) F. Dworkowski, 2011 % Version 1.0, 2011-07-27
%[ Energy_Joule, Energy_eV, Wavelength, Wavenumber, Frequency ] = ... % APEconvert( inputvalue, inputtype ) % % APEconvert converts between Energy (in eV), Wavelength (in nm), % Wavenumber (in cm^-1) and Frequency (in Hz). % % INPUT inputvalue : Value to convert (see above) % inputtype : Identity of inputvalue % 'en' = Energy (in eV) % 'ej' = Energy (in Joule) % 'wl' = Wavelength (in nm) % 'wn' = Wavenumber (in cm^-1) % 'fq' = Frequency (in Hz) % % OUTPUT Energy_Joule : in Joule % Energy_eV : in eV % Wavelength : in nm % Wavenumber : in 1/cm % Frequency : in Hz % (c) F. Dworkowski, 2011 % Version 1.0, 2011-07-29
%[ EC ] = APEextractspectrum( datasetname, framenumber ) % % Extracts a single Spectrum from a Kinetic time series and saves it to a % new .mat file, conserving all additional information present. % % INPUT datasetname : File name of source % framenumber : Index of the spectrum to extract % % OUTPUT EC : Error Code. (0=success, 1=error) % DEPENDENCIES - % (c) F. Dworkowski, 2011 % Version 1.0, 2011-08-05
%[ EC ] = APEfullshebang(exwave, batchfullfolder, outtype, slicewave) % % Process a SIF file completly and produces a PDF report in a % subdirectory of the data folder % % INPUT exwave : wavelenght of Raman laser. Use 0 for % non-raman data. % batchfullfolder : [0] = process single file % 1 = process all files in folder % outtype : sets the type of file to convert to. % 1 or 'csv' = comma seperated value (*.csv) % [2] or 'tsv' = TAB seperated value (*.asc) % 3 or 'ssv' = SPACE seperated value (*.asc) % 4 or 'xls' = Excel file (*.xls) % slicewave : wavelenght at which to slice kinetic data. % Use 0 for non-kinetic data. Multiple % wavelength can be entered [300 420 500]. % % OUTPUT EC : error code (0 = success, 1 = error) % % EXAMPLE: process all files in one folder with a determined Laser % wavelength (=> see RaCaTo) of 404.8nm and CSV output: % [!! All files in folder must be of Raman type!!] % % > APEfullshebang(404.8, 1, 0, 1)
%[ EC ] = APEgenerateoverview( datasetname ) % % Generate overview and savees as PDF % Contain following plots and informations: % 1) Filename % 2) RAW data % 3) Ramanshifted Data % 4) ALS corrected Data % 5) Footer conversion parameters % % INPUT datasetname : filename of APE-MAT file to process % % OUTPUT EC : error code (0 = success, 1 = error) % (c) F. Dworkowski, 2011 % Version 1.0, 2011-09-26
%[ EC, tictoctime ] = APEmat2asc( filename, outtype) % % APEmat2asc converts APE MAT files to comma seperated value (CSV), tab % seperated value (TSV), space seperated value (SSV) or even Excel type % (xls) files. % Converted files will be saved in the same folder as the source. % % !!!! ATTENTION: if files are already present they will be overwriten % without warning !!!! % % INPUT filename : name of file to convert with full path. MUST be % in APE MAT format (i.e. produced with the % SLS APE toolkit). % outtype : sets the type of file to convert to. % 1 or 'csv' = comma seperated value (*.csv) % 2 or 'tsv' = TAB seperated value (*.asc) % 3 or 'ssv' = SPACE seperated value (*.asc) % 4 or 'xls' = Excel file (*.xls) % --> DEFAULT is 'csv' % % OUTPUT EC : Error Code.(0 = success, 1 = error) % tictoctime : time in second to perform conversion % (c) F. Dworkowski, 2011 % Version 1.0, 2011-07-25
% [maxtab, mintab]=APEpeakdet(datax, datay, delta, minmax) % % Detects peaks (minima) in datay and plots datax vs datay with annotated % peaks (minima). Also puts out Vectors for peaks (minima). % % INPUT datax : dependend data or Index % datay : Signal % delta : detection threashold % minmax : sets detection; % [1] = peaks (maxima only) % 2 = minima only % 3 = both % % OUTPUT maxtab : [i-by-2] vector containing index and value of maxima % mintab : [i-by-2] vector containing index and value of minima % (c) F. Dworkowski, 2011 % Version 1.0, 2011-10-05
%[ convresult ] = APEraman2lambda( val2conv, valtype, laserWL ) % % Convert Raman shift to wavelenght or vise versa % % INPUT val2conv : Value to convert % valtype : Type of val2conv: % 'r' = Raman shift (-> conv. to wavelength (nm)) % 'w' = Wavelength (-> conv. to Raman shift (cm^-1)) % laserWL : Wavelength of ex. Laser (in nm) % % OUPUT convresult : Result of the performed conversion. % (c) F. Dworkowski, 2011 % Version 1.0
% [ EC ] = APEramanshift( datasetname, exwavelength ) % % Converts the raw datax in datasetname from assumed wavelength in nm to % Raman shift in cm^-^1 using the Laser Excitation Wavelength % exwavelength in nm. % The result will be saved in the same file as ramandatax. % % INPUT datasetname : file name to process % exwavelength : Laser excitation wavelength in nm % % OUTPUT EC : Error Code. (0=success, 1=error) % DEPENDENCIES - ramanshift.m % (c) F. Dworkowski, 2011 % Version 1.0, 2011-07-28
[ EC ] = APEreducedata( datasetname, framenumber, inputtype , alongaxis) Extracts a single Spectrum from a Kinetic time series and saves it to a new .mat file, conserving all additional information present. INPUT datasetname : File name of source frames : [start:end] inputtype : Start and End frames are given as data values instead of frame index 'raman' = Ramanshift 'wave' = Wavelength 'counts'= Y signal 'ALS' = ALS corrected Y signal alongaxis : 'x' = reduce Data along X (datax), otherwise along Y (datay) OUTPUT EC : Error Code. (0=success, 1=error)
% [ EC ] = APEsingleALS(lambda, p, itter) % % Script to convert single .sif file into APE-.mat format as well as to % CSV or Excel % % INPUT lambda : Lambda paramter of ALS routine (def= 10000) % (opt.) p : p paramter of ALS routine (def= 0.01) % itter : Itterations (def= 10) % % OUTPUT EC : error code (0 = success, 1 = error) % % (c) F. Dworkowski, 2011 % Version 1.0, 2011-08-03