Programs - Postgrad - ANGLIA

Program ANGLIA


Originally called UVFIT, when conceived in terms of fitting UV (Ultraviolet, or Ultraviolet & Visible) absorption spectra, it became REWFIT when the coding was slightly modified to cope with fitting CD (Circular Dichroism) spectra as well, in which case the bands may be negative as well as positive. This also emphasised my role as originator of the program, as SFM always refused to acknowledge that this was a legitimate line of research, and invariably referred to it as "that program from ICI"!

Eventually, when catchy acronyms became de rigueur for large general purpose computer programs (think POLYATOM, ATMOL, LAOCOON, etc.) REWFIT was rebranded as ANGLIA. This acknowledged its genesis at the University of East Anglia of course, and also managed to be a genuine acronym:

ANGLIA = Automated Nonlinear Gaussian Lorentzian Intensity Analysis

But it might equally well have been:

ANGLIA = Automatic Numerical Gaussian Lorentzian Iterative Analysis


UVFIT was developed on the Ferranti ATLAS computer at Harwell (so called, as the joke went in the nuclear physics community, who were evidently well-versed in Greek mythology in those days, because "it held up research"). To postgraduate students, however, it seemed immensely glamorous and powerful. But there was no RJE (remote job entry) at that time and to gain access one either had to visit Harwell by car or send ones card decks there and back by post. The latter option involved sturdy laundry boxes with leather straps, and the computer operators at the ATLAS Computing Laboratory would unpack the boxes, read each deck separately into the ATLAS system and then return the decks, together with line-printer output, in the same laundry boxes. With luck, one got two turn-rounds a week. It actually worked pretty smoothly, especially if one of the resident programming professionals at ACL had cast an expert eye over ones naive and amateurish source code and tweaked it into shape. And there was a treasure trove of state-of-the-art numerical algorithms freely available from the Harwell Subroutine Library; five of these, for solution of linear simultaneous equations, are incorporated in ANGLIA. An in-house version of Fortran II, called HARTRAN, was in use at the time, and a surprising discovery for me is that there had actually been a Fortran I and later a Fortran III, though they never seemed to surface outside the IBM environment:

J Backus "The History of Fortran I, II, and III," IEEE Annals of the History of Computing, Vol. 20, Issue 4, October 1998

Anybody even remotely interested in the history of the Golden Age of British mainframe computing will find a wealth of fascinating information and reminiscence at the following link:

By the end of my first postgraduate year the UEA Computer Centre had opened, conveniently adjacent to the School of Chemical Sciences, and so I gladly took advantage of the tenfold improvement in turn-round that was now possible on the in-house ICL 1905E, on which ICL Fortran IV was now available. It was also hugely beneficial to have the advice and support of the Computer Centre's resident consultant, Dr. Ortwin Treutler, who indeed contributed more or less off the cuff the lineprinter plotting routine used in ANGLIA. An exceptionally nice chap, with a very quick and perceptive mind, he was however confined to a wheelchair by multiple sclerosis. Of German descent, his immediate family had relocated to live in Norfolk, as recounted in the link, from which I was deeply sorry to learn of his early death from MS in about 1979/80.

Following the move to the Chemistry Department of Kings College London, as indicated in the About/Education subunit, ANGLIA was now migrated to the University of London's Control Data Corporation (CDC) 7600, saying farewell for ever to British hardware. CDC Fortran IV necessitated quite a lot of tweaks to the code, but there was also a very intriguing option called Fortran V that had originated at the University of Edinburgh. It had some really good facilities, such as IF-THEN-ELSEIF-ELSE statements and character-string handling that wouldn't reappear until the advent of the PC. Such a lost opportunity to forestall the horrendous miasma of Microsoft Visual Basic.

Finally, during spare time at the University of Bristol, as also indicated in the About/Education subunit, I harmonised all the dialect variations in ANGLIA in conformance with IBM Fortran IV, and that's the way it currently remains.


