73
MARC TOOLS A Guide to the MARC Software Suite Including Nufit Reference Guide Microanalytical Research Centre School of Physics University of Melbourne VICTORIA 3010 AUSTRALIA Fax: + 61 (0)3 9347 4783 Ph: + 61 (0)3 8344 5376 Email: [email protected] Web: http://www.ph.unimelb.edu.au/marco Version 2

MARC Tools - guide to software - School of Physics · MARC TOOLS A Guide to the MARC ... Simulation sublevel ... Calculate stopping cross section factors, surface energies, etc

  • Upload
    dinhdan

  • View
    214

  • Download
    1

Embed Size (px)

Citation preview

MARC TOOLS

A Guide to the MARCSoftware Suite

Including Nufit Reference

Guide

Microanalytical Research Centre

School of PhysicsUniversity of Melbourne

VICTORIA 3010AUSTRALIA

Fax: + 61 (0 )3 9347 4783Ph: + 61 (0 )3 8344 5376

Email: [email protected]: http://www.ph.unimelb.edu.au/marco

Version 2

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

1

Preface This manual contains details on the MARC software suite, and covers the following programs: Nufit, RUMP4, RBS and AGP

For further technical assistance please contact MARC via the following email address:

[email protected]

Limitation of Liability Micro Analytical Research Centre does not assume any liability arising out of the use of the information contained within this manual. This document may contain or reference information and products protected by copyrights or patents and does not convey any license under the patent rights of Micro Analytical Research Centre, nor the rights of others.

Micro Analytical Research Centre will not be liable for any defect in hardware or software or loss or inadequacy of data of any kind, or for any direct, indirect, incidental, or consequential damages in connections with or arising out of the performance or use of any of its products. The foregoing limitation of liability shall be equally applicable to any service provided by Micro Analytical Research Centre.

Note No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying or otherwise, without the prior written permission of MARC.

Manual Version: 2.0 Manual Date: March 2009 ©2009 Microanalytical Research Centre

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

2

Table of Contents

1. OVERVIEW..................................................................................................5

1.1 Types of data.....................................................................................................................................5

1.2 RUMP4..............................................................................................................................................5

1.3 nuwave...............................................................................................................................................6

1.4 AGP ...................................................................................................................................................6

1.5 RBS ....................................................................................................................................................7

1.6 Nufit ...................................................................................................................................................8

2. INTRODUCTION TO NUFIT......................................................................10

2.1 What is Nufit?.................................................................................................................................10

2.2 Nufit History ...................................................................................................................................10

2.3 Frequently Asked Questions..........................................................................................................11

2.4 A Fast Plot with Nufit ....................................................................................................................11

