retstr = al_be_age_many_v2(ins,localFlag)
The MATLAB web server calls this function when the exposure age data input form is submitted. It takes as input a structure containing string variables, which is supplied by the MATLAB web server. It returns a text string consisting of an output HTML document containing the results of the exposure age calculation. The documentation for the MATLAB web server describes this process in more detail.
There is only one required argument, the input structure
ins. The fields are as follows:
|ins.text_block||A text block containing sample information that follows the rules below.|
|ins.requesting_IP||The IP address of the requesting page. This is only required when localFlag is not set to 1, that is, when the function is in use on the web server.|
The formatting rules for entering a text block containing data for multiple samples are as follows:
In most cases, pasting directly from an Excel spreadsheet should satisfy the rules. An example of an acceptable input text block appears below.
The thirteen elements are as follows. These are the same as the input parameters on the single-sample form.
Here is an example of an acceptable input text block:
PH-1 41.3567 -70.7348 91 std 4.5 2.7 1 8e-5 123500 3700 712400 31200 01-MBL-059-BBD -77.073 -145.686 712 ant 4.75 2.65 0.997 0 0 0 1.9e6 4.9e4 NH-1 57.968 -6.812 790 std 3 2.65 1 0 943000 28000 0 0
The optional argument
localFlag turns off most of the server-specific system calls in this function. This option exists only for debugging the function externally to the web server, and is not very well generalized. If
localFlag is set to 1, the function returns a structure of string variables containing only the chunks of HTML that report results, not a single string variable containing the the entire output web page. In addition, plots are created locally, and all of them have names beginning with 'temp.' Of course, not only does this result in repeated overwriting of plots, it requires GMT and ImageMagick to be running locally. Thus, calls to the plotting functions will generate numerous errors on many systems. This aspect of the code would need to be rewritten for general use.
The majority of this function consists of routines that check the input data to make sure it is in the expected form and is within expected bounds, and convert string variables to numerical values. After the data checking is complete, the function then assembles the data sets needed for the Al and Be exposure age calculations, loads the data file containing values for physical constants, and passes data to the function
get_al_be_age.m, which actually carries out the exposure age calculation and returns the result. Finally, this function assembles the output data, calls additional functions to generate the required plots, inserts the output data into the output HTML template, and returns the web page containing the results.
The only actual calculation that takes place inside this function is the calculation of the uncertainty in the Al Be ratio. Denote the Al/Be ratio by and its uncertainty by . Assuming linear, uncorrelated uncertainties:
where is the concentration of nuclide and is its analytical uncertainty.