tadd scrollspy, change limits - cosmo - front and backend for Markov-Chain Monte Carlo inversion of cosmogenic nuclide concentrations
 (HTM) git clone git://src.adamsgaard.dk/cosmo
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 9e704f6e5c33a57dd9374eb1191af0864ab79570
 (DIR) parent fdda8f0332e66e01af8b749793b176dc435ac16a
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Fri, 20 Nov 2015 12:16:53 +0100
       
       add scrollspy, change limits
       
       Diffstat:
         M js/history-form-prefiller.js        |       6 +++---
         M matlab/generate_plots.m             |     190 ++++++++++++++++++++++++++++++
         M pages/methods.html                  |     124 +++++++++++++++++++------------
       
       3 files changed, 270 insertions(+), 50 deletions(-)
       ---
 (DIR) diff --git a/js/history-form-prefiller.js b/js/history-form-prefiller.js
       t@@ -84,17 +84,17 @@ var PrefillMachine2 = {
        
                $("#rock_density").val("2650");
                
       -        $("#epsilon_gla_min").val("1.0e-6");
       +        $("#epsilon_gla_min").val("1.0e-5");
                $("#epsilon_gla_max").val("1.0e-1");
        
       -        $("#epsilon_int_min").val("1.0e-6");
       +        $("#epsilon_int_min").val("1.0e-5");
                $("#epsilon_int_max").val("1.0e-1");
        
                $("#t_degla_min").val("10000");
                $("#t_degla_max").val("12000");
        
                $("#record_threshold_min").val("3.7");
       -        $("#record_threshold_max").val("4.7");
       +        $("#record_threshold_max").val("4.5");
        
            }
        }
 (DIR) diff --git a/matlab/generate_plots.m b/matlab/generate_plots.m
       t@@ -731,3 +731,193 @@ html = [html, '    </tbody>\n'...
        fileID = fopen(filename,'w');
        fprintf(fileID, html);
        fclose(fileID);
       +
       +
       +%% generate html table of input parameters
       +filename = [save_file, '-input.html'];
       +disp('Saving html table of input values')
       +
       +% header
       +html = [...
       +    '\n'...
       +    '<table class="highlight">\n'...
       +    '    <thead>\n'...
       +    '        <tr>\n'...
       +    '            <th data-field="param">Parameter</th>\n'...
       +    '            <th data-field="param">Percentile</th>\n'];
       +
       +for i=1:Nwalkers
       +    html = [html, ...
       +        '            <th data-field="w1">Walker ', num2str(i), '</th>\n'];
       +end
       +
       +% epsilon_int
       +html = [html, ...
       +    '            <th data-field="avg">Average</th>\n'...
       +    '        </tr>\n'...
       +    '    </thead>\n'...
       +    '    <tbody>\n'...
       +    '        <tr>\n'...
       +    '            <td>&nbsp;</td>\n'...
       +    '            <td align="center">25%%</td>\n'];
       +for i=1:Nwalkers
       +    html = [html, '            <td>',...
       +        num2str(epsilon_int_25(i),3),'</td>\n'];
       +end
       +    
       +html = [html, '            <td>',...
       +    num2str(sum(epsilon_int_25)/Nwalkers,3),'</td>\n'...
       +    '        </tr>\n'...
       +    '        <tr>\n'...
       +    '            <td align="center">&epsilon;<sub>int</sub> [m/Myr]</td>\n'...
       +    '            <td align="center">50%%</td>\n'];
       +
       +for i=1:Nwalkers
       +    html = [html, '            <td>',...
       +        num2str(epsilon_int_50(i),3),'</td>\n'];
       +end
       +
       +
       +html = [html, '            <td>',...
       +    num2str(sum(epsilon_int_50)/Nwalkers,3),'</td>\n'...
       +    '        </tr>\n'...
       +    '        <tr style="border-bottom:1px solid #D0D0D0">\n'...
       +    '            <td>&nbsp;</td>\n'...
       +    '            <td align="center">75%%</td>\n'];
       +
       +for i=1:Nwalkers
       +    html = [html, '            <td>',...
       +        num2str(epsilon_int_75(i),3),'</td>\n'];
       +end
       +
       +html = [html, '            <td>',...
       +    num2str(sum(epsilon_int_75)/Nwalkers,3),'</td>\n'...
       +    '        </tr>\n'];
       +
       +
       +% epsilon_gla
       +html = [html, ...
       +    '        <tr>\n'...
       +    '            <td>&nbsp;</td>\n'...
       +    '            <td align="center">25%%</td>\n'];
       +for i=1:Nwalkers
       +    html = [html, '            <td>',...
       +        num2str(epsilon_gla_25(i),3),'</td>\n'];
       +end
       +    
       +html = [html, '            <td>',...
       +    num2str(sum(epsilon_gla_25)/Nwalkers,3),'</td>\n'...
       +    '        </tr>\n'...
       +    '        <tr>\n'...
       +    '            <td align="center">&epsilon;<sub>gla</sub> [m/Myr]</td>\n'...
       +    '            <td align="center">50%%</td>\n'];
       +
       +for i=1:Nwalkers
       +    html = [html, '            <td>',...
       +        num2str(epsilon_gla_50(i),3),'</td>\n'];
       +end
       +
       +
       +html = [html, '            <td>',...
       +    num2str(sum(epsilon_gla_50)/Nwalkers,3),'</td>\n'...
       +    '        </tr>\n'...
       +    '        <tr style="border-bottom:1px solid #D0D0D0">\n'...
       +    '            <td>&nbsp;</td>\n'...
       +    '            <td align="center">75%%</td>\n'];
       +
       +for i=1:Nwalkers
       +    html = [html, '            <td>',...
       +        num2str(epsilon_gla_75(i),3),'</td>\n'];
       +end
       +
       +html = [html, '            <td>',...
       +    num2str(sum(epsilon_gla_75)/Nwalkers,3),'</td>\n'...
       +    '        </tr>\n'];
       +
       +
       +% record_threshold
       +html = [html, ...
       +    '        <tr>\n'...
       +    '            <td>&nbsp;</td>\n'...
       +    '            <td align="center">25%%</td>\n'];
       +for i=1:Nwalkers
       +    html = [html, '            <td>',...
       +        num2str(record_threshold_25(i),3),'</td>\n'];
       +end
       +    
       +html = [html, '            <td>',...
       +    num2str(sum(record_threshold_25)/Nwalkers,3),'</td>\n'...
       +    '        </tr>\n'...
       +    '        <tr>\n'...
       +    '            <td align="center">&delta;<sup>18</sup>O<sub>threshold</sub> [&permil;]</td>\n'...
       +    '            <td align="center">50%%</td>\n'];
       +
       +for i=1:Nwalkers
       +    html = [html, '            <td>',...
       +        num2str(record_threshold_50(i),3),'</td>\n'];
       +end
       +
       +
       +html = [html, '            <td>',...
       +    num2str(sum(record_threshold_50)/Nwalkers,3),'</td>\n'...
       +    '        </tr>\n'...
       +    '        <tr style="border-bottom:1px solid #D0D0D0">\n'...
       +    '            <td>&nbsp;</td>\n'...
       +    '            <td align="center">75%%</td>\n'];
       +
       +for i=1:Nwalkers
       +    html = [html, '            <td>',...
       +        num2str(record_threshold_75(i),3),'</td>\n'];
       +end
       +
       +html = [html, '            <td>',...
       +    num2str(sum(record_threshold_75)/Nwalkers,3),'</td>\n'...
       +    '        </tr>\n'];
       +
       +% E
       +html = [html, ...
       +    '        <tr>\n'...
       +    '            <td>&nbsp;</td>\n'...
       +    '            <td align="center">25%%</td>\n'];
       +for i=1:Nwalkers
       +    html = [html, '            <td>',...
       +        num2str(E_25(i),3),'</td>\n'];
       +end
       +    
       +html = [html, '            <td>',...
       +    num2str(sum(E_25)/Nwalkers,3),'</td>\n'...
       +    '        </tr>\n'...
       +    '        <tr>\n'...
       +    '            <td align="center">E [m]</td>\n'...
       +    '            <td align="center">50%%</td>\n'];
       +
       +for i=1:Nwalkers
       +    html = [html, '            <td>',...
       +        num2str(E_50(i),3),'</td>\n'];
       +end
       +
       +
       +html = [html, '            <td>',...
       +    num2str(sum(E_50)/Nwalkers,3),'</td>\n'...
       +    '        </tr>\n'...
       +    '        <tr style="border-bottom:1px solid #D0D0D0">\n'...
       +    '            <td>&nbsp;</td>\n'...
       +    '            <td align="center">75%%</td>\n'];
       +
       +for i=1:Nwalkers
       +    html = [html, '            <td>',...
       +        num2str(E_75(i),3),'</td>\n'];
       +end
       +
       +html = [html, '            <td>',...
       +    num2str(sum(E_75)/Nwalkers,3),'</td>\n'...
       +    '        </tr>\n'];
       +
       +
       +% footer
       +html = [html, '    </tbody>\n'...
       +    '</table>\n'...
       +    ];
       +fileID = fopen(filename,'w');
       +fprintf(fileID, html);
       +fclose(fileID);
 (DIR) diff --git a/pages/methods.html b/pages/methods.html
       t@@ -1,57 +1,76 @@
        <div class="section no-pad-bot" id="index-banner">
            <div class="container">
       +
                <br><br>
       -        <!-- page header -->
       -        <h1 class="header center orange-text">Methods</h1>
        
       -        <!-- page subheader
       -        <div class="row center">
       -            <h5 class="header col s12 light">Markov-Chain Monte Carlo inversion
       -                of exposure age or erosion rates</h5> </div>-->
       +        <div class="row">
       +            <div class="col s12 m9 l10">
        
       -        <p>
       -            Cosmogenic nuclides are typically used to either constrain an
       -            exposure age, a burial age, or an erosion rate. Constraining the
       -            landscape history and past erosion rates in previously glaciated
       -            terrains is, however, notoriously difficult because it involves a
       -            large number of unknowns. The potential use of cosmogenic nuclides
       -            in landscapes with a complex history of exposure and erosion is
       -            therefore often quite limited. Here, we present a novel
       -            multi-nuclide approach based on the Markov Chain Monte Carlo (MCMC)
       -            technique.  The model framework currently incorporates any
       -            combination of the following nuclides <sup>10</sup>Be,
       -            <sup>26</sup>Al, <sup>14</sup>C, and <sup>21</sup>Ne, and is highly
       -            flexible.
       -        </p>
       +                <h1 class="header center orange-text">Methods</h1>
        
       -        <h3 class="header blue-text">Markov-Chain Monte Carlo (MCMC) basics</h3>
       -        <p>bla bla</p>
       +                <div id="introduction" class="section scrollspy">
       +                    <h3 class="header blue-text">Introduction</h3>
       +                    <p>
       +                    Cosmogenic nuclides are typically used to either constrain
       +                    an exposure age, a burial age, or an erosion rate.
       +                    Constraining the landscape history and past erosion rates in
       +                    previously glaciated terrains is, however, notoriously
       +                    difficult because it involves a large number of unknowns.
       +                    The potential use of cosmogenic nuclides in landscapes with
       +                    a complex history of exposure and erosion is therefore often
       +                    quite limited. Here, we present a novel multi-nuclide
       +                    approach based on the Markov Chain Monte Carlo (MCMC)
       +                    technique.  The model framework currently incorporates any
       +                    combination of the following nuclides <sup>10</sup>Be,
       +                    <sup>26</sup>Al, <sup>14</sup>C, and <sup>21</sup>Ne, and is
       +                    highly flexible.
       +                    </p>
        
       -        <h4 class="header blue-text light">What is a MCMC walker?</h4>
       -        <p>bla bla</p>
       +                    <p>In the following we give a basic overview of the applied
       +                    methods and their application. For a full description see
       +                    the open-access publication by <a
       +                        href="http://www.sciencedirect.com/science/article/pii/S1871101415300558">Knudsen
       +                        et al. (2015)</a>.</p>
       +                </div>
        
       -        <h3 class="header blue-text">Two-stage glacial-interglacial model</h3>
       -        <p>bla bla</p>
       +                <div id="mcmc" class="section scrollspy">
       +                    <h3 class="header blue-text">
       +                        Markov-Chain Monte Carlo (MCMC) basics</h3>
       +                    <p>bla bla</p>
       +                </div>
        
       -        <p>For a full description of the methods and application possibilities,
       -        see the open-access publication by <a
       -                href="http://www.sciencedirect.com/science/article/pii/S1871101415300558">Knudsen
       -                et al. (2015)</a>.
       +                <div id="mcmcwalker" class="subsection scrollspy">
       +                    <h4 class="header blue-text light">
       +                        What is a MCMC walker?</h4>
       +                    <p>bla bla</p>
       +                </div>
        
       -        <h3 class="header blue-text">Citing the MCMC cosmo calculator</h3>
       -        If you use the results generated by this tool in a
       -        scientific publication, please acknowledge this fact by citing:</p>
       -        <blockquote>
       -            Knudsen, M.F., Egholm, D.L., Jacobsen, B.H., Larsen, N.K., Jansen,
       -            J.D., Andersen, J.L., Linge, H.C., 2015.<br>
       -            <b>A multi-nuclide approach to constrain landscape evolution and
       -                past erosion rates in previously glaciated terrains.</b></br>
       -            Quaternary Geochronology 30, 100-113,
       -           doi:10.1016/j.quageo.2015.08.004.
       -        </blockquote>
       -        <p>You may use the following BibTeX entry:</p>
       -        <div class="row">
       -            <pre><code class="language-markup col s12">        @article{Knudsen2015,
       +                <div id="twostage" class="section scrollspy">
       +                    <h3 class="header blue-text">
       +                        Two-stage glacial-interglacial model</h3>
       +                    <p>bla bla</p>
       +                </div>
       +
       +
       +                <div id="citing" class="section scrollspy">
       +                    <h3 class="header blue-text">
       +                        Citing the MCMC cosmo calculator</h3>
       +
       +                    <p>If you use the results generated by this tool in a
       +                    scientific publication, please acknowledge this fact by
       +                    citing:</p>
       +                    <blockquote>
       +                        Knudsen, M.F., Egholm, D.L., Jacobsen, B.H., Larsen, N.K., Jansen,
       +                        J.D., Andersen, J.L., Linge, H.C., 2015.<br>
       +                        <b>A multi-nuclide approach to constrain landscape evolution and
       +                            past erosion rates in previously glaciated terrains.</b></br>
       +                        Quaternary Geochronology 30, 100-113,
       +                        doi:10.1016/j.quageo.2015.08.004.
       +                    </blockquote>
       +
       +                    <p>You may use the following BibTeX entry:</p>
       +                    <div class="row">
       +                        <pre><code class="language-markup col s12">        @article{Knudsen2015,
                        author = "Knudsen, M. F. and Egholm, D. L. and Jacobsen, B. H.
                            and Larsen, N. K. and Jansen, J. D. and Andersen, J. L.
                            and Linge, H. C.",
       t@@ -67,10 +86,21 @@
                        issn = "1871-1014",
                        doi = "http://dx.doi.org/10.1016/j.quageo.2015.08.004",
                    }
       -            </code></pre>
       -        </div>
       -
       +                        </code></pre>
       +                    </div>
       +                </div>
        
       +            </div>
        
       +            <div class="col hide-on-small-only m3 l2">
       +                <ul class="section table-of-contents">
       +                    <li><a href="#introduction">Introduction</a></li>
       +                    <li><a href="#mcmc">Markov-Chain Monte Carlo</a></li>
       +                    <li><a href="#mcmcwalker">MCMC walkers</a></li>
       +                    <li><a href="#twostage">Two-stage model</a></li>
       +                    <li><a href="#citing">Citing</a></li>
       +                </ul>
       +            </div>
       +        </div>
            </div>
        </div>