<?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 Batch Processing - Composite Images in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/batch-processing-composite-images/m-p/95134#M7417</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am processing&amp;nbsp; 190s HDF files&amp;nbsp; from a Folder (J:\RapidEyr_Atcor\HDF).&amp;nbsp; Here is the example of file name&amp;nbsp; in the HDF Folder:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;AtmosCorrected_&lt;SPAN style="background: yellow;"&gt;4549227_2014-12-23_RE1_3A_278182&lt;/SPAN&gt;.hdf&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;AtmosCorrected_&lt;SPAN style="background: yellow;"&gt;4549227_2015-02-15_RE1_3A_278163&lt;/SPAN&gt;.hdf&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;AtmosCorrected_&lt;SPAN style="background: yellow;"&gt;4549227_2015-01-13_RE1_3A_278182&lt;/SPAN&gt;.hdf&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;AtmosCorrected_&lt;SPAN style="background: yellow;"&gt;4549227_2015-03-23_RE1_3A_278102&lt;/SPAN&gt;.hdf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each HDF&amp;nbsp; file contains 13 bands. But I want to extract first&amp;nbsp; 5 bands and convert to TIFF files&amp;nbsp; and&amp;nbsp; save them in a folder. Since 1 have 190 HDF files,&amp;nbsp; I want to create 190 folders in J:\RapidEyr_Atcor\TIFF . Folder name should be like this:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;J:\RapidEyr_Atcor\TIF&lt;SPAN style="background: yellow;"&gt; \4549227_2014-12-23_RE1_3A_278182&lt;/SPAN&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;J:\RapidEyr_Atcor\TIF&lt;SPAN style="background: yellow;"&gt; \4549227_2015-02-15_RE1_3A_278163&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;J:\RapidEyr_Atcor\TIF&lt;SPAN style="background: yellow;"&gt; \4549227_2015-01-13_RE1_3A_278182&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;J:\RapidEyr_Atcor\TIF&lt;SPAN style="background: yellow;"&gt; \4549227_2015-03-23_RE1_3A_278102&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P&gt;Each folder will be contained 5 tiff files. The file names would be&lt;STRONG&gt;:&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; background: yellow;"&gt;4549227_2015-02-15_RE1_3A_278163&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;_b1. tif&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; background: yellow;"&gt;4549227_2015-02-15_RE1_3A_278163_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;b2.tif&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; background: yellow;"&gt;4549227_2015-02-15_RE1_3A_278163&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;_b3.tif&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; background: yellow;"&gt;4549227_2015-02-15_RE1_3A_278163_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;b4.tif&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; background: yellow;"&gt;4549227_2015-02-15_RE1_3A_278163&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;_b5.tif&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P&gt;Following in ArcPython Script works fine when input HDF files already have been in different sub folders according to the date and tiles.&amp;nbsp; But I have problem to define Folder names and files&amp;nbsp; names in the folder. If someone help me out, then it will be save me a lot of time.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Zia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#-------------
&lt;SPAN style="font-size: 10pt;"&gt;i&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;mport arcpy&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt;try:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; arcpy.env.workspace = r"J:\RapidEyr_Atcor\HDF"&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; rasterListA = arcpy.ListRasters()&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; for raster in rasterListA:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; tifOutA=" M:\\TIF\\"+raster[15:40]&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; arcpy.ExtractSubDataset_management(raster,tifOutA+"_B1"+".tif", "0")&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; arcpy.ExtractSubDataset_management(raster,tifOutA+"_B2"+".tif", "1")&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; arcpy.ExtractSubDataset_management(raster,tifOutA+"_B3"+".tif", "2")&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; arcpy.ExtractSubDataset_management(raster,tifOutA+"_B4"+".tif", "3")&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; arcpy.ExtractSubDataset_management(raster,tifOutA+"_B5"+".tif", "4")&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt;except:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; print "Extract Subdataset example failed."&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; print arcpy.GetMessages()&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 23:38:10 GMT</pubDate>
    <dc:creator>ZiaAhmed</dc:creator>
    <dc:date>2021-12-10T23:38:10Z</dc:date>
    <item>
      <title>Batch Processing - Composite Images</title>
      <link>https://community.esri.com/t5/python-questions/batch-processing-composite-images/m-p/95134#M7417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am processing&amp;nbsp; 190s HDF files&amp;nbsp; from a Folder (J:\RapidEyr_Atcor\HDF).&amp;nbsp; Here is the example of file name&amp;nbsp; in the HDF Folder:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;AtmosCorrected_&lt;SPAN style="background: yellow;"&gt;4549227_2014-12-23_RE1_3A_278182&lt;/SPAN&gt;.hdf&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;AtmosCorrected_&lt;SPAN style="background: yellow;"&gt;4549227_2015-02-15_RE1_3A_278163&lt;/SPAN&gt;.hdf&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;AtmosCorrected_&lt;SPAN style="background: yellow;"&gt;4549227_2015-01-13_RE1_3A_278182&lt;/SPAN&gt;.hdf&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;AtmosCorrected_&lt;SPAN style="background: yellow;"&gt;4549227_2015-03-23_RE1_3A_278102&lt;/SPAN&gt;.hdf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each HDF&amp;nbsp; file contains 13 bands. But I want to extract first&amp;nbsp; 5 bands and convert to TIFF files&amp;nbsp; and&amp;nbsp; save them in a folder. Since 1 have 190 HDF files,&amp;nbsp; I want to create 190 folders in J:\RapidEyr_Atcor\TIFF . Folder name should be like this:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;J:\RapidEyr_Atcor\TIF&lt;SPAN style="background: yellow;"&gt; \4549227_2014-12-23_RE1_3A_278182&lt;/SPAN&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;J:\RapidEyr_Atcor\TIF&lt;SPAN style="background: yellow;"&gt; \4549227_2015-02-15_RE1_3A_278163&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;J:\RapidEyr_Atcor\TIF&lt;SPAN style="background: yellow;"&gt; \4549227_2015-01-13_RE1_3A_278182&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;J:\RapidEyr_Atcor\TIF&lt;SPAN style="background: yellow;"&gt; \4549227_2015-03-23_RE1_3A_278102&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P&gt;Each folder will be contained 5 tiff files. The file names would be&lt;STRONG&gt;:&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; background: yellow;"&gt;4549227_2015-02-15_RE1_3A_278163&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;_b1. tif&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; background: yellow;"&gt;4549227_2015-02-15_RE1_3A_278163_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;b2.tif&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; background: yellow;"&gt;4549227_2015-02-15_RE1_3A_278163&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;_b3.tif&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; background: yellow;"&gt;4549227_2015-02-15_RE1_3A_278163_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;b4.tif&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; background: yellow;"&gt;4549227_2015-02-15_RE1_3A_278163&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;_b5.tif&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P&gt;Following in ArcPython Script works fine when input HDF files already have been in different sub folders according to the date and tiles.&amp;nbsp; But I have problem to define Folder names and files&amp;nbsp; names in the folder. If someone help me out, then it will be save me a lot of time.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Zia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#-------------
