next up previous contents
Next: al_be_erosion_many_v2.m Up: Wrapper scripts and control Previous: Wrapper scripts and control   Contents

al_be_age_many_v2.m

Syntax:

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:

  1. Enter plain ASCII text only.
  2. Each sample should occupy its own line.
  3. Each line should have thirteen elements, as described below.
  4. Elements should be separated from each other by white space (spaces or tabs).
  5. Something other than white space must be entered for each element. For example, if you have no $ ^{26}$Al measurements for a sample, you must enter `0' in the $ ^{26}$Al concentration and $ ^{26}$Al uncertainty positions.

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.

  1. Sample name. Any text string not exceeding 24 characters. Sample names may not contain white space or any characters that could be interpreted as delimiters or escape characters, e.g., slashes of both directions, commas, quotes, colons, etc. Stick to letters, numbers, and dashes.
  2. Latitude. Decimal degrees.
  3. Longitude. Decimal degrees.
  4. Elevation/pressure. Meters or hPa, respectively, depending on selection below.
  5. Elevation/pressure flag. Specifies how to treat the elevation/pressure value. This is a three-letter text string. If you have supplied elevations in meters and the default atmosphere is applicable at your site (locations outside Antarctica), enter `std' here. If you have supplied elevations in meters and your site is in Antarctica, enter `ant' here. If you have entered pressure in hPa, enter `pre' here. Any text other than these three options will be rejected. For further discussion of altitude-atmospheric pressure relationships, see the main text of the paper.
  6. Sample thickness. Centimeters.
  7. Sample density. g $ \cdot$ cm$ ^{-3}$.
  8. Shielding correction. Samples with no topographic shielding, enter 1. For shielded sites, enter a number between 0 and 1. The shielding correction can be calculated using skyline.m.
  9. Erosion rate inferred from independent evidence. cm $ \cdot$ yr$ ^{-1}$.
  10. $ ^{10}$Be concentration. Atoms $ \cdot$ g$ ^{-1}$. Standard or scientific notation.
  11. Uncertainty in $ ^{10}$Be concentration. Atoms $ \cdot$ g$ ^{-1}$. Standard or scientific notation.
  12. $ ^{26}$Al concentration. Atoms $ \cdot$ g$ ^{-1}$. Standard or scientific notation.
  13. Uncertainty in $ ^{26}$Al concentration. Atoms $ \cdot$ g$ ^{-1}$. Standard or scientific notation.

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 $ ^{26}$Al and $ ^{10}$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 $ ^{26}$Al $ ^{10}$Be ratio. Denote the $ ^{26}$Al/$ ^{10}$Be ratio by $ R_{26/10}$ and its $ 1\sigma$ uncertainty by $ \sigma R_{26/10}$. Assuming linear, uncorrelated uncertainties:

$\displaystyle \left( \sigma R_{26/10} \right) ^{2} = \left(\frac{\sigma N_{26}}{N_{10}} \right)^{2} + \sigma N_{10}^2 \left( \frac{-N_{26}}{N_{10}^2} \right)^{2}$ (1)

where $ N_{i}$ is the concentration of nuclide $ i$ and $ \sigma N_{i}$ is its $ 1\sigma$ analytical uncertainty.


next up previous contents
Next: al_be_erosion_many_v2.m Up: Wrapper scripts and control Previous: Wrapper scripts and control   Contents
2007-11-13