2.5 Nufit Command Reference ............................................................................................................16 NUFIT, INTRO, INFO ....................................................................................................................16 AGP ...................................................................................................................................................17 ARC ...................................................................................................................................................17 AVERAGE ........................................................................................................................................17 BG ......................................................................................................................................................17 BUMP ................................................................................................................................................18 CAPTION .........................................................................................................................................19 CHARACTERS – BASIC SYMBOLS ...........................................................................................19 CHARACTER SETS – ADDITIONAL FONTS ...........................................................................21 CHI ....................................................................................................................................................23 CLEAR ..............................................................................................................................................23 CORR ................................................................................................................................................23 DATA.................................................................................................................................................23 DEFAULT .........................................................................................................................................24 DERIV ...............................................................................................................................................24 DEST .................................................................................................................................................24 DRAW ...............................................................................................................................................24 DR/1, DR/2, DR/3, DR/4, DR/5, DR/6, DR/7, DR/8, DR/9, DR/*, DR/+ (Plot symbols) .............25 DRAW/ASPECT ..............................................................................................................................25 DRAW/BASE....................................................................................................................................26 DRAW/COLOUR.............................................................................................................................26 DRAW/DISABLE, DRAW/ENABLE.............................................................................................26 DRAW/F............................................................................................................................................29 DRAW/GRADATIONS ...................................................................................................................29 DRAW/INFLATE ............................................................................................................................29 DRAW/JUMP ...................................................................................................................................29 DRAW/K ...........................................................................................................................................29 DRAW/L ...........................................................................................................................................30 DRAW/MARKS ...............................................................................................................................30

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

3

DRAW/NUMBER OF STEPS.........................................................................................................30 DRAW/Q ...........................................................................................................................................30 DRAW/REDRAW ............................................................................................................................30 DRAW/SCREEN ..............................................................................................................................31 DRAW/T ...........................................................................................................................................31 DRAW/V ...........................................................................................................................................31 DRAW/WAIT ...................................................................................................................................31 DRAW/X ...........................................................................................................................................31 DRAW/Y ...........................................................................................................................................31 DRAW/Z ...........................................................................................................................................31 ECHO ................................................................................................................................................32 ERROR .............................................................................................................................................32 F? .......................................................................................................................................................32 FIT .....................................................................................................................................................32 FUNCTIONS ....................................................................................................................................32 FONT.................................................................................................................................................33 FT, FOURIER ..................................................................................................................................33 FUNCT ..............................................................................................................................................34 FUZZ .................................................................................................................................................34 FVAL .................................................................................................................................................34 GAUSSIAN, AREA ..........................................................................................................................34 HATCH .............................................................................................................................................34 HELP .................................................................................................................................................34 HOLD ................................................................................................................................................35 INSERT .............................................................................................................................................35 INTEGRATE ....................................................................................................................................36 LABEL ..............................................................................................................................................36 LINE ..................................................................................................................................................37 LOAD ................................................................................................................................................37 LOG ...................................................................................................................................................37 LOGIN...............................................................................................................................................37 @, MACRO.......................................................................................................................................38 MAKE ...............................................................................................................................................38 MCA ..................................................................................................................................................38 MASK ................................................................................................................................................40 MASS.................................................................................................................................................40 MENU................................................................................................................................................40 MODE ...............................................................................................................................................41 MODIFY ...........................................................................................................................................41 MVAL................................................................................................................................................41 NVAR, NPAR ...................................................................................................................................41 NORMALISATION .........................................................................................................................41 ORDER .............................................................................................................................................41 OUT ...................................................................................................................................................41 PARAM .............................................................................................................................................42 PERIOD ............................................................................................................................................42 PHA ...................................................................................................................................................42 PRINT ...............................................................................................................................................43 REGUL..............................................................................................................................................43 REWIND ...........................................................................................................................................43 ROTATE ...........................................................................................................................................43 SAVE .................................................................................................................................................43 SPECIAL...........................................................................................................................................44 SPLINE .............................................................................................................................................45 STIPPLE ...........................................................................................................................................45 Structure of the standard NUFIT data file ....................................................................................45 NUFIT data file example .................................................................................................................45 SWAP ................................................................................................................................................46

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

4

TERMINAL ......................................................................................................................................46 THICK...............................................................................................................................................46 VALUES............................................................................................................................................46 $ ..........................................................................................................................................................46 XMODIFY ........................................................................................................................................46 XRAY ................................................................................................................................................47 YMODIFY ........................................................................................................................................48

2.6 Examples of Nufit plot files............................................................................................................49 (1) Plotting more than one spectrum on the same plot: ................................................................49 (2) Plotting x-ray lines ......................................................................................................................50 (3) Fitting Gaussians to a spectrum ................................................................................................51 (4) Combined use of RUMP4 and Nufit to simulate and display a non-Rutherford scattering spectrum ............................................................................................................................................52 (5) Combined use of RUMP4 and Nufit to simulate and display a channelling and random spectrum ............................................................................................................................................53

APPENDIX ONE............................................................................................54

How to fit a function to a data set using Nufit ...................................................................................54

APPENDIX TWO ...........................................................................................56

How to produce an HP-GL file from a macro using Nufit ...............................................................56

APPENDIX THREE .......................................................................................60

RUMP4 simulations including non-Rutherford cross sections ........................................................60

APPENDIX FOUR .........................................................................................63

The RBS program - Surface energy approximation .........................................................................63

APPENDIX FIVE............................................................................................67

Finding the spot size from an edge scan .............................................................................................67

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

5

1. Overview Although much commercial software is available for display and manipulation of spectra, the MARC software suite provides a partially integrated collection of software tools that may be more convenient. The tools are intended to take spectral data files from the MARC data collection program, MpSys, and other sources, then display, plot and analyse them in a variety of ways.

This guide covers the following programs:

NNuuffiitt RRUUMMPP44

RRBBSS AAGGPP

MpSys itself is covered by a separate manual. Also an additional program specifically for processing MpSys maps: nuwave, is also available and covered by a separate manual.

1.1 Types of data The data to be displayed and analysed may come from a variety of sources:

From MpSys: Maps (*.map) Spectra (*.img) Event-by-event data (*.evt) BIG Sorted event-by-event data (*.sd, *.sp) BIG

Other sources...(*.txt, etc) Measurements in lab notebook Spectra in publications

Use DIGIT and Summagraphics digitiser to convert to ascii file Text files from email, wherever

Each of these data types and file formats can be utilised by one or more of the following programs.

1.2 RUMP4 RUMP4 is used mainly to simulate Rutherford Backscattering Spectrometry (RBS) spectra. This is based on RUMP, an excellent program originally written by Larry Doolittle from Cornell University in 1985. An excellent commercial version of the RUMP program is available, with extensive documentation, called GENPLOT. MARCO strongly recommends this program.

The version of RUMP4 described here is a modified version of RUMP which includes the option of using non-Rutherford cross sections from the MARCO group data-base for performing simulations of non-Rutherford elastic scattering spectra.

In summary, RUMP4 may be used to:

Simulate spectra Find RBS information about elements Investigate non-Rutherford scattering

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

6

To simulate a RBS spectrum it is necessary to perform the following steps:

Run program on your system with the shell command: rump Set experimental parameters Enter simulation sub-command level and input specimen composition

Simulation sublevel Enter composition and thickness of each layer Set density of layer (if necessary, e.g. diamond) REMEMBER! Depth is connected to energy via density Set number of sub-layers (if using non-Rutherford) Select non-Rutherford elements Select name of non-Rutherford cross section database

Perform simulation Save simulation to disk

With the simulation saved to disk, it is now possible to use Nufit, or some other program, to display the simulation and overlay it on experimental data. Further tasks that can be performed with RUMP4 include:

Provide information using the surface energy approximation on any element Calculate Rutherford and non-Rutherford scattering cross sections on elements Refine simulation More complicated options for advanced users...

A worked example on the use of RUMP4 to simulate a spectrum is shown in Appendix Three.

1.3 nuwave Nuwave is used to display and process MpSys map files. Nuwave is used for:

map smoothing map colour scale modification adding maps together subtracting maps dividing maps differentiating maps

Advanced features:

RBS tomographic images from station 1 RBS spectra (uses sorted data and sorted pointers files to do this) Print out by frame grabbing with xv

Full documentation on nuwave is available in a separate manual.

1.4 AGP The program AGP has largely been superseded by a variety of excellent packages for the display and processing of 3D data files. Of these, PVWAVE/IDL, MATHEMATICA and MATHLAB have been used at different times by members of the MARC group.

AGP accepts (x,y,z) columns of data in the form of intensity (z) as a function of (x,y). These data can then be displayed as a 3D plot of the resulting grid. It is also possible to display the data as a contour plot that is useful in some cases. The contour plotting subroutine was written by Dr Zhu Jieqing of the Shanghai Institute of Nuclear Research. In general, AGP works best for data that has smoothly varying z values.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

7

A summary of AGP plotting functions:

Contour plots of (x,y,z) data sets 3D wire frames with hidden line removal Reads output from SPM or other programs Can convert (x,y,z) data to mpsys map format

More information on the use of AGP is available in a separate manual.

1.5 RBS Performs RBS type calculations using the surface energy approximation. This program is not intended to be user friendly, but can be used to perform simple analyses of RBS spectra. The code is derived from the theory in the book “Backscattering Spectrometry” by Chu, Mayer and Nicolet.

Uses:

Convert peak areas of surface contamination into areal densities (atoms/cm2) Fit steps to a stoichiometry of a compound specimen Calculate stopping cross section factors, surface energies, etc. Corrections for non-Rutherford scattering

An example on the use of RBS to perform surface energy calculations is shown in Appendix Four.

An example of an AGP contour plot. Data from the Honours thesis of Jacinta den Besten, 1995

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

8

1.6 Nufit Nufit is a general purpose data plotting and fitting program. Many of Nufit’s functions can also be performed with more commercially oriented and user-friendly software packages, such as Excel, SigmaPlot or similar. However, Nufit does integrate several features specifically to do with the processing of nuclear microprobe data, such as spectra from RBS and PIXE experiments. Note that Nufit is mainly intended for the display of spectra, as well as fitting generic functions to the data. Quantitative analysis of RBS and PIXE spectra are performed by other programs such as GEOPIXE for PIXE data and GENPLOT for RBS data.

Special features of Nufit include:

Special features for RBS, PIXE and �-ray spectra Can generate plots in different plotting languages including postscript, HP/GL, Tektronix 4010 and PC Can generate complicated plots using macros of stored commands (acro filenames *.ncm) Execute macro by typing macro filename Can store libraries of macros in /home/username/bin Can print macro to file with print macroname Runs on unix, DOS, VMS,... Use the insert command to enter data from your logbook Accepts a variety of data file formats... Nufit standard data files (*.fit) Standard ascii Nufit data file saves:

caption, x-axis caption, y-axis caption Parameters of function Fit mask Function number (x,y,dy) and function value (if any) Can edit or print anything in this file This file is most suitable for 10 to 500 data points which have an appropriate function fitted to them.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

9

1.6.1 Sources of data for Nufit Data for Nufit can be read from a number of different datafiles. Some of these come from MpSys or other data acquisition systems.

Once data from any source is read into the Nufit data buffer, the data can be saved in a number of formats. The above example showed the *.fit file format (standard Nufit data file). The diagram above indicates some other possibilities.

Once the data has been loaded into Nufit and plotted on the screen, a number of options are available for making printouts. The Nufit plot on the video screen can be converted in to a number of different plot file formats. In general, a Nufit plot will be generated by a macro of Nufit commands. When the plot is correct as seen on the screen, the appropriate plot file can be created for printing. What you see is what you get.

A full description of Nufit and some examples of its possibilities are described in the next chapter.

nufitnufit

mpsysmpsysaccuspecaccuspec Raman/Email/etcRaman/Email/etc

*.img

*.dat *.txt

*.mca

Logbook dataLogbook data

*.fit

*.dat

*.ps *.hgl

*.mca *.fit

nufitnufit

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

10

2. Introduction to Nufit

2.1 What is Nufit? − Nufit is a graphics, fitting and data analysis program designed to give results quickly. − When it comes to printing what you see on the screen, Nufit is strictly what you see is

what you get! Nufit therefore emulates in software many fancy features to ensure this. − Nufit can produce complicated diagrams that incorporate data and any fitted functions.

The diagrams may be labeled with any combination of alphanumeric, Greek or special characters including superscripts, subscripts, enlarged or reduced.

− The data can be read from data files in many common data file formats and it is a simple

matter to incorporate a new section of code for use with a non-standard data file format. − Nufit can create complicated line diagrams of apparatus or schematic diagrams. − Nufit is interactive and controlled with simple commands. All commands may be

abbreviated, even down to one letter. To resolve ambiguous abbreviations Nufit uses the first available command in the command list that matches the abbreviation.

− Sequences of commands can be strung together for form Nufit macros, so the user can

develop a library of customised commands. Some sample Nufit macros appear in the appendix. These are available on disk at many installations.

2.2 Nufit History 1977 Nufit gets started as a stack of mark sense cards to graphically find the roots of third

and higher order polynomials. It featured a fantastic user interface (soft lead pencil to code the coefficients on cards) and took advantage of all that FORTRAN 4 on a SCUBA computer could offer. This version met a tragic end when the mark sense cards got shuffled.

1980 Migration to a CYBER computer with the extraordinary NOS/BE operating system. When you were connected to the CYBER by a 1200 baud line using an upper case only, 12 lines per screen VDU you knew you were really flying. Replacing mark sense cards with disk files made the creative process a bit intangible, but I got used to it.

1981 Nufit moves to a VAX 11/750 running VMS and FORTRAN 77. A whole swag of VAX/VMS FORTRAN enhancements are unwittingly introduced. The graphics now drive deluxe TEKTRONIX 4010/4 storage VDUs. The thumb wheels to drive the cross hairs are greatly appreciated.

1982 Nufit really take off when it migrates to a Data General ECLIPSE MV/8000 running AOS/VS. A painful process of purging VAX/VMS enhancements follows. The FORTAN 77 compliers are neither backward compatible nor debugged before being released (e.g. cos(45 degrees) = 1.5 for example!) take some getting used to. The graphics (thanks to Chris Ryan) are done on VISUAL 500 terminals running at the

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

11

heady speed of 19600 baud. Nufit also gets a big boost thanks to several demanding users from the astronuclear group.

1985 The demands of thesis writing provide an explosion of new features, including macros, dashed lines and different fonts (originally hand digitised by the Betatron group, but later from the Hershy character set). Multicolour plots are possible on the BBC multi—pen plotter.

1986 Nufit migrates to Caltech, accreting laser printer postscript capability along the way (thanks to Bruce Vogelaar). It gets ported back to VAX/VMS (11/780, microvax 2000) driving SELENAR graphics terminals. It also gets ported to a TEKTRONIX unix work station. A traumatic experience. Later it goes to a VAX 8600 in Oxford.

1990 Nufit returns to Melbourne and is re--ported to UNIX (more vigorous purging of VAX enhancements) and luxurious X-terminal graphics. The what you see is what you get philosophy is even more rigorously followed. A fully featured PC version spontaneously comes into being.

2.3 Frequently Asked Questions I have a table of data points in my log book, how do I get a quick plot?

Turn to section 2.4

How do I embellish my plot with Greek symbols and labels?

See the commands font, label and char in section 2.5

I have two sets of data points, how do I get them on the same plot?

See the example in the appendix.

How can I fit function f(x,y,z,…) to my data points?

See the example in the appendix.

What can Nufit do for me?

Turn to the next section...

2.4 A Fast Plot with Nufit You already have a some data in the form of a column of numbers in your laboratory log book. This section shows you how to get a fast plot.

All Nufit commands are of the format: ABCDEF/X PQRS

where

ABCDEF is the (abbreviated) command,

X is an (optional) option on the command and

PQRS is either a numerical argument on the command, a filename or another option on the command.

If Nufit feels it has insufficient data for a particular command it will prompt for whatever is lacking.

To get a fast plot of your data you need to take the following steps:

A simple example of a Nufit plot.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

12

Step 1: Run Nufit on your system

$ nu NUFIT -- V 6.0 fit>

The prompt of Nufit appears, fit>, showing that you can now type commands.

Step 2: Enter the data

You can skip this step if you already have your data on disk in a file.

See the make command for how to load files of arranged in columns.

See the pha command for binary files.

You can use the data command if the data points are already in a standard Nufit data file.

If you are starting from scratch, you now need to enter the data into the computer using the insert command:

fit> insert} Filename for output > mydata} New data going into file: mydata.fit Heading (CR for none) > Data taken on 25/12/93, run s876 X axis label (CR for none) > Energy (keV) Y axis label (CR for none) > Intensity (arb. units) Function number (CR for none, -1 for a list) > Blank function Do your X coordinates increase in constant increments? (Y/N) > n Do you wish to enter errors on the Y data points? (Y/N) > n Number of data point pairs > 10 Data point 1 X,Y > 1000,354 Data point 2 X,Y > 1005,298 Data point 3 X,Y > 1100,132 Data point 4 X,Y > 1120,45 Data point 5 X,Y > 1160,40 Data point 6 X,Y > 1170,38 Data point 7 X,Y > 1180,35 Data point 8 X,Y > 1190,32

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

13

Data point 9 X,Y > 1200,33 Data point 10 X,Y > 1300,31 Do you want to correct/alter/add to any of the above points? (Y/N) > y Data point number (CR to end) > 3 3: Old values 1100.0 132.00 0.00000E+00 New Values X, Y > 1100,123 Data point number (CR to end) > fit> In this example, a correction was made to data point number 3 before ending the command and returning to the prompt. It would have been possible to add more data points by responding with a number greater than the current number of data points instead.

You will now have a file called mydata.fit in your current directory. For an explanation of the data format and other contents of this file see section 2.5.

Your data has also been loaded into the Nufit data buffer. It is now ready for display, modification or resaving to disk.

Step 3: Plot the data on the screen

To display you data on the screen, just type:

fit> draw Select the TEK4010/4 terminal emulation: 1 Tektronix 4010/4 2 GRAPHON GO235 or SELANAR/VT100 3 FALCO 550 window 1 is alpha 4 FALCO 550 window 3 is alpha 5 PERICOM at CERN 6 PERICOM at Oxford 7 V500 at Melbourne 8 xterm in Baker laboratory 9 as 8 but without open/close > 8 Terminal type 8 selected. The data is now drawn on the screen.

Before the draw command can draw your data on the screen, Nufit has to know what sort of graphics you require. In this example, terminal type 8 has been selected, appropriate to the X-terminals in the Baker laboratory in the School of Physics at the University of Melbourne. This type should be appropriate for any X-terminal running X-windows.

Next time you issue the draw command, Nufit will remember your choice of terminal type and won't ask again. You can make your choice automatically with the term command.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

14

Almost all aspects of the appearance of this plot can be changed!

The example here simply represents the default plot type.

Step 4: Plot the data on paper

To get a printout of you data, the same draw command is used, just apply the option appropriate for your printer. In this example, a postscript plot file is generated: fit> draw/q Plot written to: plt01.ps Your plot is now in a file plt01.ps which can be printed on a laser printer. You must first close the file by leaving Nufit and returning to the shell:

Fit> exit plt01.ps file closed. X range (cm): .9 26.0 Y range (cm): 1.5 19.9 Regular page X: 0-27.9 Y: 0-21.6 cm Center offsets: .5, .1 Now use the appropriate shell command to send the file to the laser printer:

$ qpr -d -P qmsps plt01.ps Notice how the exit command automatically closed the plot file and gave some information on the size of the plot on the page. The plot file was then printed with the qpr shell command. This may be different on your system. Step 5: Next time

Next time you need to plot this data, just type the following sequence of commands (from the shell level):

$ nu fit> term 8 fit> data mydata Reading new data from: mydata.fit Caption : Data taken on 25/12/93, run s876 X axis : Energy (keV) Y axis : Intensity (arb. units)

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

15

10 points in data file. fit> draw The plot appears on the screen fit> dr/q The plot is put into a

postscript file fit> ex plt02.ps file closed. X range (cm): .9 26.0 Y range (cm): 1.5 19.9 Regular page X: 0-27.9 Y: 0-21.6 cm Center offsets: .5, .1 $ $ qpr -d -P qmsps plt02.ps The data command has been used to reload the file mydata.fit from disk. This was the file created by the insert command.

Notice how this time the terminal type has been set immediately with the term 8 command and the draw command has been abbreviated to just dr, similarly exit to just ex. You can put the term 8 command in a file called login.ncm so that it is executed every time you run Nufit in that directory.

Step 6: Help!

You can get help on all of the Nufit commands by typing:

fit> help command

where command is the command about which you are seeking help.

For example, type:

HELP DATA for the structure of the standard Nufit data

file.

HELP FIT for information on how to fit a function to the data.

HELP DRAW for information on how to change the appearance of the plot (this is a big one!)

MENU for a list of all possible Nufit commands.

HELP/B for a list of all possible key words on which help is available.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

16

2.5 Nufit Command Reference This section is a list of all Nufit commands and how to use them. The same information is available by typing help command from the Nufit command prompt.

NUFIT, INTRO, INFO 1. NUFIT is a graphics, fitting and data analysis program designed to give results quickly.

2. NUFIT can produce complicated diagrams that incorporate data and any fitted functions. The diagrams may be labeled with any combination of alphanumeric, Greek or special characters including superscripts, subscripts, enlarged or reduced.

3. The data can be read from data files in many common data file formats and it is a simple matter to incorporate a new section of code for use with a non-standard data file format.

4. NUFIT is interactive and controlled with simple commands. All commands may be abbreviated, to resolve ambiguous abbreviations NUFIT uses the first available command in the command list that matches the abbreviation.

If the program feels it has insufficient data for a particular command it will prompt for whatever is lacking.

The simplest possible NUFIT session is;

$ nu (run NUFIT on your system) fit> DATA filename (load data from filename) fit> DRAW (draw the data on the screen) fit> EXIT (return to the shell) Type:

HELP DATA for the structure of the standard NUFIT data file. HELP FIT for information on how to fit a function to the data. HELP DRAW for information on how to change the appearance of the plot. MENU for a list of all possible NUFIT commands. HELP/B for a list of all possible key words on which help is available.

Special characters: To save typing, Nufit recycles filenames and macro arguments as special characters, that when implanted in a command line, get expanded into the filename. These are as follows:

“percent” % Macro name (less ‘.ncm’ extension)

“hash” # Current file name stem (less extension)

“tilde” ~ Argument of macro from command line (if any)

For example:

(1) Typing % at the fit> prompt will run the last macro again.

(2) To reload the last data file again: fit> DATA # will reload the last filename.

(3) To set the name of the postscript file for the plot to the same as the current filename, use the command:

fit> DEF/Q #.ps will set the filename to myfile.ps (or whatever).

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

17

(4) Within a macro, the argument of the macro can be invoked with the character, for example, running a macro with an argument:

fit> @fred myfile with a line in the macro like this:

DATA ~

will result in the command being expanded to:

DATA myfile

AGP AGP Create a file which can be graphed in three-D by program AGP. The two parameters to be varied are prompted for. The reduced CHISQ is plotted along the Z axis.

ARC ARC Draw a circle or a segment of a circle. The command prompts for; Radius (in units of the X axis) > RADIUS Centre coordinates > X,Y Start coordinates > X1,Y1 (defines an angle from center) Angle offset > THETA (ARC/C Prompts for the finish coordinates instead of THETA) ARC L Draw a straight line. The command prompts for; Start coordinates > X1, Y1 End coordinates > X2, Y2 /L If the option ‘/L’ is used, the log is taken of X1,X2, Y1 and Y2 before plotting. /I If the option ‘/I’ is used, the start and end coordinates are offset by the current values of markers 1 and 2 respectively.

AVERAGE AVERAGE Find the average of the X and Y data points. i.e. Xave = (sum of all X coords)/(total number) Yave = (sum of all Y coords)/(total number) Error ave = (sum of all error bars)/(total number) Also compute standard deviations of X, Y, Yerr. AVERAGE/C ‘i’ Compress the data by taking the data in groups of ‘i’ data points and

summing each group to make one new data point. AVERAGE/S ‘i’ Smooth the data in windows of +/- ‘i’ about each point. AVERAGE/W Compute the weighted mean of the Y data points taking into consideration the error bars on the Y data points. Also compute the error in the mean.

BG BG Background subtraction commands:

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

18

BG/L Load the present data set into the background \ buffer. BG/S Subtract the background buffer from the present data, using a linear

interpolation if necessary to find heights. BG/R Reload the present background buffer into the main buffer. BG/D Divide the main buffer by the background buffer. BG/M Multiply the main buffer by the background buffer.

BUMP BUMP Enter bump mode. The cross hairs appear on the screen. Up to 6

markers may be allocated. Bump subcommands (NB: no carriage return is necessary in BUMP mode and the subcommands do not echo on the screen):

1 Assign the current cross hair position to markers X1, Y1 and draw in marker X1.

2-6 Similarily. C Center the data by subtracting the present position of marker 1 from the x-axis. E Exclude all data between markers X1 and X2. F Flatten the data between X1 and X2 (i.e. set y to zero). N Normalize the data in the y-direction. Marker 1 should be placed at the present height of the data. After ‘N’ is pressed, marker 1 should be moved to the new height of the data. When the space bar is pressed the data is normalised to the new height. The normalization factor is typed. P Insert a new data point into the data set at the current cross hair position. S Same as P but set sigma equal to 3.0 (to draw pictures) W Exclude all data outside markers X1 and X2. Q Quit Bump. BUMP RBS and X-ray spectra commands: G Go and perform the energy calibration using the positions of the elements marked with the ‘M’ command (see below). If the calibration is faulty (i.e. it can’t return the positions of the marked elements within 20 keV (for RBS) or 200 eV (for X-ray) then the calibration is aborted. M Mark the position of the surface energy (for RBS spectra)

or strongest x-ray line (for X-ray spectra) in an uncalibrated spectrum for calibration purposes with the ‘G’ command (see above). Two or more positions must be marked, the relevant element name is prompted for.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

19

Z Zero the list of marked elements. Useful if you make a mistake. ? or / Locate the elements with a surface energy (for RBS) or x-ray line (for X-ray) within 20 keV (for RBS) or 100 eV (for X-ray) of the present marker position. The position of the closest element is then labeled. Other BUMP options BUMP/L List the current values of the markers. BUMP/S Save the current values of the markers into file NUDRAW.DAT BUMP/R Reload the old values of the markers from file NUDRAW.DAT

CAPTION CAPTION Change the main plot caption. CAPTION/X Change the X-axis label. CAPTION/Y Change the Y-axis label. In each case the old caption is given and the new caption prompted for. If the old caption is to be retained, type <CR> in response to the prompt. If the caption is to be cleared (set to blank) type <TAB>.

CHARACTERS – BASIC SYMBOLS The NUFIT character set. Nufit uses the “^” character followed by a letter to select special characters that do not appear on your keyboard. The characters obtained with ^G and ^V are listed in this table. See the table on the next page for more options and examples.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

20

Font | English | Greek | Special | Other (any case) Sel. | | ^G | ^V | ---------------------- | | [UPPER] | [lower] | [UP-CASE ONLY] | ^U Superscript mode -------------------------------------------------- ^D Subscript mode | A | ALPHA | alpha | Squares | ^I Size increase | B | BETA | beta | Triangle | ^S Size shrink | C | GAMMA | gamma | Diamond | ^G Greek mode | D | DELTA | theta | Inv. triangle | ^V Very spec. mode | E | EPSILON | pi | Star | ^R Reset all modes | F | ZETA | sigma | - | ^N New line | G | ETA | mu | - | ^M Half new line | H | THETA | theta |Top curly bracket| ^J Inverse new line | I | IOTA | _ |Bot curly bracket| ^K Half inv. n. l. | J | KAPPA | - | - | ^B Back over last char. | K | LAMBDA | - | Circle | ^Y Stack up mode | L | MU | Angstrom | - | ^F Stack down mode | M | NU | Perp sym | - | ^C Reset font to def. | N | XI | Para sym | open down arrow | ^A Fat characters | O | OMICRON | - | open up arrow | ^L Elongated characters | P | RHO | - | open right arrow| ^T Italics | Q | TAU | - | open left arrow | | R | SIGMA | - | solid down arrow| | S | UPSILON | - | solid up arrow | | T | CHI | - | solid rht. arrow| | U | PHI | - | Solid left arrow| | V | OMEGA | - | Down arrow | | W | - | - | Up arrow | | X | phi | - | Right arrow | | Y |Big left | - | Left arrow | | Z |Big right| - | - | | > | right arrow | - | | < | left arrow | - | | = | bar (for arrows) | - | | space | .GE. | - | | ! | .LE. | - | | & | .NE. | - | | ‘ | .approx. E. | - | | % | +/- | - | | ( | small sub up arrow | - | | ) | small sup down arr.| - | | { | up bar | - | | } | down bar | - | -------------------------------------------------- More can easily be added.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

21

CHARACTER SETS – ADDITIONAL FONTS There are nine character sets available in NUFIT for placing labels and captions on figures. Additional fonts are selected with the ^0, ^1, ^2, ^3, ..., ^8 switches. For example ^1ABC will be translated as ABC in the alternative character set 1. ^0 is the default fonts.

The font may be globally changes with the font command. In this case ^c resets to the font selected with the font command. The following table lists the equivalent characters in each of the 8 fonts.

DEF. ALT. NORMAL OLD ROMAN ROMAN GREEK ENGLISH HELLENIC MATH GREEK SPECIAL ^0 ^1(norm.) ^2(norm.) ^5 ^6(norm.) ^8 ^g ^v ^3(serif) ^4(serif) ^7(serif) A,a A,a ALPHA,alpha A,a ALPHA,alpha DEL ALPHA,alpha square B,b B,b BETA, beta B,b BETA, beta integral BETA, beta triangle C,c C,c GAMMA,gamma C,c CHI, chi l.integ GAMMA,gamma diamond D,d D,d DELTA,delta D,d DELTA,delta infinty DELTA,theta inv tri. E,e E,e EPSILON,eps E,e EPSILON,eps Product EPSILON,pi star F,f F,f ZETA, zeta F,f PHI, phi Sigma ZETA, sigma histogrm G,g G,g ETA, eta G,g GAMMA,gamma elem. of ETA, mu - H,h H,h THETA,theta H,h ETA, eta Theta THETA,Theta - I,i I,i IOTA, iota I,i IOTA, iota Phi IOTA, Theta brace J,j J,j KAPPA,kappa J,j -, - degree KAPPA,Theta brace K,k K,k LAMBDA,lambda K,k KAPPA,kappa Degree LAMBD,Theta circle L,l L,l MU, mu L,l LAMBDA,lambd angstrom MU,angstrom - M,m M,m NU, nu M,m MU, mu ANGSTROM NU, perp. - N,n N,n Xi, xi N,n NU, nu bullet XI,parallel o d arrow O,o O,o O, o O,o O, o - O, - o u arrow P,p P,p PI, pi P,p PI, pi - PI, - o r arrow Q,q Q,q P, p P,p THETA,theta - P, - o l arrow R,r R,r SIGMA,sigma R,r P, p - SIGMA, - c d arrow S,s S,s TAU, tau S,s SIGMA,sigma - TAU, - c u arrow T,t T,t UPSILON,ups T,t TAU, tau - UPSILON,- c r arrow U,u U,u PHI, phi U,u UPSILON,ups - CHI, - c l arrow V,v V,v CHI, chi V,v -, - - OMEGA, - v d arrow W,w W,w PSI, psi W,w OMEGA,omega - -, - v u arrow X,x X,x OMEGA,omega X,x XI, xi - PHI, - v r arrow Y,y Y,y -, - Y,y PSI, psi - Big r arr - Z,z Z,z -, - Z,z ZETA, zeta - Big l arr - @ @ @ @ @ par der - - 0 0 0 0 0 + - - 1 1 1 1 1 pm - - 2 2 2 2 2 mp - - 3 3 3 3 3 times - - 4 4 4 4 4 . - - 5 5 5 5 5 divide - - 6 6 6 6 6 = - - 7 7 7 7 7 not = - - 8 8 8 8 8 equiv - - 9 9 9 9 9 < - - : : : : : > - -

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

22

; ; ; ; ; <= - - < < < < < >= small l arr - = = = = = proport dash - > > > > > small r arr - ? ? ? ? ? sq root - - ‘ ‘ ‘ ‘ ‘ - approx= - ! ! ! ! ! circle <= - “ “ “ “ “ triangle ‘ - # # # # # plus - - $ $ $ $ $ times : - % % % % % diamond pm - & & & & & star not= - ‘ ‘ ‘ ‘ ‘ blk square - - - - - - - blk star - - ( ( ( ( ( blk circle raise - ) ) ) ) ) blk triang lower - * * * * * blk triang - - + + + + + * - - . . . . . star David - - / / / / / - divide - | { { { { - - - | } } } } - - - | | | | | - - -

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

23

CHI CHI Calculate the current reduced CHISQ as well as the current non-reduced CHISQ.

CLEAR CLEAR/’opt’ Clear the screen. ‘opt’ = G Clear the graphics screen. ‘opt’ = A Clear the alphanumeric screen and set the clear flag so that the alpha screen will be cleared after every command. ‘opt’ = H Same as ‘A’ except prompt at top of screen. ‘opt’ = C Clear the clear flag.

CORR CORR Calculate the Correlation matrix. If any of the off diagonal elements of this matrix are close to unity then the best fit function has an infinite number of solutions.

DATA DATA ‘filename’ Load a set of points from disk. If ‘filename’ is not given it will be prompted for. Note that all NUFIT data files have default extensions ‘.FIT’. This extension will be assumed if no extension is given. DATA/+ ‘filename Add the new data to the old data. The new data should have the same x-coordinates as the old data. DATA/A ‘filename’ Append the X,Y,Yerr data in ‘filename’ onto the existing data. DATA/D ‘filename’ Divide the old data by the new data in ‘filename’. The new data should have the same X-coordinates as the old data. DATA/F ‘filename’ Read in only the function and parameters from ‘filename’. Variables above the new NVAR will not be cleared. DATA/S ‘filename’ Subtract the new data from the old data. The new data must have the same X coordinates as the old data. DATA/M ‘filename’ Multiply the old data by the new data. DATA/N ‘filename’ Load the new data points without changing the old function. If the DATA command is used in a macro and no ‘filename’ is given, the argument on the macro command will be used.

Type HELP STRUCTURE for the format of the standard NUFIT data file.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

24

If you have a file on disk already in some other format type HELP MAKE for how to read data files in non-standard formats.

Type HELP INSERT for information on how to insert new data from scratch the easy way.

Once a file has been loaded, the filename is assigned to the character crosshatch (#). Therefore to get the present file back again it is possible to type DATA #. Also the # character may be used in other places, for example the command CAP/A # will append the filename to the start of the caption.

DEFAULT DEFAULT Change the size and position of the plot. The scale factor and the offsets in mm are prompted for. Options allow the plots directed to the different plotting devices to be scaled independently: DEF/H HP-GL for the Laserjet IIIP printer. DEF/P HP-GL for inclusion as a graphics file in powerpoint presentations. DEF/Q Postscript plots. DEF/S Screen plots (Tektronix 4014). DEF/* Apply to all plots. DEF/Q filename Direct all postscript output to ‘filename’, instead of the default filename ‘pltxxx.ps’. DEF/P filename Similarly for HP-GL instead of the default filename ‘Pxxx.HGL’ DEF/Q * Reset the filename to the default.

DERIV DERIV Take the derivative of the data.

DEST DEST ‘filename’ Set the destination for future TEKTRONIX 4010/4 plots to ‘filename’. This file may then be printed on the laser printer with the VAX/VMS command ‘TEKPRINT’.

DRAW DRAW/’opt1’ ‘opt2’

Draw the current data set on the screen. The old draw set is cleared first unless the /R option is used or clearing has been disabled. ‘opt1’ and ‘opt2’ are used to specify changes to the default appearance of the DRAW. Possibilities for /’opt1’: /S Draw a soft copy only (Default) /O Draw to the SERVOGOR quality plotter [no longer active] /H HP-GL for laserjet IIIP printer

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

25

/P HP-GL for inclusion in Powerpoint /Q Postscript for laser printer /R Redraw (see later) Possibilities for ‘opt2’: OLD <filename> Draw the data using the limits in the file <filename>.NUM. This is useful for plotting several files to the same scale. If <filename> is missing, NUDRAW.NUM will be used. SAVE <filename>

Save the current ranges (Xmin, Xmax, Ymin, Ymax) in file <filename>. (NUDRAW.NUM if <filename> is absent.)

MARK Redraw the data using the positions of marker X1 and Y1 for Xmin and Ymin and X2 and Y2 for Xmax and Ymax. X Allow particular values of Xmin,Xmax,Ymin,Ymax to be entered. These numbers are prompted for. R Prompt for the x-range for the plot, the y-range is selected automatically t be from 0 to the top of the data. This option is useful for plotting regions of spectra. For more information on how to modify the appearance of a plot, type HELP DRAW/ Commands of the form ‘DRAW/opt val’ may be used to permanently or temporarily change the appearance of a DRAW.

DR/1, DR/2, DR/3, DR/4, DR/5, DR/6, DR/7, DR/8, DR/9, DR/*, DR/+ (Plot symbols) DRAW/’n’ A particular symbol may be selected with this option. where 0 < ‘n’ <= 9. DR/0 resets this option. ‘n’ Symbol ----------------------------------

1 square 2 triangle 3 circle 4 inverted triangle 5 star 6 diamonds 7 cross 8 dot 9 no symbol

DRAW/ASPECT DRAW/A ‘v’ Set the aspect ratio to ‘v’. The aspect ratio is defined to be: (X-axis length)/(Y-axis length) By default this is set to root two and is therefore a horizontal rectangle (in fact a Golden rectangle). The physical size of a hardcopy plot (see DR/O) with a scale factor of 1.0 and aspect ratio of root(2) is: Y-axis = 16.00 cm X-axis = 22.63 cm (16 x sqrt[2])

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

26

A larger aspect ratio than this leaves the X-axis length constant and scales down the Y-axis to obtain the correct aspect ratio. Similarly, an aspect ratio smaller than root(2) leaves the Y-axis length fixed at 16cm and scales down the X-axis.

DRAW/BASE DRAW/B Prompt for new screen plot offsets and scale factors. With this command you can move you plot around on the screen and enlarge or shrink it.

DRAW/COLOUR DRAW/C ‘n’ Change the current colour to colour number ‘n’. If ‘n’ is missing then the current colour is displayed. The absolute value of a negative number will change the pen width of the laser writer to the new value. For most laser printers, DR/C -3 will give a suitably thick line. This command can be included in the login.ncm file. For colour printers using the HP-GL graphics, the pen colours are as follows: DR/C 1 Black DR/C 2 Red DR/C 3 Green DR/C 4 Yellow DR/C 5 Blue DR/C 6 Purple DR/C 7 Cyan DR/C 8 Black & you really don’t need

more colours than this. Note that on the PC version of Nufit, DR/C should be replaced with the LINE command with identical arguments.

DRAW/DISABLE, DRAW/ENABLE DRAW/D ‘o’ Disable the plotting of various things depending on the option ‘o’. Possible options that may be enabled or disabled are: AXES Disable plotting of dotted lines marking the axes. [DEFAULT] BOX Disable the box around the plot. The marks should also be disabled with this option. CF Toggle the graphics clear flag. i.e. disable the automatic clear done before a plot starts. (useful if you are using a Tektronix 4010.)

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

27

DATA POINTS Disable plotting the data points ERRORS INSIDE

Disable the drawing of error bars within the plot symbols. [DEFAULT]

EXTEND Disable plotting the function beyond the range of the data points [DEFAULT] FIVES Disable the fine pip marks plotted between the major divisions when the major division is of the form 5x10^n. [DEFAULT] GO TO EDGE Disable the function draw to the edges of the box. [DEFAULT] HI AND LOW Disable drawing of top & bottom horizontal error bars. [DEFAULT] INSTANT SPLINE

Disable an instant spline fit before drawing if function 11 has been selected. Otherwise, if function 11 has been selected, a spline is fitted to the data before drawing. LINES Disable drawing of lines across the graph at the major pip marks. [DEFAULT] MARKS Disable plotting the marks along the edge of the box. NAME Disable labeling the plot with the data filename in the top right corner. ON FORCE Disable forcing the function to be evaluated at the data point x-values [DEFAULT] PARAM Disable plotting of the RBS parameters along the top of the graph. [DEFAULT] RIGHT MARKS Disable the marks along the right hand Y axis. UPPER MARKS

Disable the marks along the upper X axis. The above two are useful if a separate scale is to be drawn along the opposite axes. SPECTRAL MODE

Disable the drawing mode where the data is assumed to be always

positive and that the x-limits should extend only over the exact range of the x-data points.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

28

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

29

TO OLD LIMITS Disable fixing the limits for the plot to the limits used in the last draw. [DEFAULT]

TX Disable fixing only the x-limits. [DEFAULT] TY Disable fixing only the y-limits. [DEFAULT] V Disable plotting the numbers along the x-axis W Disable plotting the numbers along the y-axis XLOG Interpret the X axis as a log scale. i.e. plot the character 10^X instead of the character X along the X axis. YLOG Similarily to XLOG but along the Y-axis. ZAP Interpret the error bars to be X errors instead of Y errors. Do not use this command with a log scale on the Y-axis. EX1, EX2, EX3, EX4

Extend the range for the function plot.

DRAW/F DRAW/F Change the number of markers along the axes. The desired numbers will be prompted for. (These numbers will be followed to within +/- 2) The default numbers are 3 along each axis.

DRAW/GRADATIONS DRAW/G ‘n’ Change the number of fine gradations along the x- and y-axes to ‘n’. The default is ½.

DRAW/INFLATE DRAW/I ‘n’ Multiply the size of the characters used for the labels on the axes, the heading and the numbers labeling the axes by ‘n’.

DRAW/JUMP DRAW/J ‘n’ Multiply the size of the symbols used for the data points by ‘n’.

DRAW/K DRAW/K ‘n’ Multiply the size of the pip marks along the axes by

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

30

‘n’. ‘n’ may be real.

DRAW/L (Useful only for VT100/SE terminals, use DR/Z instead)

DRAW/L ‘n’ Change the line type used to draw the function to line type ‘n’. ‘n’ may be an integer between 0 and 6. The default is 0. 0 Solid line 1 Short dash 2 Long dash / Dot 3 dotted line 4-8 as 1-3 but longer You may also define your own line types by selecting a negative line type. See ‘LINE’ in help. Lets face it, DR/Z is more useful than this command.

DRAW/MARKS DRAW/M Force the number of figures after the decimal point that are to be plotted along the axes to: Ix, Iy. Ix and Iy will be prompted for.

DRAW/NUMBER OF STEPS DRAW/N ‘n’ Change the number of steps used to plot the function to ‘n’. 250 steps is the default. It may be beneficial to change to 1000 steps if your function has any steep sections.

DRAW/Q DRAW/Q Draw to the LASER WRITER. (Creates PostScript file)

DRAW/REDRAW DRAW/R Redraw the current data using the previous ranges and plot option. This is useful for superimposing two data files on the one plot. The plot character is changed for each subsequent redraw: Redraw No. Plot character _____________________________________________ 0 Squares 1 Triangles 2 Circles 3 Inverted Triangles 4 Stars 5 Diamonds 6 Crosses 7 No symbol DRAW/R Box Redraw the box only. DRAW/R Marks

Redraw the numbers marking the axes only

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

31

DRAW/SCREEN DRAW/S Plot to the screen (DEFAULT).

DRAW/T DRAW/T ‘o’ Set the default plot option to ‘o’. ‘o’ may be O for the SERVOGOR driver (NOT IMPLEMENTED AT OXFORD) H for the PRINTRONIX driver S for the screen 4010/4 driver (DEFAULT) Q for the POSTSCRIPT driver etc. This command is useful for macros, the macro can be run with the default option, then the default option can be set to a hardcopy device and the macro run again.

DRAW/V (no longer useful since the BBQ plotter option has been removed)

DRAW/V ‘n’ Set the pen velocity to ‘n’ cm/s.

DRAW/WAIT (not useful unless you are using a Tektronix 4010/4 terminal which seems unlikely) DRAW/W ‘v’ Insert a wait of ‘v’ seconds (‘v’ may be real) before starting the plot. This gives you time to put the terminal into GRAPHICS mode if this is required.

DRAW/X DRAW/X Prompt for the data point number after which the plot character will be changed. This will apply to the next and future plots. The default is 0.

DRAW/Y DRAW/Y ‘c’ Change the default destination for a plot to then destination specified by the character string ‘c’. ‘c’ may be @CON23, :udd:p$work:temp.plot, or @CONSOLE. It is set to @CON22 by default. NOT IMPLEMENTED AT CALTECH.

DRAW/Z DRAW/Z ‘v’ Change the interval for a dashed line used to draw the function to ‘v’. The default ‘v’ is zero (solid line). ‘v’ = 4 gives a nice dashed line, 8 gives a line with longer dashes. Approximately 250 points compose a function draw, although this may be changed with the /N switch. If ‘v’ is negative then |’v’| is used for the interval between the dashes.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

32

ECHO ECHO Write all output to the screen (DEFAULT). ECHO/D Disable echo, write all output to file ‘NUFIT.LOG’.

ERROR ERROR Modify the error bars with the transformation; ERROR = A*ERROR + B

A and B are prompted for. ERROR/P Set the errors to percentage errors. i.e. replace the current error with: ERROR = P*Y/100

The percentage error (P) is prompted for. ERROR/R Set the errors to the average error of the data file. ERROR/S Set the errors to statistical errors. i.e. replace the current

error with: ERROR = SQRT(Y) IF (Y.EQ.0) ERROR = 1 ERROR/Z Zero the error bars ERROR/L Set the non zero errors to 3 (used to retain pen control for function 9 when scaling of the y-axis has been done).

F? F? Displays the name of the data file currently loaded into

Nufit.

FIT FIT ‘n’ Perform a fit of the function to the data points. The parameters that have masks of 1 (see MASK) will be varied by a least squares method to obtain a best fit to the data. One can change the maximum number of iterations from the default of 250 to ‘n’. NOTE: The parameters must have a non-zero starting value! See also PARAM, MASK, NPAR and MODE.

FUNCTIONS The functions currently available in NUFIT are:

Function no. | Function 1 | Fermi fn B(z) = B0/(1+exp(C0+C1*z+...+C5*z^4)) 2 | Y = Yo + k1*(X+a) + k2*(X+a)^2 + k3*(X+a)^3 + ... 3 | Spare 4 | Xs=d*cubrt((Ys-Yoff)/C30*ntan(Ga))+(Ys-Yoff)/ntan( 5 | Blank function 6 | N=AT^-2/3e^(BT^-1/3-CT^2)(1+DT^1/3+..+HT^5/3)+JT^- 7 | Y = (a0 + a1*X + ...)*exp-(b0 + b1*X + ...) 8 | Spare 9 | Connect data points (if sigma equals 3, raise pen)

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

33

10 | y(x)=k3(x+a)^1/3 + k1(x+a)^-1 + k0 + l1(x+a)+... 11 | Cubic spline 12 | Histogram 13 | N=(T9^-2/3)*exp(A-(tau/T9^-1/3)(1+B*T9+C*T9^2+D*T9 14 | N=2Jl+1/2Ji+1*Gl/Gi*A*ex(B*T9+C*T9^2+D*T9^3)ex(-11 15 | Legendre’s F=K*[a0*p0+a1*p1*cos(x+x0)+a2*p2*cos(x+ 16 | Error Function 17 | Cylinder Function 18 | Linear + Gaussian (up to 16) 19 | Linear + 13 fits to shaped defined by 1st 3 gaussians 20 | S-factor function Mk.II 21 | Lorentzian S(E)=YO+So*E^2G^2/((E^2-Eo^2)^2+E^2G^2) 22 | Y = YS/(1 - K*C*X) 23 | Y = k/sqrt(1-((X-Xo)/Vo)**2) 24 | y(x) = A + B*sqrt(x+xo) 25 | Y=Yo+(Area/1.06W1)*e^(-((E-P)/1.67)^2(1/w1^2+1/W2^ 26 | Y = (B*JN(AX)/(AX)**EX))**E BESSEL FUNCTION 27 | Unused

FONT FONT ‘n’ Set the font used for all lettering on the graph to ‘n’. The default font is font 0. FONT DESCRIPTION --------------------------------- 0 ROMAN (default) 1 ALTERNATE ROMAN (normal) 2 GREEK (normal) 3 ALTERNATE ROMAN (serif) 4 GREEK (serif) 5 OLD ENGLISH 6 HELLENIC (normal) 7 HELLENIC (serif) 8 MATH Type HELP CHAR for more.

FT, FOURIER FT Take the cosine Fourier transform of the data. There are several constraints to the use of this command: 1. The data must be arranged in order of ascending X (use the ‘ORDER’ command if you are unsure). 2. The X coordinates must be equally spaced (e.g. channel numbers). The REG command to make the data equally spaced if required. 3. The number of data points must be equal to 2**n where n is an integer. If this is not the case the number of points will be automatically padded to the next largest number with zeros. 4. If the unit of the x-axis is seconds before the transform then the unit will be frequency afterwards. e.g The transform of: y = cos(2.pi.t) + cos(10.pi.t) with t in seconds is a function with two delta functions located at f = 1 Hz and f = 5 Hz.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

34

FUNCT FUNCT Change the function number. The possible functions are listed

with their corresponding function numbers. The new function number is then prompted for. FUNCT/ENABLE XLOG

Makes the argument of the function 10**X instead of X.

FUNCT/ENABLE YLOG Takes log10 of the function.

FUNCT/ENABLE SQRT Takes the square root of the function.

FUNCT/DISABLE ‘opt’ Disables the relative options as above.

Type HELP FLIST for a list of functions available. Type H/F ‘n’ for help on the specific function ‘n’

FUZZ FUZZ Convolute the data with a ‘statistical’ error.

FVAL FVAL ‘x’ Evaluate the function at point ‘x’. If ‘x’ is missing then it will be prompted for.

GAUSSIAN, AREA

Area of a Gaussian = 1.064467*height*fwhm

HATCH HATCH Allows you to do cross hatching of a rectangular region

on a plot. You will be prompted for the co-ordinates of the bottom left-hand corner of this rectangle (Xl,Yl) and the top right-hand corner (Xh,Yh). You then supply the spacing (in terms of the X-axis, and the angle (in degrees) to the X-axis. i.e. Data required: (xl,yl) (xh,yh) xspace angle HATCH ENCLOSE

Encloses the hatched area with a solid border.

HELP HELP ‘key’ Get help on a keyword. The keywords, listed by the HELP/B command, are mostly NUFIT commands or topics related to the use of NUFIT. For a short list of available commands type MENU. For a general description

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

35

of NUFIT type HELP INTRO. If the help information fills more than 20 lines, the prompt ‘Type RETURN to continue...’ will appear. At this point you can type Q to quit help if you wish. HELP/B List principle keywords only. Note that there are many secondary keywords upon which help is available. HELP/F ‘n’ Help on a specific function ‘n’. HELP/S ‘file’ Set the default help filename to ‘file’.

HOLD HOLD When used in a macro, causes the execution of the macro to stop. The macro can be made to continue by pressing RETURN (NEWLINE). This is useful for changing paper on the plotter for macros that do two or more plots.

INSERT INSERT Insert new data into a file suitable for NUFIT. The following information is prompted for:

1. Heading 2. X axis label 3. Y axis label 4. Function number (CR for none) 5. Number of parameters in the function (if relevant) 6. The parameters and their masks (if relevant)

The data points are prompted for in two ways

I. Normal mode 7. The number of data points 8. X,Y,Yerr . . . etc.

II. Incremental mode

7. Xinitial, Xfinal, Xincrement

8. Y,Yerr . . . etc.

i.e. X is supplied by the program. If X increases in constant increments then the incremental mode should be selected.

At the end of the data point insertion it is possible to correct any triplet by giving the relevant data point number. The correct triplet is then re-prompted for. You can also add further data points.

INSERT/I ‘opt’ This allows data to be inserted and immediately

plotted on the screen. Only the (x,y) coordinates of the new data points are prompted for, then plotted

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

36

(ensure a suitable plot is already on the screen). ‘opt’ selects the error bars: ‘opt’ Effect S Statistical errors. number The actual value of the (constant) error.

INTEGRATE INTEG Find the area under the data and the function. The

data uses linear extrapolation while the function is integrated with 250 steps. INTEG/M Integrates between markers 1 and 2. INTEG ‘v’ Changes the number of steps for function integration to ‘v’. A negative value will output the area to NUAREA.DAT

LABEL LABEL Plot a label on the last plot using the same plot options. The coordinates, angle, size of characters (def=1) and character string are prompted for. /I ‘v’ Set the default character size to ‘v’. /’n’ Use marker ‘n’ as the coordinates. (Set by BUMP) /A Use the coordinates of the first (X,Y) data point. /B Use the coordinates of the last (X,Y) data point. /C Center the label on the coordinate (X,Y). /N Use incremental coordinates, relative to marker 1. i.e. plot the label at coordinates (X+X1,Y+Y1) where (X,Y) are the coordinates given in response to the prompt, (X1,Y1) are the coordinates of marker 1. /R Set the X axis coordinate to the coordinate of the right edge of the box. Prompt for the Y coordinate. /S Use the label coordinates for the end of the label instead of the beginning. /T Set the Y axis coordinate to the coordinate of the top of the box. Prompt for the X coordinate. /U Combines /T and /C /V Combines /T and /S LABEL/E XLOG Take log10 of x-coordinate LABEL/E YLOG Take log10 of y-coordinate LABEL/D ... Disable log10 of coordinates

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

37

LINE (Only useful for V500 terminals. It is therefore very unlikely you will need this command) LINE TYPES: There are 8 line types available in Nufit. You can also define your own line type by selecting a negative line type. (You will be prompted for 4 lengths: 1. Length of the first solid part of a line type 2. “ blank “ “ 3. second solid “ 4. “ blank “ (As an example, line type 2 is defined by: 0.5 0.3 0.0 0.3 )

The line types apply to the ARC commands also. Usually, the line keeps drawing from where it left off. You can reset this to start a new solid section by the command DR/L R , or to a blank section with DR/L RB .

DR/L Vn sets the data level for the V500 terminal. n=0 normal: dots on n=1 dots off n=2 complement n=3 replace

Thus you may erase PARTS of the screen by selecting 1 or 2 for n.

This is extremely useful when you are experimenting with hatching,etc..

LOAD LOAD Load a column of data from multicolumn data from files with X as the first column and various Y s as the next columns. Proceed as follows: LOAD fred This loads the first column of y-values from fred.d, then LOAD 2 loads the second (etc) column of y-values. Alternatively LOAD/A 1 Prompts for the filename and then loads the first (etc) column of y-values.

LOG LOG/’opt’

Take the log base 10 of the data. /X The X axis, /Y The Y axis.

LOGIN LOGIN.NCM

Is the default Nufit login macro. This is a macro of

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

38

NUFIT command executed when you run NUFIT. It is useful for setting up any desired options for DRAWing.

@, MACRO @filename ‘arg’

Execute the macro of NUFIT commands contained in the file: ‘filename’.NCM Macros may call other macros. Lines beginning with ‘!’ are skipped.

MAKE MAKE Read in a file of data points. This command is useful for reading data that is not in standard NUFIT format. The data file may consist of columns of data points that may be in any of the following formats; Format No. of dimensions ----------------------------------------- (X,Y1,Y2,Y3,Y4,...,Y8) 8 (X,Y,deltaY) 3 (X,Y) 2 (Y) 1 (X,Y,Y1,Y2,..Yn,delY) n+3 (Y1,Y2,Y3,Y4,...,Yn) -n

The number of dimensions will be prompted for. In the case of dimension 1, the X data points are set to the index of the data in the file. In the case of dimension -n, the data is read in rows of n data points and X is set equal to the index of the data point. You can save this data into a standard NUFIT data file with the SAVE command.

MCA MCA ‘filename’ Read an unformatted binary data file containing a spectrum if it exists, otherwise a standard data file (having the MAKE/8 format) is read and an unformatted data file is written for future reference. In the latter case, you will be asked for the energy calibration. The histogram function (#12) is automatically selected. MCA/A Save the spectrum as an ASCII file, instead of an

unformatted binary file (see the MCA/S command). MCA/B Overwrite the existing NUFIT internal spectrum buffer with the present spectrum. This command must be used to save a MODIFIED spectrum with the MCA/S command. MCA/C ‘val’ Chop the useless bits from the spectrum, i.e. those

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

39

less than: E0-‘val’ keV or greater than: E0 keV If ‘val’ is zero, a default value of 1000.0 keV is assumed. MCA/D ‘opt’ Disable various options: ‘opt’ Action --------------------------------------------------- W Loading DAQ windows (see MCA/P /Q) Z Subregion of spectrum (i.e. now compress)

O Old version of data file. N Normalization of the data. P Pre-log of the data (take log before normal.) F Fix-up mode, zero first channel. S Stick mode, where the experimental parameters from the new file are not loaded, thus the parameters from the old file are retained. MCA/I ‘file’ Read the parameters of the RBS experiment from ‘file’. MCA/N Set up the parameters of the RBS experiment without saving them in a file. This command is useful whenever the energy calibration of the existing spectrum must be changed. MCA/O Reset the data to the raw data, i.e. Counts as a function of Channel number. MCA/P ‘val’ Plot the windows used to make the maps on the present spectrum. Use the element name and X-ray line (if applicable) to label the window. ‘val’ may be used to change the size of the window labels. (OXFORD ONLY) MCA/Q ‘val’ As for MCA/P except just the element name is used to label the window. MCA/R ‘file’ Set up the parameters of the RBS experiment and save them in ‘file’. These parameters are also saved with the spectrum whenever the MCA/S or VME commands are used. MCA/S Save the existing data as if it was a spectrum. That is, only the y-data point values are saved and the x-data points are assumed to be a linear function (the energy calibration) of the position of the relevant y-data point in the spectrum. MCA/U Read the ACCUSPEC data, as output from the PRNT

command. MCA/V Read the ACCUSPEC data, as output from the PRINT utility of the MCA program. MCA/W Read the data without applying the energy calibration.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

40

MASK MASK ‘val’ List the current masks of each function parameter and allow them to be changed. If ‘val’ is missing then all the masks will be given, otherwise just mask ‘val’. Mask | Action ____________________________________________ 0 | Parameter held fixed in the fit. 1 | Parameter allowed to vary in the fit. See also FIT, PARAM and NPAR.

MASS MASS Plot an atomic mass scale or label the surface energy of particular elements. This command should only be used after you have plotted a RBS energy spectrum. It is assumed that the x-axis is in units of keV. The default form of the command plots arrows above your data for the enabled elements (see below). You can also plot a mass scale for all the elements. MASS/A This command enables the mass unit scale bar mode. A mass scale bar showing the expected surface energies of all elements (or just those in a selected range, see below) is plotted above your data. MASS/E ‘Aa’ Enable plotting of element ‘Aa’. MASS/F ‘Aa’ Enable plotting of element ‘Aa’, but reduce the size of the symbol by ½. This is useful if there are a large number of crowded symbols along the scale. MASS/D ‘Aa’ Disable plotting of element ‘Aa’. MASS/C Clear the list of designated elements. MASS/I ‘val’ This enables individual mode where only the enabled elements (see below) are plotted, together with an arrow indicating the surface energy. ‘val’ is optional, it indicates the y-coordinate for plotting the symbols. If it is missing then a y-coordinate 2/3 up the plot is used instead. This option allows all the surface energy arrows to appear at the same level, instead of just above the data like the default. MASS/J As for MASS/I, except that the y-coordinate for the element symbols is chosen from the data such that the surface energy arrow is just above the data. This is the default mode. MASS/V Verify the elements that have been enabled.

MENU MENU List all possible NUFIT commands.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

41

MODE MODE ‘n’ Change the mode in the fitting routines. 1 Use the error on the data points to weight the terms in the CHISQ. 2 Use the value of the function to weight the terms in the CHISQ. 3 Use a normalised CHISQ. The default mode is 1.

MODIFY MODIFY ‘n’ Modify the data point ‘n’. The old values will be printed and the new values prompted for. ‘n’ may be greater than the current number of data points in which case the number will be extended by one.

MVAL MVAL/’n’ Load marker ‘n’ with coordinates (X,Y). The coordinates will be prompted for. The registers are the same as the markers used in bump. ‘n’ may be 1,2,3,4 or 5.

NVAR, NPAR NVAR or NPAR Change the number of variables in the function.

NORMALISATION NORM Normalise the data to a previously selected value. NORM/V Allow a region along the x-axis to be entered for

calculation of the present average height of the data for the normalisation height. NORM/I ‘val’ Initialise the normalisation height to ‘val.

ORDER ORDER Order the data file on the X data points. i.e. put the data in order of ascending X values.

OUT OUT ‘filename’ Output the last command (together with all its parameters) into file ‘filename’. ‘filename’ should be a macro file with extension ‘.NCM’. The last command is appended to the file.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

42

PARAM PARAM ‘val’ List the current value of the parameters of the function and allow them to be changed. If ‘val’ is missing then all the parameters will be given, otherwise just parameter ‘val’. This command may be abbreviated to ‘P’. PARAM/X ‘val’ Set the parameter ‘val’ to the X value of marker 1 PARAM/Y ‘val’ Set the parameter to the Y value of marker 2 PARAM/ALL List the current value of all parameters as well as the errors returned for parameters fitted with the last ‘FIT’ command. PARAM/ALL ‘filename’

Puts the output into ‘filename.LIS’. PARAM/ALL # Puts the output into the current data filename with extension ‘.LIS’.

See also NPAR and MASK.

PERIOD PERIOD Plots a periodic table on the screen using the default graphics type (see the command DR/T). For each element, the Z, mass and an extra piece of information is plotted. The extra information may be selected from this list: PERIOD/E KI Plot the kinematic factor for the present geometry in the periodic table. PERIOD/E S Plot the surface energy. PERIOD/E C Plot the Rutherford cross section. PERIOD/E X Plot the principal x-ray lines, priority to K lines PERIOD/E XL Plot the principal x-ray lines, priority to L lines PERIOD/E XM Plot the principal x-ray lines, priority to M lines PERIOD/D E Disable plotting the extra information. PERIOD/D M Disable plotting the mass numbers.

PHA PHA ‘filename’ Load a MPSYS PHA format file from disk (*.img). The syntax is as follows:

pha e1 runxyz spectrum e1 in file runxyz.img pha x2 run001 spectrum x2 in file run001.img pha e3 glass1 spectrum e3 in file glass1.img

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

43

pha region6 first spectrum in region6.img PHA/n ‘file’ Loads the first nk data points, compressing the spectrum to fit into the 1k NUFIT data buffer.

PRINT PRINT file This command is used to print the graphics generated by the Nufit macro ‘file’.ncm to a file which can then be sent to the appropriate printer. This is the easiest way to generate a Nufit graphics file for printing. Options on the command designate the different printer drivers: PRINT/Q file Postscript [DEFAULT] PRINT/P file HP-GL for powerpoint PRINT/H file HP-GL for printer See the DEFAULT command for how to select the name of the graphics file if you don’t want to use the default names.

REGUL REGULAR Redefine the x values to make them regular based on the average spacing and average value. This transformation preserves the midpoint of the data set but adjusts the spacing of the x-points so that the spacing is uniform.

REWIND REWIND Used in macros. Restarts the macro from the beginning.

ROTATE ROTATE ‘val’ Rotate the data by angle ‘val’ degrees about the origin.

ROTATE/M ‘val’ Rotate the data by angle ‘val’ degrees about marker number 1 without distortion. (Useful for drawing pictures.)

SAVE SAVE ‘filename’

Save the current data, captions, function number and current function parameters into a file ‘filename’. If ‘filename’ is absent it will be prompted for. If a blank filename is given in response to the prompt, the old name will be used (overwriting the old data). Also contained in the saved file is a record of the

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

44

last fit performed, including the errors on the parameters.

SPECIAL SPEC/’n’ Special transformation command. Transformations are only selectable by using the option ‘n’. ‘n’ Transformation ------------------------------------------------------ 1 X = k*(X+A)**2 and Y = (Y+B)/(X+B) 2 Y = Y + A*(X+B) 3 X = 10**X 4 Y = 10**Y 5 Y = Y**2 6 Y = ABS(Y) 7 Y = Y - F(X) (Error transform) 8 Y = (Y - F(X))/F(X) (% error transform) 9 X = sign(Y)*X A X = A/X B Y = Y/F(X) (Normalisation) C Y = Cumulative(Y) D Zero negative Y values. E Y = sqrt(abs(Y)) SIGMA = 0.5*SIGMA/sqrt(abs(Y)) F Zero negative X values. G Average x and y in pairs, SIGMA is difference in x-pairs. H y <= differences in adjacent y-pairs x <= average y-pairs yerr <= difference in x-pairs I Similar to H, except instead of adjacent y-pairs, a y-value is left between the pairs. J Quadrupole field component normalisation L Replace x by x*x and y by y/(x*x) N Replace SIGMA by 1/SIGMA unless SIGMA = 0 P (r,theta) to (x,y) (i.e. polar to cartesian) Q X = A0 + A1*X + A3*X**2 R X = RBS energy to mass conversion. S Y = Y*X A,B and k are prompted for if necessary. SPEC/’opt’ F Create a file of X, F(X) data points. ‘opt’ = blank use F(X) A use 10**(F(X)) L use LOG10(F(X)) SPEC/’opt’ F ‘name’ val

As for above, but ‘name’ is the filename, val is the number of steps. SPEC/’opt’ G Create a file of XX1, F(X) data points. This is used when F(X) is a function of two or more variables. SPEC/’opt’ H XX1, Y similarily.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

45

SPLINE SPLINE Fit a cubic spline through the data points. The data must be one to one, and a particular x coordinate must not appear twice with different y coordinates.

STIPPLE STIPPLE Stipple a region of the plot. The command requests: xl,yl lower left corner of region xh,yh upper right corner of region N number of stipples required STIPPLE/R Stipple a region of the plot between the data and the x-axis. In this case only the x-limits need be supplied. N will be the maximum number of stipples beneath the highest point of the region. STIPPLE E Enclose the stippled region with a solid line. Applies to both forms of the command.

Structure of the standard NUFIT data file Line 1: Title of data (up to 100 characters) Line 2: X axis label “ Line 3: Y axis label “ Line 4: Ifun,Npar (function no. and no. of parameters) Line 5: P1, P2, ... , PNpar (Values of the function parameters) Line 6: M1, M2, ... , MNpar (Values of the mask of each parameter) Line 7: Ndim (Number of extra dimensions (Integer, normally zero)) Line 8: X1, Y1, Sigma1 (The data, SigmaN is the error Line 7: X2, Y2, Sigma2 in data value YN. . . . . . . . . . Line N: XN, YN, SigmaN Uses of Ndim: NDIM = -1 Read in X,Y,Sigma1upper, Sigma1lower This is useful for log scales where the upper and lower error bars are different. The data is automatically interpreted as log data in this this case. NDIM = -2 Read in X,Y,Sigma but interpret the X data as log data. NDIM = -3 Interpret both the X and Y data as log data. This case is equivalent to both -1 and -2 combined. NDIM = ‘n’ ‘n’ is the number of extra dimensions of the X values. Useful for when the function fitted is a function of two or more variables.

Type HELP MAKE if your data is in a non-standard format.

NUFIT data file example This is an example of a NUFIT data file:

This is the heading for the plot

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

46

This is the X-axis label This is the Y-axis label 5,0 (This selects function 5, the blank function) 0 (Function 5 has no parameters) 0 (Function 5 has no masks) 0 (This is always zero, almost) 100,98,0 101,23,0 102,34.0,1 103,8.23445,9.0e-2 104,9,0 94.0,100.3,2.0

SWAP SWAP Swap the X and Y axes, leaving the error bars the same. The captions are also swapped.

TERMINAL TERM ‘n’ Set the terminal type for the TEK 4010/4 graphics emulation to type ‘n’. If the terminal type is not known, use the command without ‘n’ and a list of possibilities will be given. This command is most useful in the LOGIN.NCM macro. Initially, the terminal type is 0. It a plot is attempted with this type, the correct terminal type will be prompted for before the plot commences.

THICK THICK/’n’ ‘val’ Set the line thickness to thicker lines. ‘val’ is the magnitude of the offset (in plot units, see below) required for drawing extra lines on either side of the usual line to make the line thicker. ‘n’ is the number of extra lines to draw. e.g. Since the line thickness on the laserprinter is typically 0.02 (in plot units) then: THICK/1 0.02 gives a thicker line THICK/2 0.02 gives a much thicker line THICK/3 0.02 gives a tremendously thick line THICK/0 0 gives the normal line

VALUES VAL List the current values of the data points with their errors.

$ $’command’ Execute ‘command’ as a VAX/VMS command.

XMODIFY XMODIF Modify the X data points by the transformation; X = A*X + B

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

47

A and B are prompted for. (You may use mathematical expressions.) XMODIF/C Calibrate the X-axis. Set markers 1 and 2 on two known features of the spectrum. This command then allows the actual value of the two features to be entered so that the X-axis may be calibrated. The actual values are prompted for. XMODIF/S ‘val’ In this case the modification is applied only to those x-coordinates which correspond to y-coordinates greater than ‘val’. XMODIF/I ‘val’ In this case the modification is applied only to those x-coordinates which correspond to y-coordinates less than ‘val’.

XRAY XRAY Ab Label all the K x-ray lines for element ‘Ab’. The lines are labeled with vertical bars proportional to the relative strength of the x-ray line. XRAY Ab L Use of ‘Ab L’ allows the L x-ray lines to be labeled instead. XRAY/P Ab Plots the position of the pile-up line from the most intense line of Ab. This is labeled ‘Ab P’. XRAY/C Ab Plots the position of the Si Ka escape peak from the most intense line of Ab. This is labeled ‘Ab esc’.

Modifications:

XRAY/H ‘val’ Fix the height for plotting the x-ray lines to ‘val’. Zero means that the lines are plotted just above the data. XRAY/L ‘val’ Restricts the number of lines to be plotted to just the first ‘val’, at most, in the x-ray data base. XRAY/S ‘p’ Alter the position for plotting the x-ray line symbol. ‘p’ takes the values: L Left edge of range C Centre of range (DEFAULT) R Right edge of range XRAY/T ‘val’ Sets the threshold for the intensity of the weaker elements to ‘val’. i.e. if a line is weaker than the fraction ‘val’ of the strongest line, it is plotted as if it had strength ‘val’. XRAY/X Allows extra x-ray lines to be plotted, for example pile-up lines or escape lines. The names and energies of the extra lines are prompted for.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

48

XRAY/E U Plots the x-ray lines upside down below the spectrum. This is useful for congested spectra. The technique is as follows: XR/E U XR CU ... etc ... XR/D U

YMODIFY YMODIF Similarily to XMOD except the errors are transformed by; Error = A*Error See XMOD for the definiton of A. YMODIF/D ‘val’ Divide the y-axis and error bar by ‘val’. YMODIF/S ‘val’ In this case the modification is applied only to those x-coordinates which correspond to y-coordinates greater than ‘val’. YMODIF/I ‘val’ In this case the modification is applied only to those x-coordinates which correspond to y-coordinates less than ‘val’. YMODIF/R Take out the normalisation applied when the data was loaded. This command is only relevant to spectral data loaded with the MCA command.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

49

2.6 Examples of Nufit plot files

(1) Plotting more than one spectrum on the same plot:

Here the spectra are in three different files and the command dr/r is used to overlay the two additional spectra onto the original spectrum.

Add a label:

label

Surface energyfor RBS spectra:

mass/e timass

Enable parameters:

dr/e p

Changenumberof marks:

dr/f

Change ycaption:

cap/y

Change xcaption:

cap/x

Enable filenames:

dr/e ndr/e nm

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

50

(2) Plotting x-ray lines

This example shows use of the log/y command to change the scale of the y-axis (note that this actually does take the log of the y-axis!).

It also shows how the xr command can be used to plot the x-ray lines for the designated elements on the spectrum. With such a complicated plot, a macro is essential. Note how the name of the spectrum file and the macro filename appears on the top right of the plot.

Log scale:

log/yLabel x-ray lines incalibrated spectrum:

K lines: xr cuL lines: xr eu lPileup: xr/p cuEscape: xr/c cu

Upside down x-ray line:

xr/e uxr eu lxr/d u

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

51

(3) Fitting Gaussians to a spectrum

This example shows the use of the fit command to fit 4 Gaussians to an x-ray spectrum so that their areas can be computed. Note the significant differences between the use of statistical and regular errors. In this example, it is most appropriate to use regular errors on the data points.

Statistical Errors

Regular Errors

Note: Importantto use regularerrors!

Statistical errors(sqrt N) lead toinaccuracies inthe fit!

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

52

(4) Combined use of RUMP4 and Nufit to simulate and display a non-Rutherford scattering spectrum

The smooth curve was first simulated with RUMP4, then saved to a file. This was then displayed by Nufit, together with the experimental spectrum, on a single plot.

Data as data points:

dr/e d

Change size of marks:

dr/i 1.25

Change size of data points:

dr/j 1.25

Small diagram insert

sub filename

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

53

(5) Combined use of RUMP4 and Nufit to simulate and display a channelling and random spectrum

The nufit macro for this is rather complicated!

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

54

Appendix One

How to fit a function to a data set using Nufit A function consisting of two Gaussians on a linear background is fitted to a small part of a PIXE spectrum. The fitted function can then be used to determine the x-ray line peak areas, even though the two Gaussians may overlap each other. The FWHM of the Gaussians is a measure of the detector energy resolution. Bold courier font indicates what you would type in from the keyboard. fit> mca s1053x 1024 points in data file. Statistical errors selected. Y-axis normalized. Fix-up mode: first channel zeroed. X-RAY spectrum. fit> dr x Xmin to Xmax (CR for -.14778 to 38.272 ) > 5 7.6 Ymin to Ymax (CR for 0.00000E+00 to 24722. ) > fit> bu 1: X = 6.0769 Y = 1573.6 2: X = 7.3169 Y = 745.39 X1-X2 = -1.2400 Y1-Y2 = 828.21 fit> fun 18 Function number set to 18 Linear + Gaussian (up to 16) fit> np 8 Number of parameters set to 8 fit> p 1 variable Yintercept= 0.000000000000000E+00 > 700 2 variable Gradient= 0.000000000000000E+00 > 0.01 3 variable Height 1 = 0.000000000000000E+00 > 20000 4 variable Centre 1 = 0.000000000000000E+00 > 6.4 5 variable Fwhm 1 = 0.000000000000000E+00 > .2 6 variable Height 2 = 0.000000000000000E+00 > 3000 7 variable Centre 2 = 0.000000000000000E+00 > 7.1 8 variable Fwhm 2 = 0.000000000000000E+00 > .2 fit> dr/r fit> dr/e d Data point drawing enabled . fit> dr

Draw over a restricted range

Into bump (crosshair) mode and select out portion of spectrum to be fitted

Setlect function 18 (linear plus Gaussian)

Function can fit one linear componnent and up to 16 Gaussian components. 2 parameters are required for the linear part, 3 for each Gaussian. Hence a total of 8 parameters are required to describe the linear part and two Gaussians.

Set starting value of parameters

Must have reasonably good guesses of fit will not converge.

Redraw function to check guess

Alternatively: Enable data and draw afresh. This will show data and function.

Load a PIXE spectrum from a file s1053x.mca

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

55

fit> err/r All errors set to the average error 302.61 fit> ma Mask of parameter 1 , Yintercept is 0 new > 1 Mask of parameter 2 , Gradient is 0 new > 1 Mask of parameter 3 , Height 1 is 0 new > 1 Mask of parameter 4 , Centre 1 is 0 new > 1 Mask of parameter 5 , Fwhm 1 is 0 new > 1 Mask of parameter 6 , Height 2 is 0 new > 1 Mask of parameter 7 , Centre 2 is 0 new > 1 Mask of parameter 8 , Fwhm 2 is 0 new > 1 fit> fit> fit No. parameters active = 8 Starting CHI**2 = 678.10 Iteration 1 mode 1 chi-sq = 678.10 Iteration 2 mode 1 chi-sq = 1.9895 Iteration 3 mode 1 chi-sq = 1.5030 Iteration 4 mode 1 chi-sq = 1.4460 Iteration 5 mode 1 chi-sq = 1.4421 Iteration 6 mode 1 chi-sq = 1.4405 Iteration 7 mode 1 chi-sq = 1.4376 1 Yintercept = 992.69 error = 331.22 2 Gradient = 5.8913 error = 50.157 3 Height 1 = 17808. error = 196.78 4 Centre 1 = 6.4062 error = 1.01305E-03 5 Fwhm 1 = .19692 error = 2.77033E-03 6 Height 2 = 2678.4 error = 202.51 7 Centre 2 = 7.0842 error = 6.63576E-03 8 Fwhm 2 = .19105 error = 1.82389E-02 After 7 iterations. Final CHI**2 = 1.4376 fit> dr fit> fit> save fe-lines fit> exit

Set the error on each data point to the mean error of the data set. This is a subtle point, it is necessary to do this for statistical data (like a spectrum) especially when the statistics are low. This will prevent the least squares fit giving erroneous results.

Set the fit mask fror each parameter in the function. A mask of 1 means that the parameter is allowed to vary during the fit. A mask of 0 means that the paramter must remain fixed.

Start fitting! Fit should converge in around 10 iterations. Fit toutine author is Chris Ryan. Chi-sq should be 1 - 2 for a good fit.

Errors in fitted prameters are derived from error bars on original data and the sensitivity of the fit to the result. High sensitivity means small error.

Draw afresh to see data with the fitted function.

It is a good idea to save the results in a standard Nufit data file (*.fit) so that the data and the fitted functin can be recalled in the future.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

56

Appendix Two

How to produce an HP-GL file from a macro using Nufit This appendix shows how to print a graph that is generated from a pre-existing macro. To print a graph it is necessary to create a plot file that is sent to the printer. Each printer needs a different sort of plot file. (Plot files in the HP-GL format can be inserted into POWERPOINT4 presentations.) It used the print command. Options on the print command control what sort of plot file is created. The options are: print/p macroname HP-GL for portrait format print/h macroname HP-GL for landscape format print/q macroname Postscript for the Baker lab laser printer print macroname The same as print/q Normally Nufit will create a filename for the plot file. This will be plt001.ps (etc) for postscript and H1.hgl or P1.hgl (etc) for the other options. In the example here, a new plot file name is specified in the macro. fit> print/p sic Ready to print....macro: sic Default option set to P fit> def/q sic.ps fit> def/p sic.hgl fit> dr/e s Spectral plot mode enabled. fit> dr/e p Parameter drawing enabled. fit> dr/e nm Macro name labeling on drawing enabled. fit> dr/e d Data point drawing enabled. fit> mca sicran1 1024 points in data file. Statistical errors selected. Y-axis normalized. Fix-up mode: first channel zeroed. RBS spectrum. fit> ave/c 2 Compress the data. 2 old data points grouped to form 1 new data point. X replaced by means, Y and Yerr by weighted means.

Override the default plot file names for the q (postscript) and p (powerpoint) options.

Everything below this line is generated by the commands in the macro.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

57

Old number of data points 1024, new number: 512 fit> norm/v Region for average normalisation height ( 0. to 0.) > 1200,1300 Normalise to a height of 279.89 fit> fun 5 Function number set to 5 Blank function fit> ! fit> dr/d nm Macro name labeling on drawing disabled. fit> dr/d n Name labeling on drawing disabled. fit> dr/d p Parameter drawing disabled. fit> dr/i 1.2 fit> dr/j 1.2 Symbol size factor set to 1.20 fit> dr/c -5 Line width set to : 5.00 fit> fit> dr x Xmin to Xmax (CR for 129.67 to 3314.5 ) > 701 1600 Ymin to Ymax (CR for 0.00000E+00 to 1271.0 ) > Starting the generation of a HP-GL file: option P Opening HP-GL plot file: P1.hgl Making a plot with the x-axis horizontal. fit> dr/c -8 Line width set to : 8.00 Setting pen width= 1.20 colour= 1 fit> dr/r box fit> dr/c -5 Line width set to : 5.00 Setting pen width= .75 colour= 1 fit> fit> mass/c All elements disabled. fit> mass/e si fit> mass/e c fit> mass fit> !

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

58

fit> !mca sicbad1 fit> !dr/e d fit> !dr/1 fit> !ave/c 2 fit> !fun 5 fit> !norm fit> !dr/r fit> fit> dr/d d Data point drawing disabled. fit> mc sic170 Simulation of C-Si 1024 points in data file. Statistical errors selected. Y-axis normalized. Y-axis normalized. Fix-up mode: first channel zeroed. RBS spectrum. fit> xm Scale the X coordinates New X = A*(Old X) + B : A, B > +1,-5 fit> norm Normalisation complete - normalisation factor 11.535 fit> fun 9 Function number set to 9 Connect data points (if sigma equals 3 raise pen) fit> dr/c -6 Line width set to : 6.00 Setting pen width= .90 colour= 1 fit> dr/r fit> dr/c -5 Line width set to : 5.00 Setting pen width= .75 colour= 1 fit> fit> sub geom 170 degree detector geometry Coordinates for subplot (x,y) > +1250,700 Scale factor for subplot > +1 fit> fit> la/u Y coordinate set to 1271.0 X coordinate > +1150 Orientation (degrees, CR for 0) > +0 Character size (CR for 1.000) > +1.2

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

59

Label (130 characters max.) > +^kSimulation for SiC Non-Rutherford fit> fit> fit> dr/t s Default option set to S fit> close HP-GL plot file closed: P1.hgl Plot done with x-axis horizontal fit> @ fit> fit> exit

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

60

Appendix Three

RUMP4 simulations including non-Rutherford cross sections This appendix shows how to generate simulated RBS spectra using our special custom version of RUMP (Rutherford Backscattering for Upwardly Mobile Professionals) known as RUMP4. In this case, all the commands have been stored in a macro file sic.rmc, however all commands could also be typed from the keyboard. Bold courier font indicates the bare minimum of commands you could type to generate the simulation. Unbold courier font indicates optional commands that are sometimes necessary to get a good simulation. dnj@tauon:data/dnj/sic% rump [RUMP version -4.0] c1985 Larry Doolittle Non-Rutherford cross section option. Loading atomic data from /usr/local/lib/djap/ATOMIC.DAT Reading atomic data: file "/usr/local/lib/djap/ATOMIC.DAT" Username set to dnj Rump> @ sic Opening a macro: sic.rmc Rump> mev 1.6 Rump> beam h Rump> phi 10 Rump> con 2,0 Rump> omega 1 Rump> charge 1 Rump> sim SIM Command: la 1 SIM Command: com si 1 c 1 / Element name is SI Element name is C SIM Command: th 100000 a SIM Command: nonr si c / Since you have flagged non-Rutherford elements, please remember to set SUBLAYER to a large number so that resonances in the cross section are not missed by the simulation! eg SUBLAYER 1000

run RUMP on tauon/mozart/pion

run the macro of RUMP commands sic.rmc

beam energy in MeV

beam particle (choices: h, he+, he++)

detector angle (NOT scattering angle)

energy calibration (keV/channel, keV of channel 0)

detector solid angle in msr

beam dose in microC

enter simulation sublevel

layer 1

composition of layer 1 (stoichiometry)

thickness of layer in Ångstroms Other options are possible for thickness unit for advanced users

specify non-Rutherford elements

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

61

SIM Command: db SICO170 Non-Rutherford cross section data base file: SICO170 SIM Command: show 1 layers in simulation. # Thickness Sublayers Composition . . . 1 100000.00 A SI 1.000 C 1.000 Non-Rutherford elements: Si C You are now working on layer # 1 SIM Command: ret Rump> pl 0 Automatic simulation Reading cross section data from SICO170 Experimental cross section used for C Isotope mass .00000 m.u Scattering angle 170.00000 degrees, Energy range from 1.00000 to 3.50 MeV As the isotopic mass is zero, the cross section in the data base will apply to all isotopes of this atomic number. Experimental cross section used for Si Isotope mass .00000 m.u Scattering angle 170.00000 degrees, Energy range from 1.00000 to 3.60 MeV As the isotopic mass is zero, the cross section in the data base will apply to all isotopes of this atomic number. Non-Rutherford data is for scattering angles close to 170.00 degrees Rutherford cross section in use outside the range 1.00 to 3.60 MeV. ...........................performed. Device set to NULL in SETDEV Rump> nu m sic Writing the SIMULATION buffer 0 Option = M Default filename: temp.mca Output in file sic.mca Rump> end Rump> exit dnj@tauon:data/dnj/sic% It is now possible to run Nufit to load and display the simulation. The simulation generated by these commands is shown here.

verfiy sample structure

exit simulation sublevel

Select database that provides the non-Rutherford cross sections. Must be in upper case. Must be in current directory.

perform simulation

Note carefully the energy range for which the non-Rutherford cross section data is available from the database you have selected and the energy range for which the Rutherford cross section is used.

save simulated spectrum in a Nufit spectral data file sic.mca

end of macro

exit RUMP

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

62

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

63

Appendix Four

The RBS program - Surface energy approximation The program RBS may be used to perform analysis of RBS spectra using the surface energy approximation. It is sometimes useful to do this before performing a RUMP4 simulation. This example shows how to get started with the calculation of a sample stoichiometry from the step heights in a RBS spectrum. Use Nufit to first find the step heights in the spectrum. Bold courier font indicates the minimum commands needed to perform the calculation. dnj@tauon: % rbs -------------------------------------------------------------------- Depth scale and Energy Calibration for a RBS spectrum Surface Energy Approximation -------------------------------------------------------------------- rbs> det -------------------------------------------------------------------- Experimental details: Beam, Energy, Calibration, Detector and Tilts -------------------------------------------------------------------- Beam energy ( 0.00000E+00) MeV > 2 Beam energy set to : 2.000 MeV Projectile atom () > he Reading file > /usr/local/lib/djap/he.ele Stopping powers from element data files. Theta 1 = .00, Theta 2 = .00 degrees Incident angle, detector angle (to surface normal, deg) > 0,35 Incident angle :.00 degrees Detector angle : 35.00 degrees Recalculate the energy calibration ? (Y/N) > n Energy per channel ( 0.00000E+00) keV/ch > 3.456 Energy per channel set to : 3.45600 keV/ch Energy of channel zero ( 0.00000E+00) keV > 34.6 Energy of channel zero set to : 34.60 keV Target tilt angle ( 0.00000E+00) degrees > 0 Target tilt angle set to : .00 degrees Enter 0 to give the detector area and distance OR detector solid angle in millisteradians ( 0.00000E+00) > 30 Deposited charge, particle microCoulombs ( 0.00000E+00) > 0.43 Charge deposited on target : .430 microC

Enter the details opf the experimental parameters in your RBS spectrum.

Note: This is the detector angle, not the scattering angle!

Note that the analysis performed here is not sensitive to the energy calibration, but it does not hurt to enter it anyway.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

64

Detector energy resolution ( 20.000 ) keV > Detector energy resolution : 20.000 keV rbs> com Enter all elements in the film, including 'zero concentration' contaminants: Element 1 in film (e.g. Si or <RET> to end) > si Reading file > /usr/local/lib/djap/si.ele Number of Si atoms per film molecule > 1 Element 2 in film (e.g. Si or <RET> to end) > o Reading file > /usr/local/lib/djap/o.ele Number of O atoms per film molecule > 2 Element 3 in film (e.g. Si or <RET> to end) > Density of film ( 0.00000E+00) Molecules/cm3 > Density of film : 0.00000E+00 Mol./cm3 Stopping powers from element data files. rbs> den -1 Film density set to 1.51156E+22 molecule/cm3 1.5069 g/cm3

Now enter best guess for starting composition of sample.

This strange command tells the program to guess the density of the sample based on the weighted mean of the densities of the individual elements. This is a bad approximation for most compounds! However the analysis here is not sensitive to the density. Only conversion of energy loss to a depth in microns requires accurate knowledge of the sample density.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

65

rbs> show Film density: 1.51156E+22 molecule/cm3, composition: Ele. Frac. At. Num. At. Wt. At. Den. Sp. G. Kine. F. Surf E. keV ---------------------------------------------------------------------- 0 He .000 2 4.003 .00000 .205 1 Si 1.000 14 28.086 5.00000 2.330 .59314 1186.28 2 O 2.000 8 15.990 4.30200 1.140 .39377 787.54 Element [e] 1e-15eVcm2/atom [S] eV/Angstrom Angstrom/ch Surface Ch ---------------------------------------------------------------------- 1 Si 259.14 39.17 ( 39.17) 88.231 333.2 2 O 250.00 37.79 ( 37.79) 91.456 217.9 NB: [S] and Angstrom/ch. include effect of .00 degree tilt, [e] does not, bracketed figure is [S] without tilt.) 2.000 MeV He beam, incidence angle .00 deg., detector angle (to tilt plane) 35.00 deg., calibration 3.4560 keV/chan and offset 34.60 keV. For 3.00 keV detector resolution, the minimum depth resolution in Si is 76.59 Angstrom which is .9 channels. rbs> rbs> menu Commands are: EFFECT MASS SURFAC COMP SHOW LIST DENSIT DETAIL FIT HEIGHT @ ! $ CROSS EXIT START HELP MENU DEPTH DEFAUL CALIB RANGE SAVE SET DANGER DEDX MEV SELECT FILE WEIGHT THICK DBASE CONV rbs> fit --------------------------------------------------------------------- rbsC - Composition of a multi-element film. --------------------------------------------------------------------- Number Element 1 Si 2 O Number of element 1 in film (0 to end) > 1 Number of element 2 in film (0 to end) > 2 Enter surface heights:

A quick printout of the RBS parameters for this sample.

This command reminds you of all possible RBS commands.

The fit command allows the stoichiometry of the sample to be determined from the step heights in a RBS spectrum. Use Nufit to measure the step heights.

First indicate which elements are of interest, in this case all of them are.

Next, enter the step heights measured from the spectrum.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

66

1: Height of Si in RBS spectrum > 257 3: Height of O in RBS spectrum > 165 Starting Iterations... Iteration : Si O 0 1.0000 2.1163 1 1.0000 2.0408 2 1.0000 2.0413 3 1.0000 2.0413 -------------------------------------------------------------------- Compound is: 1.0000(Si)+ 2.0413(O ) + Another run with different heights? (Y/N) > n rbs> danger --------------------------------------------------------------------- Danger energy at which the projectile (He) penetrates the nucleus --------------------------------------------------------------------- Element Danger Energy (MeV) ------------------------------------ Si 9.47 C 5.39 O 6.53 rbs> exit

The procedure in Chu, Mayer and Nicolet is then followed to iterate to the correct stoichiometery.

You should always do this again with independently measured step heights in order to check for the errors on your measurement.

This command checks to see if the Rutherford cross section is appropriate for the calculation. It is NOT in this case!!

Many other surface energy calculations are possible!

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

67

Appendix Five

Finding the spot size from an edge scan It is possible to use Nufit to fit an appropriate function to an edge scan in order to estimate the diameter of the scanned spot. Typically Nufit would be running in a spare window on the X-terminal and be used to operate directly on the data as it is collected by MpSys. Here is an example of how this task could be accomplished. Step 1: Collect a grid scan using MpSys. Any possible signal can be used for the image: RBS, PIXE, IBIC, etc. Step 2: Create the map of the signal from the grid, using the markers in the x- or y-spectrum to select out a narrow window on the image. Alternatively, just do a line scan over the grid itself. In this case go to Step 5. Step 3: If required, MpTools can be used to rotate the map to align the grid with the x- or y-axis.

Here are examples of this rotation:

Before After Step 4: Sum the map to create a line scan. MpTools can be used to do this as shown on the next page. If the data is already in the form of a line scan then this step is not necessary.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

68

This creates an acsii file on disk which can now be loaded into Nufit. Step 5: Load the data into Nufit and fit an appropriate edge function. Bold courier font indicates the minimum commands needed to perform the calculation. dnj@Head-dnj:~/grid scan% nu NUFIT - V 7.3 Macro library directory set to: /home/dnj/bin/ Help file set to: /home/dnj/bin/nufit.hlp Executing the login macro: /home/dnj/bin/login.ncm fit> dr/e n Name labeling on drawing enabled. fit> dr/e p Parameter drawing enabled. fit> dr/e nm Macro name labeling on drawing enabled. fit> dr/d d Data point drawing disabled. fit> dr/e s Spectral plot mode enabled. fit> fun 12 Function number set to 12 Histogram fit> font 1 Default font set to 1. fit> term 8 fit> dr/d f Five marks disabled. fit> dr/e closed Solid data points enabled. fit> def/q Scale factor for next plot > +0.9

Start Nufit on your system

Everything here is in the login.ncm macro which runs at startup

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

69

X and Y plot offsets (mm) > +10,0 fit> dr/c -3 Line width set to : 3.00 fit> @ fit> make/1 cx2r_1x.txt 79 points in data file. Fit> draw fit> bu

fit> xm/c Calibrate the X-axis. Actual value of marker 1 > 0 Actual value of marker 2 > 127 Calibration: Xnew = 4.2861 *Xold + -96.931 Don't forget to change the X-axis label (CAP/X). fit> cap/x Current title New title (<CR> to retain) > Position (^2l^cm)

End of login macro

Load data from disk. If the data is present as a line scan, use the pha command instead

Use bump to put maker 1 and marker 2 on the peaks that indicate one grid period

Draw the data on the screen

In bump mode, use the pointer and type “1” and “2” to position maker 1 and marker 2. Quit bump with “q”

Use xm/c to tell Nufit the true value of maker 1 and 2. Here the grid period was 127 microns.

Change the caption on the x-axis to show the new units which is micron in this case. Note the way Nufit does microns.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

70

fit> dr fit> bu fit> dr fit> fun 16 Function number set to 16 Error Function fit> np 5 Number of parameters set to 5 fit> p 1 variable Y0 = 0.00000000000000 > 10000 2 constant Y1 = 0.00000000000000 > 3 constant Height = 0.00000000000000 > 20000 4 constant FWHM = 0.00000000000000 > 5 5 constant Position = 0.00000000000000 > 80 fit> err/s Statistical errors, New error = sqrt(Y) fit> err/r All errors set to the average error 133.82 fit> dr/e d fit> dr

Draw again to show the recalibrated x-axis, then use bump with commands “1”, “2” and “w” to select out one grid period for fitting..

Draw again to be ready to guess the starting parameters for the fit.

Select the Error Function and designate 5 parameters appropriate to this function.

Enter the best guess for the starting parameters. Note that Y0 and Y1 are a linear background.

Enable data points (if the statistics are poor, error bars will become visible) then draw again and see how this is not a very good guess, but it will do.

Select statistical errors and set to average (if appropriate).

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

71

fit> fit> ma Mask of parameter 1 , Y0 is 1 new > 1 Mask of parameter 2 , Y1 is 0 new > Mask of parameter 3 , Height is 0 new > 1 Mask of parameter 4 , FWHM is 0 new > 1 Mask of parameter 5 , Position is 0 new > 1 fit> fit No. parameters active = 4 Starting CHI**2 = 149.98 Iteration 1 mode 1 chi-sq = 83.504 Iteration 2 mode 1 chi-sq = 82.459 Iteration 3 mode 1 chi-sq = 82.189 Iteration 4 mode 1 chi-sq = 82.254 Iteration 5 mode 1 chi-sq = 82.346 Iteration 6 mode 1 chi-sq = 82.417 Iteration 7 mode 1 chi-sq = 82.401 1 Y0 = 10450. error = 36.709 3 Height = 20304. error = 62.277 4 FWHM = 17.084 error = 1.57244E-04 5 Position = 78.328 error = 4.99560E-04 After 7 iterations. Final CHI**2 = 82.401 fit> dr

fit> sav Filename for output (CR for cx2r_1x.fit) > Data saved in file cx2r_1x.fit

Use this command to identify which variables in the function will be allowed to vary in the fit.

Fit the function to the data.

Draw again and look at the fit. The FWHM here is in microns in the example.

Save the file into a “fit” file which will store the data and the new function for future use. Use the default file name.

Guidebook: A Guide to the MARC Software Suite (Including Nufit Reference Guide)

Microanalytical Research Centre

72

fit> fun 17 Function number set to 17 Cylinder Function fit> fit No. parameters active = 4 Starting CHI**2 = 380.43 Iteration 1 mode 1 chi-sq = 283.99 Iteration 2 mode 1 chi-sq = 188.83 Iteration 3 mode 1 chi-sq = 77.649 Iteration 4 mode 1 chi-sq = 67.548 Iteration 5 mode 1 chi-sq = 64.364 Iteration 6 mode 1 chi-sq = 63.643 Iteration 7 mode 1 chi-sq = 63.581 1 Y0 = 10661. error = 37.144 3 Height = 19806. error = 64.195 4 Diameter = 22.304 error = 0.28514 5 Position = 78.247 error = 6.97014E-02 After 7 iterations. Final CHI**2 = 63.581 fit> dr

fit> sav Filename for output (CR for cx2r_1x.fit) > cx2r_1x-cyl Data saved in file cx2r_1x-cyl.fit fit> e Done!

Now try again with a new function – a cylinder function in this case.

Now try again with a new function – a cylinder function in this case. Use the error function fit as the starting point.

Draw again and we can see the fit is more appropriate to this large spot.