<?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 Raster Band Separation in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/raster-band-separation/m-p/235254#M1461</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using 366 band floating point raster data. Each band represents one day's climate data. I need to find a way to select around 100 of these bands (one season) in a manner that will not take years to complete, in order to view statistics for a season rather than a whole year. Is there any way of doing this and then being able to narrow this data down to the county level?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jul 2015 19:08:12 GMT</pubDate>
    <dc:creator>wyatt_robbins</dc:creator>
    <dc:date>2015-07-15T19:08:12Z</dc:date>
    <item>
      <title>Raster Band Separation</title>
      <link>https://community.esri.com/t5/developers-questions/raster-band-separation/m-p/235254#M1461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using 366 band floating point raster data. Each band represents one day's climate data. I need to find a way to select around 100 of these bands (one season) in a manner that will not take years to complete, in order to view statistics for a season rather than a whole year. Is there any way of doing this and then being able to narrow this data down to the county level?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 19:08:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/raster-band-separation/m-p/235254#M1461</guid>
      <dc:creator>wyatt_robbins</dc:creator>
      <dc:date>2015-07-15T19:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Band Separation</title>
      <link>https://community.esri.com/t5/developers-questions/raster-band-separation/m-p/235255#M1462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds just like the sort of thing that can be automated in modelbuilder, what have you tried?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 15:22:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/raster-band-separation/m-p/235255#M1462</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2015-07-20T15:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Band Separation</title>
      <link>https://community.esri.com/t5/developers-questions/raster-band-separation/m-p/235256#M1463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's how you can combine a sample of random raster bands into a new raster using Python. This assumes your bands are named "Band_1", "Band_2", etc. Change the numbers to suit your data - I don't have a 366 band raster to play with.&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 os, random
... bands = []
... raster = r'C:\junk\comp_rast.tif'
... bandNumList = []
... for i in range(1,7): # create list from 1 - 6
...&amp;nbsp;&amp;nbsp;&amp;nbsp; bandNumList.append(i)
... print bandNumList
... random.shuffle(bandNumList) # randomize list
... print bandNumList
... for i in range(3): # loop through first three in list
...&amp;nbsp;&amp;nbsp;&amp;nbsp; bandx = os.path.join(raster,'Band_' + str(bandNumList&lt;I&gt;)) &lt;/I&gt;
...&amp;nbsp;&amp;nbsp;&amp;nbsp; bands.append(bandx) # add appropriate band path to list of raster band paths
... print bands
... arcpy.CompositeBands_management(bands,r'C:/junk/three.tif') # create new composite raster
...
[1, 2, 3, 4, 5, 6]
[3, 1, 2, 6, 4, 5]
['C:\\junk\\comp_rast.tif\\Band_3', 'C:\\junk\\comp_rast.tif\\Band_1', 'C:\\junk\\comp_rast.tif\\Band_2']&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:52:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/raster-band-separation/m-p/235256#M1463</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T11:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Band Separation</title>
      <link>https://community.esri.com/t5/developers-questions/raster-band-separation/m-p/235257#M1464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've tried some simple tools involving rasters. spatial analysis, raster creation, raster processing, conversion tools. I'm very unfamiliar with python. I have access to use it, but have never had to do so at this point, so I'm more looking for a tool of some sort. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 19:43:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/raster-band-separation/m-p/235257#M1464</guid>
      <dc:creator>wyatt_robbins</dc:creator>
      <dc:date>2015-07-20T19:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Band Separation</title>
      <link>https://community.esri.com/t5/developers-questions/raster-band-separation/m-p/235258#M1465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My example was overly complicated, selecting random bands and combining into one raster, but I don't think you're going to find a tool that does what you want without some customization. Below is code that will calculate the mean value for a range of bands and output that raster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Python doesn't have to be scary. Just open the Python window in ArcMap and copy/paste. Change the band numbers and raster paths to suit your own needs (just the values after '=' in lines 2 - 5). Text after '#' is a Python comment and will be ignored.&lt;/SPAN&gt;&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 os # import a library for later
... startBand = 1 # starting band number
... endBand = 5 # end band number
... inputRaster = r'C:\junk\YourInputRaster.tif' # input multiband raster
... outputRaster = r'C:\junk\YourOutputRaster.tif' # output single band raster
... rasterAdder = arcpy.Raster(os.path.join(inputRaster ,'Band_' + str(startBand)))
... for i in range(startBand+1,endBand+1): # loop through bands
...&amp;nbsp;&amp;nbsp;&amp;nbsp; bandx = arcpy.Raster(os.path.join(inputRaster ,'Band_' + str(i))) # add bands together
...&amp;nbsp;&amp;nbsp;&amp;nbsp; rasterAdder += bandx
... meanRaster = rasterAdder/((endBand - startBand) + 1) # calculate mean
... meanRaster.save(outputRaster) # save raster&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:52:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/raster-band-separation/m-p/235258#M1465</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T11:52:14Z</dc:date>
    </item>
  </channel>
</rss>

