<!DOCTYPE HTML>

<!-- PyAuDiSam: Automation of Distance Sampling analyses with Distance software (http://distancesampling.org/)

     Copyright (C) 2021 Jean-Philippe Meuret
     
     This program is free software: you can redistribute it and/or modify it under the terms
     of the GNU General Public License as published by the Free Software Foundation,
     either version 3 of the License, or (at your option) any later version.
     This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
     without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     See the GNU General Public License for more details.
     You should have received a copy of the GNU General Public License along with this program.
     If not, see https://www.gnu.org/licenses/.
-->

<head>

  <meta charset="utf-8">
  <meta name="author" content="Jean-Philippe Meuret"/>
  <meta name="copyright" content="Jean-Philippe Meuret 2021"/>
  <meta name="license" content="CC BY NC SA"/>
  <meta name="description" content="{{title}}"/>
  <meta name="keywords" content="distance, sampling, mcds, pre-analysis, {{keywords}}"/>
  <meta name="datetime" content="{{genDateTime}}"/>
  
  <title>{{title}}</title>
  
  <link rel="stylesheet" media="screen" type="text/css" href="./report.css">
  
  <script>
    // Back to top floating button managment
    // When the user scrolls down 100 px from the top of the document, show the button
    window.onscroll = function()
    {
    	if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100)
    		document.getElementById("toTopBtn").style.display = "block";
    	else
    		document.getElementById("toTopBtn").style.display = "none";
    }
    // When the user clicks on the button, scroll to the top of the document
    function scrollToTop()
    {
    	document.body.scrollTop = 0;
    	document.documentElement.scrollTop = 0;
    }
  </script>
  
</head>

<body>

  <table id="title">
    <tr>
      <td style="font-size: 480%; text-align: center">{{title}}</td>
    </tr>
    <tr>
      <td style="font-size: 240%; text-align: center">{{subtitle}}</td>
    </tr>
    <tr>
      <td style="font-size: 120%; text-align: center">{{description}}</td>
    </tr>
  </table>
  
  <div style="margin-left: 10px">

    <h4>
      {{tr['Table of contents']}}
    </h4>
    
    <div class="chapter" style="margin-left: 10px">

      <ul>
        <li><a href="#super-synthesis">{{tr['Quick-view results']}}</a></li>
        <li><a href="#traceability">{{tr['Traceability']}}</a></li>
      </ul>
      
    </div>
        
    <h2 id="super-synthesis">
      {{tr['Quick-view results']}}
    </h2>
    
    <div class="chapter" style="margin-left: 10px">

      <p>{{tr['Study type:']}} {{surveyType}}, {{distanceType}}, {{clustering}}.</p>
      <p>{{tr['Units used:']}} {{distanceUnit}} {{tr['for distances']}}, {{areaUnit}} {{tr['for areas']}}.</p>
      <p>{{tr['Confidence value interval:']}} {{tr['If not listed in table below, please']}}
         {% if confIntervals|length > 1 %} {{tr['BE AWARE that different values have been used among analyses']}}: {{confIntervals|join(', '|safe)}}
         {% else %} {{tr['note that all analyses have been run with the same value']}}: {{confIntervals[0]}}
         {% endif %}
         {% if confIntervals|length > 1 %} ({{tr['see details for each analysis']}}){% endif %}.
      </p>
      <p>{{tr['Estimator selection criterion:']}} {{tr['If not listed in table below, please']}}
         {% if estimSelCrits|length > 1 %} {{tr['BE AWARE that different values have been used among analyses']}}: {{estimSelCrits|join(', '|safe)}}
         {% else %} {{tr['note that all analyses have been run with the same value']}}: {{estimSelCrits[0]}}
         {% endif %}
         {% if estimSelCrits|length > 1 %} ({{tr['see details for each analysis']}}){% endif %}.
      </p>
      <p>{{tr['Note: Some figures rounded, but not converted']}}</p>
      <p style='font-size: 80%'>{{tr['Click on analysis # for details']}}</p>
      
	  {{supersynthesis}}

    </div>
        
    <img class="center" height="32" style="margin-top: 30px"
         src="./fa-feather-alt.svg" alt="---" />

    <h2 id="traceability">
      {{tr['Traceability']}}
    </h2>
    <div class="chapter" style="margin-left: 10px">

      <p>{{tr['Traceability tech details']}}</p>

      {% for name, table in traceability.items() %}
        <div style="margin-left: 10px">
          <h3>{{name}}</h3>
          {{table}}
        </div>
      {% endfor %}
      
    </div>
    
    <h6 style="margin-bottom: 10px">
      {{tr['Page generated']}} {{tr['on']}} {{genDateTime}}
      {{tr['with']}} <a href="https://www.python.org/" target="_blank">Python {{libVersions['Python']}}</a>,
      <a href="https://numpy.org/" target="_blank">NumPy {{libVersions['NumPy']}}</a>,
      <a href="https://pandas.pydata.org/" target="_blank">Pandas {{libVersions['Pandas']}}</a>,
      <a href="https://github.com/polixir/ZOOpt/" target="_blank">ZOOpt {{libVersions['ZOOpt']}}</a>,
      <a href="https://matplotlib.org/" target="_blank">Matplotlib {{libVersions['Matplotlib']}}</a>,
      <a href="https://palletsprojects.com/p/jinja/" target="_blank">Jinja {{libVersions['Jinja']}}</a>
      ... {{tr['and']}}
      <a href="https://pypi.org/project/pyaudisam/" target="_blank">PyAuDiSam {{version}}</a>,
      {{tr['with icons from']}} <a href="https://fontawesome.com/" target="_blank">Font Awesome</a>
      {%if pySources %}
        ({{tr['sources']}} :
        {% for pySrc in pySources %}
          <a href="./{{pySrc}}" target="_blank">{{pySrc}}</a>,
        {% endfor %})
      {% endif %}.
    </h6>

  </div>

  <button onclick="scrollToTop()" id="toTopBtn" title="Haut de page">
    <img width="64" height="64" src="./fa-angle-up.svg"/>
  </button>

</body>
