ScanRead Ver. 3.51 Copyright (C) 1999 by Ken Ritley. All rights reserved. Release date: October 10, 1999 For information about data analysis programs for the Unix operating system, check out CPLOT at www.certif.com. For the Windows95 operating system more information about outstanding, high-quality scientific graphics software such as Microcal Origin can be obtained from www.microcal.com. USING SCANREAD WITH MICROCAL ORIGIN ScanRead can be made to function transparently and seamlessly with Microcal Origin, as if it were part of Microcal Origin itself. This is very convenient for data analysis, since scans can be selected, plot very quickly, then imported into Origin and analyzed with just a few keystrokes. The default location for scans extracted by ScanRead is c:\spectemp.dat. This makes it easy to write Microcal Origin macros to read and analyze Spec scans. This file describes how to use ScanRead transparently as a menu option with Microcal Origin. This can be accomplished in just two easy steps: 1. Modify the Origin file called FULLMENU.CNF, to tell Origin to create the new menu entries for SpecRead and for importing the data files. 2. Add a new macro file called SCRIPTS.OGS to the Origin directory, which contains the special macros to run SpecRead and to import (and format) the Spec scans. The rest of this file contains the necessary modification which should be appended to FULLMENU.CNF, as well a sample SCRIPTS.OGS file. This latter file contains some sample macros in addition to those required by ScanRead, in order to illustrate the simplicity and power of writing macros for Microcal Origin. STEP ONE: Append the following code to the Microcal Origin file called FULLMENU.CNF. This defines a new menu with all the Spec importing and analysis options. //////////////////////////////////////////////////////////////////////////////// // Append this file to the end of your existing FULLMENU.CNF file! //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// // Custom X-RAY menu by Ken Ritley //////////////////////////////////////////////////////////////////////////////////// menu -wmg; menu 14 (&X-Ray) menu "&Select SPEC file" { run.section(scripts.ogs,SPECSelect) } menu "&Import SPEC file" { run.section(scripts.ogs,SPECImport) } menu "&Import Specific SPEC file" { run.section(scripts.ogs,SPECSpecificImport) } menu "Import &PSD matrix" { run.section(scripts.ogs,SPECPSDImport) } menu; menu "&Analysis: Diffuse" {}; menu "&Analysis: Specular" {}; menu "&Resolution Correction" {}; menu "&DSpacing" { run.section(scripts.ogs,DSpacing) } menu; menu "&Statistics" { run.section(scripts.ogs,MaxAndMin) } menu "&Normalization" { run.section(scripts.ogs,Normalize) } menu "&Scale" { run.section(scripts.ogs,Scale) } menu "&Shift" { run.section(scripts.ogs,Shift) } menu; menu "&About" { run.section(scripts.ogs,XRAYAbout) } STEP TWO. Create the file called SCRIPTS.OGS in the Microcal directory. A sample file, with some extra features, appears here as an example: // // SCRIPTS.OGS // // Ken Ritley // November 30, 1998 // Max-Planck-Institut fuer Metallforschung // Abteilung Dosch // Heisenbergstrasse 1 // D-70569 Stuttgart // k-ritley@dxray.mpi-stuttgart.mpg.de // // This is a script file which contains the scripts which are bound // to the XRAY menu items. See the file FULLMENU.CNF for details. [SPECSelect] run -e "c:\origin50\scanread.exe"; [SPECImport] open -w c:\spectemp.dat; for(i=1;icol(%a)[i]) {jmin=col(%a)[i];jmincol=i}; }; /* Show the results to the user */ type -b "The maximum is $(jmax) in row $(jmaxcol)\n The minimum is $(jmin) in row $(jmincol)"; [Normalize] /* Make sure user has selected a column */ if (wks.sel==0) { type -b "You must first select a column!"; break 1; } var=wks.c1; %A=wks.col$(var).name$; col(DSpacing)=wave*col(%A); col(DSpacing)=wave/sin(pi*col(%A)/2/180); /* Perform the search here */ jmax=col(%a)[1]; jmaxcol=1; jmin=col(%a)[1]; jmincol=1; i=0; repeat wks.maxrows { i++; if (jmaxcol(%a)[i]) {jmin=col(%a)[i];jmincol=i}; }; /* Show the results to the user */ type -b "The data have been normalized by the maximum \n $(jmax) in row $(jmaxcol)"; /* Create a new column if one does not exist */ var=0; for(i=1;i