&lt;SPAN style="font-size: 10pt;"&gt;i&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;mport arcpy&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt;try:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; arcpy.env.workspace = r"J:\RapidEyr_Atcor\HDF"&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; rasterListA = arcpy.ListRasters()&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; for raster in rasterListA:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; tifOutA=" M:\\TIF\\"+raster[15:40]&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; arcpy.ExtractSubDataset_management(raster,tifOutA+"_B1"+".tif", "0")&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; arcpy.ExtractSubDataset_management(raster,tifOutA+"_B2"+".tif", "1")&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; arcpy.ExtractSubDataset_management(raster,tifOutA+"_B3"+".tif", "2")&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; arcpy.ExtractSubDataset_management(raster,tifOutA+"_B4"+".tif", "3")&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; arcpy.ExtractSubDataset_management(raster,tifOutA+"_B5"+".tif", "4")&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt;except:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; print "Extract Subdataset example failed."&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10pt;"&gt; print arcpy.GetMessages()&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:38:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-processing-composite-images/m-p/95134#M7417</guid>
      <dc:creator>ZiaAhmed</dc:creator>
      <dc:date>2021-12-10T23:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Processing - Composite Images</title>
      <link>https://community.esri.com/t5/python-questions/batch-processing-composite-images/m-p/95135#M7418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;could you format your code using one of the methods here &lt;A href="https://community.esri.com/migration-blogpost/55181"&gt;Code Formatting... the basics++&lt;/A&gt; &lt;/P&gt;&lt;P&gt;your indentation is either incorrect or it didn't get carried over during the copy-paste&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2015 10:44:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/batch-processing-composite-images/m-p/95135#M7418</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-11-17T10:44:12Z</dc:date>
    </item>
  </channel>
</rss>

