<?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="FindNetworkTransition" 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-18 12:00:00 +0100 (Fri., October 18, 2013)
    $</pubdate>
  </info>

  <refnamediv>
    <refname>FindNetworkTransition</refname>

    <refpurpose>Locates the cells verifying a transition criterion when moving downstream in a channel network.</refpurpose>
  </refnamediv>

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

    <synopsis>CELLS = FindNetworkTransition ( handle_ras , handle_fdr , a , b , outlet , niter )</synopsis>
  </refsynopsisdiv>

  <refsection>
    <title>Arguments</title>
    <variablelist>

      <varlistentry>
      <term>hr</term>
        <listitem>
          <para>
	  integer: handle on the raster which will be used to define the transition criterion.</para>
	  </listitem>
      </varlistentry>

	
      <varlistentry>
      <term>fdr</term>
        <listitem>
          <para>
	  integer: handle on the flow direction grid to be used.</para>
	  </listitem>
      </varlistentry>
	  
	  <varlistentry>
      <term>a,b</term>
        <listitem>
          <para>
	  floats: the transition criterion will be verified when the expression (a * #Raster# + b) switches from <emphasis>positive</emphasis> to <emphasis>negative</emphasis> when moving <emphasis>downstream</emphasis>.</para>
	  </listitem>
      </varlistentry>
	 
	  <varlistentry>
      <term>outlet</term>
        <listitem>
          <para>
	  integer: record number (absolute reference in the raster, as returned by <literal>XY2rec</literal>) of the outlet cell.</para>
	  </listitem>
      </varlistentry>
	  
	  <varlistentry>
      <term>nit</term>
        <listitem>
          <para>
	  integer: number of times that the search for transitions can be performed recursively.</para>
	  </listitem>
      </varlistentry>
	  	  
	  <varlistentry>
      <term>CELLS</term>
        <listitem>
          <para>
	  output: vector containing the record numbers of the cells verifying the transition criterion.</para>
	  </listitem>
      </varlistentry>
	  
</variablelist>
  </refsection>



  <refsection>
    <title>Description</title>

    <para>Locates the cells verifying a transition criterion when moving downstream in a channel network.</para>

  </refsection>

  <refsection>
    <title>Exemples</title>
	<para>if the raster <literal>elev</literal> contains elevation data, then the contour line <literal>Z=Z0</literal> in the catchment having its outlet at cell <literal>outlet</literal>, is given by the set of cells verifying the following transition :</para>
	<para><literal>1 * #elev# - Z0</literal> switching from positive to negative when moving downstream, i.e. :</para>
	<para><literal>CZ0 = FindNetworkTransition ( elev , fdr , 1 , -Z0 , outlet , 1)</literal></para>
  </refsection>
 
   <refsection><title>See Also</title><simplelist type='inline'>
    
      <member> 
         <link linkend='XY2rec'>XY2rec</link>
      </member>
     
   </simplelist></refsection>


  <refsection>
    <title>Authors</title>

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