The burgeoning functionality encoded within ANGLIA (using the name retrospectively) is a fine example of Tom Lehrer's dictum, immortalised in the song about N I Lobachevsky: "Plagiarise!" Not in the sense of stealing other people's work, but by engaging with fellow students, or members of academic staff, and letting their steel strike sparks from your flint, generating moments of inspiration that you would never have gained from sitting at a desk on your own. Your interlocutors might well be totally unaware that you have just had a Mazda Moment (in the Zoroastrian rather than automotive sense).

The first MM was when I confided in a third-year colleague AB that I didn't know how to get started with programming. In a rather throwaway manner, but meaning well, he suggested something he'd tried but it just wouldn't work, how to assess the experimental intensities of overlapping individual bands in UV spectra. He'd tried least squares but they just went round in circles.

Well, this sounded like a challenge, so I duly went to the textbooks on numerical analysis and set up the approximate linear equations that permit an iterative approach to a solution even in a situation where the parameters are embedded in a non-linear function or set of functions. And I programmed the equations, and their solutions, and AB was quite right, it just didn't converge to an unequivocal answer, even with dead simple trial spectra. Nevertheless, I'd got off the mark with programming, though was still at base camp as far as a Ph D was concerned.

But then I got into conversation with NCP, a lofty being from Oxbridge who was already well-established in a very highbrow research topic, which just happened to involve a very similar computational requirement. And as we spoke, a MM suddenly suggested to me that the linear equations would remain linear even if some second-order contributions were included along with the first-order ones. With this modification the iterative procedures suddenly started to converge much more purposefully to a physically-reasonable characterisation of the overlapping bands.

A very important prerequisite in this kind of computation is that a physically realistic number of participant entities have been identified, and that a fair estimate of their sizes, shapes and likely locations is available. And that's when the next MM duly materialised. A colleague RSM had happened to work alongside some visitors from ICI (Imperial Chemical Industries, an iconic British organisation now sadly ancient history) during a long nightshift at ACL, had mentioned this particular problem, and they'd said they just logarithmised sections of the spectrum where one (Gaussian) band seemed to dominate. This effectively linearised the region in question and good initial estimates could easily be extracted. Within a day or two I had this fully proceduralised into ANGLIA, both for Gaussians and for Lorentzians.

Once the dominant band was approximately characterised in this way, it could be subtracted from the spectrum, and the same process repeated iteratively would result in a rather random residue from which quite clearly no further bands could merge. This was the justly celebrated process of stripping.

But a further MM awaited. It was clear that the residue would still contain valuable information as to how an amalgamation of the stripped bands would fail to match the original spectrum exactly. So the stripped bands might be systematically improved by 'splashing' them with the residue one by one and restripping them, slightly altering their parameterisation and diminishing the residue still further. This simple-minded process worked very well, and became known as refinement. Stripping and refinement together gave the Least Squares the essential base-data from which to attain a hopefully optimum solution.

But the Least Squares procedure, even if given good initial estimates, was quite capable of overstepping the target and then meandering off into a distant and entirely inappropriate corner of 'solution space'. But during a social conversation with a distinguished visiting Hungarian academic, Dr Arpad Kiss, it emerged that he knew of work published in Hungarian which might well address this very problem. Furthermore, he was kind enough to translate it into English, and though I didn't entirely understand the maths involved I could grasp the recommended algorithm, insertion of a 'damping' term into the diagonal elements of the matrix, and incorporated it into ANGLIA forthwith. So not exactly a MM, but certainly a serendipity.

The final piece of the fitting jigsaw, and definitely a MM, was the realisation that the bands would stand out far more clearly from one another if subjected to an integral transformation that retained their functionality but reduced their widths. Providing the transformation was linear, this could of course be achieved en masse by performing a numerical quadrature of the spectrum itself, without foreknowledge of the band parameters. This convolution option was duly incorporated into ANGLIA, but I don't think it was ever explored by the user-base at UEA.

