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



retstr = al_be_erosion_many_v2(ins)

The MATLAB web server calls this function when the erosion rate 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, if 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 twelve 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 additional discussion of elevation-atmospheric pressure relationships, see the text of the main 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. $ ^{10}$Be concentration. Atoms $ \cdot$ g$ ^{-1}$. Standard or scientific notation.
  10. Uncertainty in $ ^{10}$Be concentration. Atoms $ \cdot$ g$ ^{-1}$. Standard or scientific notation.
  11. $ ^{26}$Al concentration. Atoms $ \cdot$ g$ ^{-1}$. Standard or scientific notation.
  12. Uncertainty in $ ^{26}$Al concentration. Atoms $ \cdot$ g$ ^{-1}$. Standard or scientific notation.

Here is an example of an acceptable input text block:

FV-TOP-1 38.6139 -109.1878 2527 std 2 2.5 1 4.59e5 1.3e4 2.69e6 8.80e4
FV-TOP-2 38.6136 -109.1955 2580 std 2 2.5 1 202000 8000 1100000 49000
FV-TOP-3 38.6204 -109.2062 2592 std 2 2.5 1 1.02e6 2.60e4 6.05e6 1.31e5
O4-AV-PIT9-NEW -77.8282 160.9762 1300 ant 2 1.9 0.973 6710000 116000 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_erosion.m, which actually carries out the erosion rate calculation and returns the result. Finally, this function assembles the output data, generates the required plots, inserts the output data into the output HTML template, and returns the completed results web page.

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}$ (2)

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

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