<?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: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.  in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290219#M10049</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A href="https://community.esri.com/migrated-users/353731"&gt;Lochlan Jones&lt;/A&gt;‌! Dan (see above) highlighted that my file paths were not great and needed recoding, so I will do that first to see if it changes anything. It was the first error in the list, but I would be very interested to see if the script worked for you in the end. It has been very hard to get online support on this, so I really appreciate your efforts! I'll post my code with updated file paths and result in the next hour.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Sep 2019 00:50:20 GMT</pubDate>
    <dc:creator>AnnaKreij</dc:creator>
    <dc:date>2019-09-11T00:50:20Z</dc:date>
    <item>
      <title>I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290212#M10042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have one folder (folder 1) with 200 or more rasters and another folder (folder 2) with the same number. The rasters in folder 1 are all named genus_species_01 (e.g. acan_rufo_01, lito_bico_01, and so on). The rasters in folder 3 are the same but end with _03 instead. Each raster needs to be multiplied with it's corresponding raster from the other folder and the output must retain the species name and be saved in another folder. I am completely inexperienced when it comes to Python but I believe it is the only way to achieve this task.&lt;/P&gt;&lt;P&gt;The link below describes a possible solution to my problem only I am not proficient enough at formatting code (or understanding it) to be able to adapt it to my problem.&lt;/P&gt;&lt;P&gt;&lt;A href="https://gis.stackexchange.com/questions/143243/how-to-use-the-math-tool-times-in-arcgis-modelbuilder-to-multiply-two-raster?rq=1" style="color: #2989c5; text-decoration: none;" title="https://gis.stackexchange.com/questions/143243/how-to-use-the-math-tool-times-in-arcgis-modelbuilder-to-multiply-two-raster?rq=1"&gt;python - How to use the math tool ("times") in ArcGIS modelbuilder to multiply two raster sets while using an iterator? …&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I understand what most steps do but in some cases I'm unsure of what I need to change. In particular some of it would need to be changed based on the fact my rasters are located in separate folders rather than all within the same geodatabase as it is in the linked solution. Another part I am unsure about is&amp;nbsp;&lt;SPAN style="color: #ff0000;"&gt;&lt;EM&gt;prefix =&amp;nbsp;r.split("_")[0] + "_"&amp;nbsp;&lt;/EM&gt;&lt;/SPAN&gt;. To my understanding, this will split the raster name at the '_' character in order to retrieve the identifying first part of the name. But as far as I know the &lt;SPAN style="color: #ff0000;"&gt;[0]&amp;nbsp;&lt;SPAN style="color: #000000;"&gt;refers to the first file in the specified workspace. So if my folder has over 200 rasters would I need to include r.split("_")[0] through to [200]?&lt;BR /&gt;&lt;BR /&gt;Another potential issue is that I need both the abbreviate genus and species so it can only split the name at the second '_' and not the first.&lt;BR /&gt;&lt;BR /&gt;Is anyone able to offer some guidance?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; "&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 07:12:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290212#M10042</guid>
      <dc:creator>LochlanJones</dc:creator>
      <dc:date>2019-03-21T07:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290213#M10043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;logistically, I would suggest collecting the raster names from each of the two folders first, make the pairing and do the math&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;flder0 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'a_x01'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'a_x02'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'a_x03'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'a_x04'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
flder1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'b_c_y01'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'b_c_y02'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'b_yc_03'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'b_yc_04'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
xs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;rsplit&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'_'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; flder0&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
ys &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;rsplit&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'_'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; flder1&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
xsys &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; list&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;zip&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;xs&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; ys&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
names &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"{}{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; xsys&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; nme &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; enumerate&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;names&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    eq &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"{} = {} * {}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;nme&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; flder0&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; flder1&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;eq&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

