Wrote a program that makes an SRM color chart in the sRGB color space.
I don't have access to ASTM E-308, but guesstimating what it says:
1.) The following gives a transmission spectrum that when integrated gives an XYZ value with a C-Illuminant and a 10 degree observer.
That has nothing to do with ASTM E-308. This formula, as it appears in the Wikipedia article, is derived from a double exponential fit to the
average of the normalized (to the absorption at 430 nm) spectra of 99 beers measured in an investigation of beer color. That ensemble included several fruit beers (lambics, krieks, blueberry wheat....) and so is representative of a large universe of beers but is redder than the average normalized spectrum of malt only beers. Un-normalizing by multiplying by the absorption of a beer with a given SRM at 430 nm (SRM/12.7) gives the absorption of a
spectrally average beer in 1 cm. Taking the antilog of the negative of this gives the transmission of a
spectrally average beer in 1 cm.
2.) Chromatically adapt the value from the previous step to the native sRGB D-65 Illuminant using a Bradford adaptation matrix.
The quality of the illuminant and color space don't come into it yet. The first thing you need to do is determine what path (thickness of beer) you are interested in and determine the transmission spectrum in that thickness. This is done by scaling the 1 cm absorption spectrum by the thickness in cm before taking the antilog. Thus if the path is 5 cm (typical beer glass width?) then you would multiply by 5 before taking the antilog. ASTM E-308 comes into play when you have the transmission spectrum of the thing whose color you wish to determine. The first step is to multiply the transmission spectrum by the power distribution spectrum of the particular illuminant you are interested in. That product is then point wise multiplied by samples from each of three color matching functions, one each for X,Y and Z, and the products summed (separately for X,Y and Z) and each sum is normalized by 100 divided by the dot product of the illuminant spectrum with the Y color matching function. These give values for the color in X, Y, Z, coordinates. This can be transformed into any space derived from X, Y, Z (such as L,a,b, R,G,B ...) by using the proper formulae.
3.) Convert the value from the previous step to RGB using the sRGB D-65 Illuminant conversion matrix.
In E-308 the illuminant is accounted for before the color matching functions are applied. One could, of course, pre-compute x, y and z vectors (CMF's) for each illuminant of interest. This is a little counter productive as the D family spectra are computed as a function of coordinated color temperature from three eigen functions and for maximum flexibility one usually does that. Of course if you are only interested in D65 you can pre-compute for D65. It is worthy of note that the ASBC in its tristimulus MOA (Beer 10 C) uses Illuminant C, a 1 cm path and the 10° observer (there are two sets of x, y and z CMF vectors depending on whether the beer subtends 2° or 10° at the viewer's eye.
The details of the calculation can be found in most color science books and are used in the spreadsheet at
http://wetnewf.org/pdfs/Brewing_articles/MOAWorkbook.xls
which contains the 2° and 10° color matching functions, the A, C and F illuminant spectra and the ability to compute the D illuminant spectra (all the numbers are on a third sheet as are the X,Y,Z; L,a,b; and R,G,B calculations). It's going to take a bit of figuring out (there are some instructions) but in essence you paste a beer's absorption spectrum (there are examples on a fourth sheet) into the first column and specify a path and illuminant in return for which it calculates 2° and 10° colors in L,a,b and R,G,B (based on the Rec. 709 primaries). It also calculates 'spectral deviation coefficients' which are measures of the degree to which a particular beers actual normalized spectrum differs from the average normalized spectrum. If you put an SRM value without specifying any SDC's (all entries in that column 0) the spreadsheet calculates the colors of the average beer with that SRM which is, I think, what you are actually after.
This produces a reasonable chart.
The problem that you will find is that the colors of beer in any reasonable path with any but very small SRMs are much more saturated (red) than any monitor, film or printing process can produce. The sRGB gamut is particularly limited.
My question is for those that have access to ASTM E-308, what is the algorithm that it specifies?
1. Choose an observer, 2° or 10°. Obtain the vectors x, y and z for that observer (these are in the spreadsheet).
2. Choose an illuminant and obtain (or compute) its spectrum: S.
3. Calculate the normalizing constant c = 100/<S,y> where <S,y> is the dot product of S and y.
4. Compute the transmission spectrum of the beer, t, from the average spectrum formula considering the path or from measurements of the actual beer.
5, Compute the light coming through the beer by multiplying, for each wavelength, S by t: t' = {S*t}
6. Compute
X = c*<t',x>
Y = c*<t',y>
Z = c*<t',z>
7. Transform to L,a,b (set all elements of t to 1 and compute Xw, Yw and Zw, the white point, first).
8. Transform to other color spaces.
Is there a better method?
Depends on what you are trying to do. If you are interested in color differences there are better spaces than L,a,b but L,a,b is generally considered good enough. If you want to compute CIE colors this is the only way as x,y and z define what these colors are.
If you want more information you'll have to go to a color text or search the internet. I've found the X,Y,Z to L,a,b formulas there and even the color matching functions (you need the set with 5 nm spacing). If you are interested in the particulars of the work that led to the transmission formula you quoted and the spreadsheet PM me and I'll send you a .pdf of the paper.