<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA - Allan CORNET
 * 
 * This file is released into the public domain
 *
 -->
<refentry version="5.0-subset Scilab" xml:id="FillAccumulationMap" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:db="http://docbook.org/ns/docbook">
  <info>
    <pubdate>$LastChangedDate: 2013-10-16 12:00:00 +0100 (Wed., October 16, 2013)
    $</pubdate>
  </info>

  <refnamediv>
    <refname>FillAccumulationMap</refname>

    <refpurpose>Accumulates a quantity along the stream network in a catchment</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <title>Calling Sequence</title>

    <synopsis>FillAccumulationMap ( handle_fdr , outlet , handle_acc [, "weight", handle_weight] [, "inlets", INLETS ] [, "method", met ]  )</synopsis>
  </refsynopsisdiv>

  <refsection>
    <title>Arguments</title>
    <variablelist>
	  
      <varlistentry>
      <term>handle_fdr</term>
        <listitem>
          <para>
	  integer: handle on the flow direction grid defining the stream network</para>
	  </listitem>
      </varlistentry>

      <varlistentry>
      <term>outlet</term>
        <listitem>
          <para>
	  integer: ID of the outlet pixel, as returned by <literal>XY2rec</literal></para>
	  </listitem>
  	</varlistentry>

      <varlistentry>
      <term>handle_acc</term>
        <listitem>
          <para>
	  integer: handle on the raster that will receive the computed values along the stream network. This raster is not created by the function, it must exist before and can be created with functions such as <literal>CreateFloatRaster</literal> or <literal>CreateConstantRaster</literal></para>
	  </listitem>
  </varlistentry>

</variablelist>
  </refsection>

  <refsection>
    <title>Optional keys in the form of a conjunction {KeyName,KeyValue}</title>
    <variablelist>
	  
      <varlistentry>
      <term>Key "weight"</term>
        <listitem>
          <para>
          By default, the function accumulates the indicator function along the network i.e. each pixel has a weight equal to 1. If you want to accumulate some local quantity (rainfall, etc.) use the key "weight" followed by the handle of the weight raster.</para>
	  </listitem>
      </varlistentry>

      <varlistentry>
      <term>Key "inlets"</term>
        <listitem>
          <para>
	  By default, the function computes the accumulation map in the whole catchment upstream outlet pixel. If you want to exclude some subcatchments use the key "inlets" followed by a vector of inlet IDs. The recursive accumulation will not go further upstream whenever one of these inlets is met.</para>
	  </listitem>
  	</varlistentry>

      <varlistentry>
      <term>Key "method"</term>
        <listitem>
          <para>
	  By default, the function simply sums the indicator or weight raster along the network. If you want to compute the mean instead of the sum (for example to compute the mean rainfall upstream each pixel) then use key "method" in conjuction with value "mean" (the conjuction "method","sum" gives the default behavior).</para>
	  </listitem>
  	</varlistentry>

</variablelist>
  </refsection>


  <refsection>
    <title>Description</title>

    <para>Accumulates a quantity along the stream network in a catchmnent and writes the values to an existing raster.</para>

  </refsection>

  <refsection>
    <title>Examples</title>
  </refsection>

   <refsection>
    <title>References</title>
    <para>
    </para>
  </refsection>
  
   <refsection><title>See Also</title><simplelist type='inline'>
    
      <member> 
         <link linkend='XY2rec'>XY2rec</link>,  <link linkend='CreateFloatRaster'>CreateFloatRaster</link>, <link linkend='CreateConstantRaster'>CreateConstantRaster</link>
      </member>
     
   </simplelist></refsection>


  <refsection>
    <title>Authors</title>

    <simplelist type="vert">
      <member>Nicolas LE MOINE</member>
    </simplelist>
  </refsection>
</refentry>