x01y01 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; a_x01 &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; b_c_y01
x02y02 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; a_x02 &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; b_c_y02
x0303 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; a_x03 &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; b_yc_03
x0404 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; a_x04 &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; b_yc_04‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Lines 1 and 2, would be a&lt;STRONG&gt; arcpy.ListRasters&lt;/STRONG&gt; on each folder&lt;/P&gt;&lt;P&gt;Lines 3 and 4 would simply be splitting the names into their bits to&amp;nbsp;&lt;/P&gt;&lt;P&gt;line 5 is just part of the process of formatting the output names&lt;/P&gt;&lt;P&gt;When assembled, lines 8 and on are a 'fake' run of the process.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:59:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290213#M10043</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T13:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290214#M10044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I do get it right, the name difference between the two raster to chose is name_01 and name_03 ?&lt;/P&gt;&lt;P&gt;Maybe this script can help you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; os
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sa &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CheckOutExtension &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Spatial"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;overwriteOutput &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Paths to your rasterdata ?&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\pathToRaster1'&lt;/SPAN&gt;
inws  &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace
inws1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\pathToRaster2'&lt;/SPAN&gt;
outws &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\outRaster'&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# List all rasters&lt;/SPAN&gt;
rasters &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListRasters&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# 2) Loop through your raster list&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; r &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rasters&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

    prefix &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;splitext&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; 
    suffix &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;splitext&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; 

    prefix1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; prefix&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;rstrip&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 

    raster2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inws1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; prefix1 &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"3"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; suffix&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;  

    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; raster2

    outraster &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;outws&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; prefix1 &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"4"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".tif"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# Change the number&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; outraster

    &lt;SPAN class="comment token"&gt;# perform the raster algebra&lt;/SPAN&gt;
    mycalc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sa&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Raster&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sa&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Raster&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;raster2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;# Save to disk (write to .tif)&lt;/SPAN&gt;
    mycalc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;save&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;outraster&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CheckInExtension &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Spatial"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;/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>Sat, 11 Dec 2021 13:59:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290214#M10044</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2021-12-11T13:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290215#M10045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the same challenge as &lt;A href="https://community.esri.com/migrated-users/353731" target="_blank"&gt;Lochlan Jones&lt;/A&gt;, but I am attempting to iterate through and multiply two sets of corresponding rasters, named 'date_ndvi' (e.g. '20050122_ndvi') and 'date_combined'&amp;nbsp; (e.g.'20050122_combined'). &lt;A href="https://community.esri.com/migrated-users/47947" target="_blank"&gt;Johannes Bierer&lt;/A&gt;'s&amp;nbsp;script works for me up until the raster algebra step, where I get &lt;SPAN style="color: #ff0000;"&gt;Runtime error&lt;/SPAN&gt; message:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #ff0000;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;RuntimeError: ERROR 000732: Input Raster: Dataset D:\1_USGS\6_2005\NDVI_Clips_scale\clouds_null\20050318_ndvi3.tif does not exist or is not supported&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;It is the correct path, and the raster exist. Would anyone know where I might have gone wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very grateful for any advice, as I have not found a solution for this anywhere else.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:17:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290215#M10045</guid>
      <dc:creator>AnnaKreij</dc:creator>
      <dc:date>2021-12-12T16:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290216#M10046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anna...&lt;/P&gt;&lt;P&gt;The errors can vary depending on your version of python and how programs trap errors.... but your file paths aren't the greatest.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to 'raw' encode them, use double backslashes or use forward slashes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For future reference, in the world of python 3 and Unicode, this will become a more important issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;p &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"D:\1_USGS\6_2005\NDVI_Clips_scale\clouds_null\20050318_ndvi3.tif"&lt;/SPAN&gt;
  File &lt;SPAN class="string token"&gt;"&amp;lt;ipython-input-3-6b3231a93a98&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;
    p &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"D:\1_USGS\6_2005\NDVI_Clips_scale\clouds_null\20050318_ndvi3.tif"&lt;/SPAN&gt;
       &lt;SPAN class="operator token"&gt;^&lt;/SPAN&gt;
SyntaxError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;unicode error&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'unicodeescape'&lt;/SPAN&gt; codec can't decode bytes &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; position &lt;SPAN class="number token"&gt;16&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;17&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; malformed \N character escape

&lt;SPAN class="comment token"&gt;# ---- use 'raw' encoding for your paths&lt;/SPAN&gt;

