<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Iteration of 2 datasets (raster calculator) in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/iteration-of-2-datasets-raster-calculator/m-p/765176#M2579</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is how loops work. If you want to operate on pairs you need to only do one iterator on qx and somehow create the path to qy from qx. No nesting needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In python scripts you can easily loop over a list of 2 item lists, but this isn't easily accomplished in ModelBuilder.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Apr 2017 04:29:54 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2017-04-27T04:29:54Z</dc:date>
    <item>
      <title>Iteration of 2 datasets (raster calculator)</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/iteration-of-2-datasets-raster-calculator/m-p/765175#M2578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having a problem setting up a model builder. I have 2 raster datasets (qx,qy) that are needed to be iterated as input for the raster calculation tool. The number of files of qx and qy is 243 each. The expression for the raster calculator is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SquareRoot(Square("%&lt;STRONG&gt;qx&lt;/STRONG&gt;%")+Square("%&lt;STRONG&gt;qy&lt;/STRONG&gt;%")) &amp;nbsp; with&amp;nbsp;terms:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;qx1 and qy1&lt;BR /&gt;qx2 and qy2&lt;/P&gt;&lt;P&gt;.... qxn and qyn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My initial setup is as follows (since you can only use 1 iterator in a model):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="348218" alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/348218_inlet_model.PNG" style="width: 620px; height: 706px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this trial, I only used 5 rasters both for qx and qy. The model&amp;nbsp;actually ran the calculation but the terms used were not correct. Please see below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;qy1 and qx5&lt;/P&gt;&lt;P&gt;qy2 and qx5&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;qy3 and qx5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;qy4 and qx5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;qy5 and qx5&lt;BR /&gt;&lt;BR /&gt;Qy (iteration in the main model) was correctly iterated but not in the case of Qx. I hope you can help me with this problem. Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 00:16:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/iteration-of-2-datasets-raster-calculator/m-p/765175#M2578</guid>
      <dc:creator>Fra_AngelicoViray</dc:creator>
      <dc:date>2017-04-27T00:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Iteration of 2 datasets (raster calculator)</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/iteration-of-2-datasets-raster-calculator/m-p/765176#M2579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is how loops work. If you want to operate on pairs you need to only do one iterator on qx and somehow create the path to qy from qx. No nesting needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In python scripts you can easily loop over a list of 2 item lists, but this isn't easily accomplished in ModelBuilder.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 04:29:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/iteration-of-2-datasets-raster-calculator/m-p/765176#M2579</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2017-04-27T04:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Iteration of 2 datasets (raster calculator)</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/iteration-of-2-datasets-raster-calculator/m-p/765177#M2580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just had a thought. Maybe the For iterator is what you need here, and use Calculate Value to generate the paths to the input rasters based on the index number.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 04:36:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/iteration-of-2-datasets-raster-calculator/m-p/765177#M2580</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2017-04-27T04:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Iteration of 2 datasets (raster calculator)</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/iteration-of-2-datasets-raster-calculator/m-p/765178#M2581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Curtis Price. Using python scripts can be my backup plan but I am not familiar with that. Do you have sample code for this kind of scenario. I am leaning to your 2nd advice for the "for" iterator. Can you show me how? Thank you again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 06:45:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/iteration-of-2-datasets-raster-calculator/m-p/765178#M2581</guid>
      <dc:creator>Fra_AngelicoViray</dc:creator>
      <dc:date>2017-04-27T06:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Iteration of 2 datasets (raster calculator)</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/iteration-of-2-datasets-raster-calculator/m-p/765179#M2582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a model that uses the For tool in this way. You can get this to work by modifying the Calculate Value tools to construct a full file path, and set the outputs to type Raster Dataset. Then use the model elements grid1 and grid2 in the Map Algebra tool. I have connected the Value element to the tools as a precondition to ensure both Calculate Value tools run on every iteration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="348321" alt="model tool for example" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/348321_model.png" style="width: 620px; height: 280px;" /&gt;&lt;/P&gt;&lt;P&gt;Here's what the messages look like when this model is run:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Executing (For): IterateCount 1 3 1
Start Time: Thu Apr 27 14:44:33 2017
Succeeded at Thu Apr 27 14:44:33 2017 (Elapsed Time: 0.00 seconds)
Executing (Calculate Value): CalculateValue r"qx1" # Variant
Start Time: Thu Apr 27 14:44:34 2017
Value = qx1
Succeeded at Thu Apr 27 14:44:34 2017 (Elapsed Time: 0.08 seconds)
Executing (Calculate Value (2)): CalculateValue r"qy1" # Variant
Start Time: Thu Apr 27 14:44:34 2017
Value = qy1
Succeeded at Thu Apr 27 14:44:34 2017 (Elapsed Time: 0.08 seconds)
Executing (For): IterateCount 1 3 1
Start Time: Thu Apr 27 14:44:34 2017
Succeeded at Thu Apr 27 14:44:34 2017 (Elapsed Time: 0.00 seconds)
Executing (Calculate Value): CalculateValue r"qx2" # Variant
Start Time: Thu Apr 27 14:44:34 2017
Value = qx2
Succeeded at Thu Apr 27 14:44:34 2017 (Elapsed Time: 0.08 seconds)
Executing (Calculate Value (2)): CalculateValue r"qy2" # Variant
Start Time: Thu Apr 27 14:44:34 2017
Value = qy2
Succeeded at Thu Apr 27 14:44:34 2017 (Elapsed Time: 0.08 seconds)
Executing (For): IterateCount 1 3 1
Start Time: Thu Apr 27 14:44:34 2017
Succeeded at Thu Apr 27 14:44:34 2017 (Elapsed Time: 0.00 seconds)
Executing (Calculate Value): CalculateValue r"qx3" # Variant
Start Time: Thu Apr 27 14:44:34 2017
Value = qx3
Succeeded at Thu Apr 27 14:44:34 2017 (Elapsed Time: 0.08 seconds)
Executing (Calculate Value (2)): CalculateValue r"qy3" # Variant
Start Time: Thu Apr 27 14:44:34 2017
Value = qy3
Succeeded at Thu Apr 27 14:44:34 2017 (Elapsed Time: 0.08 seconds)
Executing (For): IterateCount 1 3 1
Start Time: Thu Apr 27 14:44:34 2017
Succeeded at Thu Apr 27 14:44:34 2017 (Elapsed Time: 0.00 seconds)‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:29:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/iteration-of-2-datasets-raster-calculator/m-p/765179#M2582</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-12T08:29:42Z</dc:date>
    </item>
  </channel>
</rss>

