MEIS Macros

In the course of my work I've adapted a few Igor Pro macros to do various things, mainly relating to different r-factors. I also fixed several bugs in the implementation of the macros.

Igor Pro MEIS Macros

The MEIS data produced from Daresbury MEIS Facility are analysed using a variety of macros written for the Igor Pro software package. I've adapted the macros originally written by Paul Bailey of Daresbury, mainly to use different r-factors but also to correct a number of bugs in the exact implementation of what the macros are supposed to do. These are made available here, along with a record of the bug fixes.

These macros have been tested in Igor Pro v3.10, v3.16 and presumably should work in later versions. Note that all macros working with XVEGAS have been modified to correctly load and use second element data. Also all files have been corrected so scaling takes the average of experimental data between the cursors, rather than over the entire loaded set (this is consistent with the calculation of the average simulation). A valuable discussion of various r-factors which may be applicable to MEIS data analysis may be found in T. C. Q. Noakes, P. Bailey & D. P. Woodruff, Nucl. Instrum. Meth. B v. 136-138 pg. 1125 (1998) and P. Bailey, T. C. Q. Noakes & D. P. Woodruff, Surf. Sci. v. 426 pg. 358 (1999).

Bug Fixes

Several bugs within the macros have been fixed. These are documented here for reference. All bug fixes have been applied to all appropriate macros hosted on this site.

  1. The *101.pxp macros, which deal with XVEGAS output, have been modified to correctly handle multiple element data (old behaviour was it was actually reading total scattering yield as the first element and then the first element data as the second element, this didn't matter so long as there was only one element).
  2. The scaling of data has been corrected to use the average of the experimental data between the cursors (old behaviour was to take the average of the entire loaded data, which caused problems when there was "junk" on the ends).
  3. When scaling data the macro was using the previous altered experimental curve to find the average. If the data was skewed it would use the skewed data from the previous comparison, if not then it would use simply the scaled data from the previous comparison. With skewing turned off this resulted in the average oscillating between two (both incorrect) values. With skewing turned on the bug is difficult to spot because skewing also scales (but without the fix still incorrectly). The average is now calculated using the stored, original data, between the cursors (see bug #2).
  4. Whoops. It seems that in adding y-curve display to the Pendryflip macros, the calculation of the r-factor got broken. This has been fixed.
  5. Pendryflip macros now update the y-function graphs etc without having to manually change the displayed simulation once the r-factor calculation is complete.
  6. Related to Bug #2 and Bug #3 The intitial display of the comparison graph was still calculating scaling incorrectly (this doesn't affect displays once the displayed sim number has been changed). This is now fixed.
  7. Found an error in the calculation of the IS r-factor (which was the reason the r-factor for the first simulation was always reported as NAN but was actually more sever than that). This is now fixed. R-factors calculated without this correction should be taken as unreliable. Sorry!
  8. Actually, contrary to my initial report this bug doesn't affect all the macros, just some. When calculating a r-factor such as chi-squared, the data is rescaled to the experimental yield, in order for the statistics to work correctly. To do this the average value of the original experimental data is needed. It seems that the average of the current, scaled down, data was being used (I think this bug was probably introduced as a result of one of the earlier bug fixes but frankly this code is so messy it's hard to tell). It doesn't seem to make a difference to the solution picked for the 2D silicide test data I checked with. The corrected routines are densqr (I don't think I actually ever had the scaling quite right there), nox, PhD and vegasanalysis.