Though totally unrelated to the band-fitting specification, the spectral moments and Kronig-Kramers options were bolted on like extra Gothic turrets. I don't suppose they would be helpful to the average user, but they intrigued me, particularly the K-K transform, which relates absorption to dispersion, and differential absorption (CD) to optical rotatory dispersion (ORD) dependent of course on structural dissymmetry.

Algebraically it is in fact rather interesting that a band-shape function is completely defined by its spectral moments (just as a charge distribution is characterised in every respect by a knowledge of all its multipole moments). Further details are given in the next reference below.

Back To The Future

The state of the art some ten years following the development of ANGLIA was comprehensively reviewed by Barker and Fox:

Barry E. Barker and Malcolm F. Fox,
Computer Resolution of Overlapping Electronic Absorption Bands,
Chemical Society Reviews,1980, Vol 9, Issue 2, pp 143-184.

I must admit to disappointment now to learn (via Google) that the authors pay only cursory attention to ANGLIA and indeed report that it had seriously underperformed in the instance considered. I would have appreciated an opportunity at that time to investigate this (as it might have revealed a rectifiable program error, or simply a suboptimal choice of input options), especially as the latter author had been in quite lengthy correspondence with me during the preparation of the review.

However, it is quite possible that they did give more consideration to the following work, revealed by Google:

Geoffrey C. Allen & Robert F. McMeeking,
Deconvolution of spectra by least-squares fitting,
Analytica Chimica Acta, Mar 1978, Vol 103, Issue 1, Pages 73-108

Spectra of varying complexity appear in several areas of surface studies and analytical chemistry, and computer programs are used to determine the positions and areas of individual spectral bands. The methods used for the deconvolution of spectral data are described together with a computer program which has been developed for this purpose. The application of the program to the analysis of spectral bands obtained from various spectroscopic techniques is discussed.

But not, of course, the following work some years later, also revealed by Google:

Peter Jochum and Erich L. Schrott,
Deconvolution of multicomponent ultraviolet/visible spectra,
Analytica Chimica Acta, Volume 157, 1984, Pages 211-226

A reliable method based on non-negative least squares is suggested for the deconvolution of spectra of chemical and biochemical mixtures into their individual components. The efficiency of the method is demonstrated by use of artificial inorganic salt mixtures of defined composition as well as of real carotenoid samples of considerable complexity, the results for which are compared with those of conventional chromatography. The problem of error propagation is discussed and compared to the sensitivity of standard least-squares and n-wavelengths algorithms.

Plus a variety of excerpts relating to the use of Excel Solver to achieve a cut-price result:

Excel for Chemists: A Comprehensive Guide
by E. Joseph Billo, John Wiley & Sons, Date unknown
Deconvolution of Spectra pp 318-321

Excel for Chemists: A Comprehensive Guide
by E. Joseph Billo, John Wiley & Sons, Apr 2004
Deconvolution of Spectra pp 344-348

Excel for Chemists: A Comprehensive Guide
by E. Joseph Billo, John Wiley & Sons, Sep 2004
Deconvolution of Spectra pp 476-480

Beyond this meagre trawl there is no sign of further active research in this admittedly very specific area. Maybe everything is already done and dusted.

But almost purely for my own amusement, I have now migrated the source-code of ANGLIA to PC, and am in the process of generating a working executable. In concert with an interactive data-entry preprocessor and a graphical post-processor it will leap-frog into the twenty-first century, and will be made freely available to potential users who make enquiry via the OrnaVerum main menu Contact option.

User Documentation

Click ANGLIA Theory for extract of Ph D Thesis Chapter 4

Click ANGLIA Architecture for table of routines and which-does-what

Click ANGLIA Card Input for manual data input formats if no pre-processor yet

Click ANGLIA Version Control for cumulative release details

Passworded User DownLoads

Click ANGLIA Source Code for download of Fortran Main & Subroutines

Click ANGLIA Executable for download of compiled & linked Executable

Click ANGLIA Application for download of Launcher, Pre- & Postprocessors