p &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"D:\1_USGS\6_2005\NDVI_Clips_scale\clouds_null\20050318_ndvi3.tif"&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;p&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
D&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;\1_USGS\6_2005\NDVI_Clips_scale\clouds_null\20050318_ndvi3&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;tif&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:59:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290216#M10046</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T13:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290217#M10047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anna, could you provide your code that you used? I can’t remember right now and I don’t want to make promises but I think I encountered a similar issue and I can look at it when I get home later today (approx 9 hours from now).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also is the error file the first one in the list?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get Outlook for iOS&amp;lt;https://aka.ms/o0ukef&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2019 00:37:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290217#M10047</guid>
      <dc:creator>LochlanJones</dc:creator>
      <dc:date>2019-09-11T00:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290218#M10048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;‌, thank you for this! I am a complete novice to python, so I really appreciate being pulled up on these things early on. I will&amp;nbsp;raw encode and try again!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2019 00:46:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290218#M10048</guid>
      <dc:creator>AnnaKreij</dc:creator>
      <dc:date>2019-09-11T00:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290219#M10049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A href="https://community.esri.com/migrated-users/353731"&gt;Lochlan Jones&lt;/A&gt;‌! Dan (see above) highlighted that my file paths were not great and needed recoding, so I will do that first to see if it changes anything. It was the first error in the list, but I would be very interested to see if the script worked for you in the end. It has been very hard to get online support on this, so I really appreciate your efforts! I'll post my code with updated file paths and result in the next hour.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2019 00:50:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290219#M10049</guid>
      <dc:creator>AnnaKreij</dc:creator>
      <dc:date>2019-09-11T00:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290220#M10050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have not had a chance to raw encode my file paths, so this may still be the issue, but if anyone can see other errors,&amp;nbsp;please let me know. I had some indent errors, but when fixed the code ran until error 00732. The files ndvi_3 and ndvi_4 has also not been printed - i.e I cannot see the output in explorer/ArcCatalog... Again, I'm very new to any programming, so happy to take any feedback.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy, os
