<?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: Using Functions in python - special emphasis on apparent reflectance in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/using-functions-in-python-special-emphasis-on/m-p/47843#M622</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;One is to create a model builder workflow which uses the &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//009z000000z8000000"&gt;raster calculator tool&lt;/A&gt; with the particular math you're using to convert between the images and reflectance. Save this model, and then from the catalog pane, you can right click on the model and select 'Batch', which will allow you to run the calculation on multiple rasters.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have not had good luck with the older 9.3-ish "batch" functionality with model tools; the model tries to run in "parallel". (I've found batch to work fine with script tools, I'm talking about "batching" model tools.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've had much better luck setting up the model to work on one input, and then either put an iterator tool in the model or call the model from a second model that has an iterator to loop through multiple inputs. A benefit of this approach is you can auto-name the outputs using model variables, instead of toiling to fill in the "batch" matrix with values.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Nov 2013 23:10:16 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2013-11-22T23:10:16Z</dc:date>
    <item>
      <title>Using Functions in python - special emphasis on apparent reflectance</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/using-functions-in-python-special-emphasis-on/m-p/47841#M620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am interested in using python to batch process a bunch of Landsat 8 images. I need reflectance as 0-1 or 0-100%, but there is no official Landsat 8 reflectance product. While there will probably be one eventually, I was hoping to use the apparent reflectance function in the meantime. I am new to 10.2 (used primarily 10.0) and I already have several python scripts doing what I need with the reflectance data, but I would like is to convert the Landsat 8 to reflectance using batch processing with a file saved rather than on-the-fly functionality that functions provide.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FYI, I did figure out how to apply the functions and export the images with the reflectance conversion. I was hoping to avoid doing this individually to the 70 images i need to process.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Nov 2013 13:17:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/using-functions-in-python-special-emphasis-on/m-p/47841#M620</guid>
      <dc:creator>AnthonyNguy-Robertson</dc:creator>
      <dc:date>2013-11-17T13:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using Functions in python - special emphasis on apparent reflectance</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/using-functions-in-python-special-emphasis-on/m-p/47842#M621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Anthony,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are a few ways to solve your problem. One is to create a model builder workflow which uses the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//009z000000z8000000" rel="nofollow noopener noreferrer" target="_blank"&gt;raster calculator tool&lt;/A&gt;&lt;SPAN&gt; with the particular math you're using to convert between the images and reflectance. Save this model, and then from the catalog pane, you can right click on the model and select 'Batch', which will allow you to run the calculation on multiple rasters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;An alternative approach if you've done any Python programming is to use the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/An_overview_of_the_rules_for_Map_Algebra/00p600000006000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;arcpy raster functions&lt;/A&gt;&lt;SPAN&gt; to do the work directly. This way, you could, say have a file which listed each folder with your rasters, then iterate over the list, and perform the calculation directly in Python, which might look something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
band_1 = arcpy.sa.Raster('c:/path/to/band1.tif')
band_3 = arcpy.sa.Raster('c:/path/to/band3.tif')
sum_reflectance = (band_1 + band_3)/(band_1.maximum + band_3.maximum)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Shaun&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:50:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/using-functions-in-python-special-emphasis-on/m-p/47842#M621</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2021-12-10T21:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using Functions in python - special emphasis on apparent reflectance</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/using-functions-in-python-special-emphasis-on/m-p/47843#M622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;One is to create a model builder workflow which uses the &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//009z000000z8000000"&gt;raster calculator tool&lt;/A&gt; with the particular math you're using to convert between the images and reflectance. Save this model, and then from the catalog pane, you can right click on the model and select 'Batch', which will allow you to run the calculation on multiple rasters.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have not had good luck with the older 9.3-ish "batch" functionality with model tools; the model tries to run in "parallel". (I've found batch to work fine with script tools, I'm talking about "batching" model tools.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've had much better luck setting up the model to work on one input, and then either put an iterator tool in the model or call the model from a second model that has an iterator to loop through multiple inputs. A benefit of this approach is you can auto-name the outputs using model variables, instead of toiling to fill in the "batch" matrix with values.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Nov 2013 23:10:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/using-functions-in-python-special-emphasis-on/m-p/47843#M622</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2013-11-22T23:10:16Z</dc:date>
    </item>
  </channel>
</rss>

