<?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 convert NetCDF to raster in ArcMap Questions</title>
    <link>https://community.esri.com/t5/arcmap-questions/batch-convert-netcdf-to-raster/m-p/1223996#M4076</link>
    <description>&lt;P&gt;Hello, I am new to python and netcdf files and am trying to batch convert a bunch of netcdf files to rasters. When I run it only the last file in the folder seems to be being converted and copied. Here is the script I am using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import arcpy as ap
from arcpy import env
from arcpy.sa import*

arcpy.env.workspace = "C:/Users/sutor/Desktop/KC_Trial"
arcpy.env.overwriteOutput = True
OutputFolder = "C:/Users/Desktop/KC_Trial"
NCfiles = arcpy.ListFiles("*.nc")

for filename in NCfiles:
print ("Processing: " + filename)
inNCfiles = arcpy.env.workspace + "/" + filename
fileroot = filename[0:(len(filename)-3)]
TempLayerFile = "cdf_KC"
outRaster = OutputFolder + "/" + fileroot

arcpy.MakeNetCDFRasterLayer_md(inNCfiles, "", "x", "y", TempLayerFile, "", "", "BY_VALUE")
arcpy.CopyRaster_management(TempLayerFile, outRaster + ".tif", "", "", "", "NONE", "NONE", "")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any ideas how to loop through the entire folder?&lt;/P&gt;</description>
    <pubDate>Fri, 21 Oct 2022 16:08:15 GMT</pubDate>
    <dc:creator>KristenCa</dc:creator>
    <dc:date>2022-10-21T16:08:15Z</dc:date>
    <item>
      <title>Batch convert NetCDF to raster</title>
      <link>https://community.esri.com/t5/arcmap-questions/batch-convert-netcdf-to-raster/m-p/1223996#M4076</link>
      <description>&lt;P&gt;Hello, I am new to python and netcdf files and am trying to batch convert a bunch of netcdf files to rasters. When I run it only the last file in the folder seems to be being converted and copied. Here is the script I am using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import arcpy as ap
from arcpy import env
from arcpy.sa import*

arcpy.env.workspace = "C:/Users/sutor/Desktop/KC_Trial"
arcpy.env.overwriteOutput = True
OutputFolder = "C:/Users/Desktop/KC_Trial"
NCfiles = arcpy.ListFiles("*.nc")

for filename in NCfiles:
print ("Processing: " + filename)
inNCfiles = arcpy.env.workspace + "/" + filename
fileroot = filename[0:(len(filename)-3)]
TempLayerFile = "cdf_KC"
outRaster = OutputFolder + "/" + fileroot

arcpy.MakeNetCDFRasterLayer_md(inNCfiles, "", "x", "y", TempLayerFile, "", "", "BY_VALUE")
arcpy.CopyRaster_management(TempLayerFile, outRaster + ".tif", "", "", "", "NONE", "NONE", "")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any ideas how to loop through the entire folder?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 16:08:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/batch-convert-netcdf-to-raster/m-p/1223996#M4076</guid>
      <dc:creator>KristenCa</dc:creator>
      <dc:date>2022-10-21T16:08:15Z</dc:date>
    </item>
  </channel>
</rss>