&amp;gt;&amp;gt;&amp;gt; from arcpy.sa import*
&amp;gt;&amp;gt;&amp;gt; arcpy.CheckExtension("Spatial")
&lt;SPAN style="color: #999999;"&gt;u'Available'&lt;/SPAN&gt;
&amp;gt;&amp;gt;&amp;gt; arcpy.env.overwriteOutput = True
&amp;gt;&amp;gt;&amp;gt; arcpy.env.workspace = r 'D:\1_USGS\6_2005\NDVI_Clips_scale'
&lt;SPAN style="color: #ff0000;"&gt;Parsing error SyntaxError: invalid syntax (line 1)&lt;/SPAN&gt;
&amp;gt;&amp;gt;&amp;gt; arcpy.env.workspace = r'D:\1_USGS\6_2005\NDVI_Clips_scale\ndvi'
&amp;gt;&amp;gt;&amp;gt; inws = arcpy.env.workspace
&amp;gt;&amp;gt;&amp;gt; inws1 = r'D:\1_USGS\6_2005\NDVI_Clips_scale\clouds_null'
&amp;gt;&amp;gt;&amp;gt; outws = r'D:\1_USGS\6_2005\NDVI_outputs'
&amp;gt;&amp;gt;&amp;gt; 
&amp;gt;&amp;gt;&amp;gt; rasters = arcpy.ListRasters()
&amp;gt;&amp;gt;&amp;gt; for r in rasters:
... prefix = os.path.splitext(r)[0]
... suffix = os.path.splitext(r)[1]
... 
&amp;gt;&amp;gt;&amp;gt; prefix1 = prefix.rstrip("1")
... 
&lt;SPAN style="color: #ff0000;"&gt;Parsing error IndentationError: unexpected indent (line 1)&lt;/SPAN&gt;
&amp;gt;&amp;gt;&amp;gt; prefix1 = prefix.rstrip("1")
&amp;gt;&amp;gt;&amp;gt; raster2 = os.path.join(inws1, prefix1 + "3" + suffix)
&amp;gt;&amp;gt;&amp;gt; print raster2
&lt;SPAN style="color: #999999;"&gt;D:\1_USGS\6_2005\NDVI_Clips_scale\clouds_null\20050318_ndvi3.tif&lt;/SPAN&gt;
&amp;gt;&amp;gt;&amp;gt; outraster = os.path.join(outws, prefix1 + "4" + ".tif")
&amp;gt;&amp;gt;&amp;gt; print outraster
&lt;SPAN style="color: #999999;"&gt;D:\1_USGS\6_2005\NDVI_outputs\20050318_ndvi4.tif&lt;/SPAN&gt;
&amp;gt;&amp;gt;&amp;gt; mycalc = arcpy.sa.Raster(r) * arcpy.sa.Raster(raster2)
&lt;SPAN style="color: #ff0000;"&gt;Runtime error &lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;RuntimeError: ERROR 000732: Input Raster: Dataset D:\1_USGS\6_2005\NDVI_Clips_scale\clouds_null\20050318_ndvi3.tif does not exist or is not supported&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:17:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290220#M10050</guid>
      <dc:creator>AnnaKreij</dc:creator>
      <dc:date>2021-12-12T16:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290221#M10051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anna, please see my (hopefully helpful) explanation of the code I successfully used below with my data. Something of note is that how your files are named is extremely important to this code working which is why it is not working for you.&lt;BR /&gt;For my answer I'll assume your first raster set is named&amp;nbsp;&lt;STRONG&gt;date_ndvi&lt;/STRONG&gt;&lt;STRONG&gt;.tif&amp;nbsp;&lt;/STRONG&gt;and your second raster set is named&amp;nbsp;&lt;STRONG&gt;date_combined&lt;/STRONG&gt;&lt;STRONG&gt;.tif&lt;/STRONG&gt;. Because I don't know what you want your output rasters to be called I will assume it will be&amp;nbsp;&lt;STRONG&gt;date_multiply.tif.&lt;BR /&gt;&lt;/STRONG&gt;Please read my hastily put together explanation in the attached image below before continuing.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Okay,&amp;nbsp;now make sure you have the correct filepaths specified in your code and then replace the following lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;SPAN style="color: #000000;"&gt;Replace&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;prefix1 = prefix.rstrip("1")&lt;/EM&gt;&lt;/SPAN&gt;&amp;nbsp;with&amp;nbsp;&lt;SPAN style="color: #ff0000;"&gt;&lt;EM&gt;prefix1 = prefix.rstrip("ndvi")&lt;/EM&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; "&gt;Replace &lt;SPAN style="color: #ff0000;"&gt;&lt;EM&gt;raster2 = os.path.join(inws1, prefix1 + "3" +&amp;nbsp;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;EM&gt;suffix)&lt;/EM&gt;&lt;/SPAN&gt; with&amp;nbsp;&lt;EM style="color: #ff0000; "&gt;raster2 = os.path.join(inws1, prefix1 + "combined" + suffix)&lt;/EM&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Replace &lt;EM style="color: #ff0000; "&gt;outraster = os.path.join(outws, prefix1 + "4")&lt;/EM&gt; with&amp;nbsp;&lt;EM style="color: #ff0000; "&gt;outraster = os.path.join(outws, prefix1 + "multiply" + suffix)&amp;nbsp;&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Now it should hopefully work.&amp;nbsp;&lt;BR /&gt;The code wasn't working originally because it couldn't find your second set of rasters. In the raster2 line you added a "3" to your file name and then it couldn't find any rasters with that name. This is why it says&amp;nbsp;&lt;SPAN style="color: #ff0000; border: 0px; font-weight: inherit;"&gt;20050318_ndvi3.tif&amp;nbsp;&lt;SPAN style="color: #000000;"&gt;doesn't exist because you accidentally added a 3 to it.&lt;BR /&gt;&lt;BR /&gt;I hope this helps. Let me know how it goes. I'm a beginner as well and I only know what this code means because I worked backwards and looked at it piece by piece&amp;nbsp;&lt;EM&gt;after&amp;nbsp;&lt;/EM&gt;the code worked after having it given to me by the good samaritan&amp;nbsp;&lt;SPAN style="color: #3778c7; background-color: #ffffff; font-weight: 200; text-decoration: underline;"&gt;Johannes Bierer.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="/legacyfs/online/459329_arcpy multiplication explanation.PNG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 13:27:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290221#M10051</guid>
      <dc:creator>LochlanJones</dc:creator>
      <dc:date>2019-09-12T13:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290222#M10052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/353731"&gt;Lochlan Jones&lt;/A&gt;‌ and &lt;A href="https://community.esri.com/migrated-users/47947"&gt;Johannes Bierer&lt;/A&gt;‌ - I am entirely grateful to you both! Lochlan, I cannot thank you enough for taking the time to spell out each step as you have above - it's incredibly helpful. You have saved my code and advanced my knowledge substantially! Thank you!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 23:31:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290222#M10052</guid>
      <dc:creator>AnnaKreij</dc:creator>
      <dc:date>2019-09-12T23:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290223#M10053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/353731" target="_blank"&gt;Lochlan Jones&lt;/A&gt;‌, the code appears to work well for me up until the raster calc stage (and thanks to you I now follow what it is doing). Can you see&amp;nbsp;why I get &lt;SPAN style="color: #ff0000;"&gt;error 000732&lt;/SPAN&gt; on my calculation? The files exist and have the same filename, as far as I can see (see below), in the original folders (&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;workspace&lt;/SPAN&gt; and &lt;SPAN style="font-family: 'andale mono', monospace;"&gt;inws1&lt;/SPAN&gt;) but the output folder (&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;outws&lt;/SPAN&gt;) is still empty since the error&amp;nbsp;appears before I can&amp;nbsp;execute &lt;SPAN style="font-family: 'andale mono', monospace;"&gt;mycalc.save(outraster&lt;/SPAN&gt;)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In terms of my poor file paths - I tried both changing my filepaths to forwarded slashes as suggested by&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/3116" target="_blank"&gt;Dan Patterson&lt;/A&gt;&amp;nbsp;and dragging and dropping the file paths , both providing the error below.&amp;nbsp;Is there any other way I can improve the file paths to make this work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy, os
... from arcpy.sa import*
... arcpy.CheckOutExtension ("Spatial")
... 
... arcpy.env.overwriteOutput = True
... arcpy.env.workspace = r'D:/1_USGS/6_2005/NDVI_Clips_scale/ndvi'
... inws = arcpy.env.workspace
... inws1 = r'D:/1_USGS/6_2005/NDVI_Clips_scale/clouds_null'
... outws = r'D:/1_USGS/6_2005/NDVI_outputs'
... 
... rasters = arcpy.ListRasters()
... 
... for r in rasters:
... prefix = os.path.splitext(r)[0]
... suffix = os.path.splitext(r)[1]
... prefix1 = prefix.rstrip("ndvi")
... raster2 = os.path.join(outws, prefix1 + "combine" + suffix)
... print raster2
... outraster = os.path.join(outws, prefix1 + "multiply" + suffix)
... print outraster
... 
&lt;SPAN style="color: #999999;"&gt;D:/1_USGS/6_2005/NDVI_outputs\20050122_combine.tif&lt;/SPAN&gt;
&lt;SPAN style="color: #999999;"&gt;D:/1_USGS/6_2005/NDVI_outputs\20050122_multiply.tif&lt;/SPAN&gt;
&lt;SPAN style="color: #999999;"&gt;D:/1_USGS/6_2005/NDVI_outputs\20050207_combine.tif&lt;/SPAN&gt;
&lt;SPAN style="color: #999999;"&gt;D:/1_USGS/6_2005/NDVI_outputs\20050207_multiply.tif&lt;/SPAN&gt;
&lt;SPAN style="color: #999999;"&gt;D:/1_USGS/6_2005/NDVI_outputs\20050318_combine.tif&lt;/SPAN&gt;
&lt;SPAN style="color: #999999;"&gt;D:/1_USGS/6_2005/NDVI_outputs\20050318_multiply.tif&lt;/SPAN&gt;
&amp;gt;&amp;gt;&amp;gt; mycalc = arcpy.sa.Raster(r) * arcpy.sa.Raster(raster2)
&lt;SPAN style="color: #ff0000;"&gt;Runtime error &lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;RuntimeError: ERROR 000732: Input Raster: Dataset D:/1_USGS/6_2005/NDVI_outputs\20050318_combine.tif does not exist or is not supported&lt;/SPAN&gt;
&amp;gt;&amp;gt;&amp;gt; &lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="File_names" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/459431_error000732.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:17:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290223#M10053</guid>
      <dc:creator>AnnaKreij</dc:creator>
      <dc:date>2021-12-12T16:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290224#M10054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #ff0000; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; D:/1_USGS/6_2005/NDVI_outputs\20050318_combine.tif&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that is the output folder? but the input tif is in another folder.&amp;nbsp; It is failing before you even get&amp;nbsp; chance to complete the multiplication&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 01:59:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290224#M10054</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-09-13T01:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290225#M10055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anna, your new problem is that the ‘raster2’ line has ‘outws’ in it instead of ‘inws’. You are telling it to look in your output folder for your second raster set (combined). Change it to inws and try it again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get Outlook for iOS&amp;lt;https://aka.ms/o0ukef&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 02:06:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290225#M10055</guid>
      <dc:creator>LochlanJones</dc:creator>
      <dc:date>2019-09-13T02:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290226#M10056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked!! Thank you both. I cannot even begin to say how much I appreciate your prompt help on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/353731"&gt;Lochlan Jones&lt;/A&gt;&amp;nbsp;you should be a teacher! Really - thank you for all your help and willingness to share. The world of programming beginners needs more people like you!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 02:25:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290226#M10056</guid>
      <dc:creator>AnnaKreij</dc:creator>
      <dc:date>2019-09-13T02:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290227#M10057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now my only (and hopefully final!) issue is that I only recieve one output, which is the output of the last file (20050318_multiply), rather than three as I was expecting from this test.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 04:05:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290227#M10057</guid>
      <dc:creator>AnnaKreij</dc:creator>
      <dc:date>2019-09-13T04:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290228#M10058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe your last issue may be you’re missing the last line of code ‘mycalc.save(outraster)’ and because of this it is overwriting each output with each run leaving you with only the output of the final multiplication. If you include this last line and run it it should save them all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get Outlook for iOS&amp;lt;https://aka.ms/o0ukef&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 06:25:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290228#M10058</guid>
      <dc:creator>LochlanJones</dc:creator>
      <dc:date>2019-09-13T06:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290229#M10059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Thanks &lt;SPAN style="color: #00ccff;"&gt;&lt;A href="https://community.esri.com/migrated-users/353731"&gt;Lochlan Jones&lt;/A&gt;&lt;/SPAN&gt;‌. I tried that and it brought me one step closer, but I receive the following error:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', monospace; font-size: 13px;"&gt;&amp;gt;&amp;gt;&amp;gt; for r in rasters:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace; font-size: 13px;"&gt;... prefix = os.path.splitext(r)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace; font-size: 13px;"&gt;... suffix = os.path.splitext(r)[1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace; font-size: 13px;"&gt;... prefix1 = prefix.rstrip("ndvi")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace; font-size: 13px;"&gt;... raster2 = os.path.join(inws1, prefix1 + "combine" + suffix)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace; font-size: 13px;"&gt;... outraster = os.path.join(outws, prefix1 + "multiply" + suffix)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace; font-size: 13px;"&gt;... print outraster&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace; font-size: 13px;"&gt;... mycalc = arcpy.sa.Raster(r) * arcpy.sa.Raster(raster2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace; font-size: 13px;"&gt;... mycalc.save(outraster)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', monospace; color: #ff0000; font-size: 13px;"&gt;Runtime error &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace; color: #ff0000; font-size: 13px;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace; color: #ff0000; font-size: 13px;"&gt; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'andale mono', monospace; color: #ff0000; font-size: 13px;"&gt;TypeError: 'function' object is not iterable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; color: #000000;"&gt;Would the be the raster calculation function that is not iterable?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; color: #000000;"&gt;If you don't have any more time to spend on this I understand - I've really appreciated all your help so far.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Sep 2019 23:45:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290229#M10059</guid>
      <dc:creator>AnnaKreij</dc:creator>
      <dc:date>2019-09-15T23:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290230#M10060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you running everything before the ‘for r in rasters:’ at the same time as everything after? Or are you running the first part and then the second part? I think some of it won’t work if it isn’t all run at the same time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get Outlook for iOS&amp;lt;https://aka.ms/o0ukef&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2019 01:36:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290230#M10060</guid>
      <dc:creator>LochlanJones</dc:creator>
      <dc:date>2019-09-17T01:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: I need to multiply multiple rasters in a folder with their corresponding rasters in another folder.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290231#M10061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you also post the full code that’s giving you this error? It can be easy to miss one tiny thing. A common cause of this error message is missing the parentheses after a function. In this case the problem could be the line ‘rasters = arcpy.ListRasters()’. If you don’t have the parentheses at the end of it or you don’t run it at the same time as the ‘for r in rasters’ line it won’t work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get Outlook for iOS&amp;lt;https://aka.ms/o0ukef&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2019 01:42:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-need-to-multiply-multiple-rasters-in-a-folder/m-p/290231#M10061</guid>
      <dc:creator>LochlanJones</dc:creator>
      <dc:date>2019-09-17T01:42:37Z</dc:date>
    </item>
  </channel>
</rss>

