<?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: Extract multiple raster by mask automatically in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151692#M8544</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavan Yadav,&lt;/P&gt;&lt;P&gt;I appreciate your suggestion. It is very helpful.&lt;/P&gt;&lt;P&gt;I got another issue. I want to convert multiple NetCDF files to rasters&lt;/P&gt;&lt;P&gt;using ArcPy or Python.&lt;/P&gt;&lt;P&gt;Here is the code for a NetCDF file that I learned from ESRI. Can you help&lt;/P&gt;&lt;P&gt;me to edit it to read convert multiple file?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;Import system modules&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;Set local variables&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inNetCDFFile = "C:/data/netcdf/rainfall.nc"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;variable = "pptx"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XDimension = "lon"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YDimension = "lat"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;outRasterLayer = "rainfall"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bandDimmension = ""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dimensionValues = ""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;valueSelectionMethod = ""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cellRegistration = ""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;Execute MakeNetCDFRasterLayer&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.MakeNetCDFRasterLayer_md(inNetCDFFile, variable, XDimension,&lt;/P&gt;&lt;P&gt;YDimension,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                               outRasterLayer, bandDimmension,&lt;/P&gt;&lt;P&gt;dimensionValues,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                               valueSelectionMethod, cellRegistration)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Oct 2019 04:41:06 GMT</pubDate>
    <dc:creator>gianguyen</dc:creator>
    <dc:date>2019-10-01T04:41:06Z</dc:date>
    <item>
      <title>Extract multiple raster by mask automatically</title>
      <link>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151689#M8541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Community,&amp;nbsp;&lt;BR /&gt;I am working with a project where I have to extract 3650 rasters. It will take forever to get it done manually.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am thinking about using ArcPy or Modelbuilder to do it automatically.&lt;/P&gt;&lt;P&gt;Can you help me with this?&lt;/P&gt;&lt;P&gt;Thank you so much&lt;/P&gt;&lt;P&gt;Gia Nguyen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2019 15:23:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151689#M8541</guid>
      <dc:creator>gianguyen</dc:creator>
      <dc:date>2019-09-20T15:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple raster by mask automatically</title>
      <link>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151690#M8542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would look at this GP tool and you can batch it in Model Builder -&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/extract-by-mask.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/extract-by-mask.htm"&gt;Extract by Mask—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;or write Python to iterate through and do the process.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2019 18:47:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151690#M8542</guid>
      <dc:creator>George_Thompson</dc:creator>
      <dc:date>2019-09-20T18:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple raster by mask automatically</title>
      <link>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151691#M8543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alternatively you can use the &lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/clip.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/clip.htm"&gt;Clip Raster—Data Management toolbox | ArcGIS Desktop&lt;/A&gt; tool. But it all depends on your need. The Clip Raster tool is bit different from the the Extract by Mask tool. The Clip Raster tool cuts out a portion of a raster dataset (extent changes) while Extract by Mask tool does not change the extent of the raster but converts values outside of the clip feature/raster to NoData.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is one example:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt; import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;import os&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;workspace = r"D:\test\Stowe.gdb"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;arcpy.env.workspace = "D:\test\Stowe.gdb"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;fc = r'D:\test\Stowe.gdb\clip_feature'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;desc = arcpy.Describe(fc)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;xmin = desc.extent.XMin&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;xmax = desc.extent.XMax&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;ymin = desc.extent.YMin&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;ymax = desc.extent.YMax&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;rectangle = str(xmin) +' '+ str(ymin) +' '+ str(xmax) +' '+ str(ymax)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;rasters = []&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;walk = arcpy.da.Walk(workspace, datatype="RasterDataset") #&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;for dirpath, dirnames, filenames in walk:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for filename in filenames:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(filename)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rasters.append(os.path.join(dirpath, filename))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;for raster in rasters: &amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Clip_management(raster, rectangle, raster + "_clip")&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2019 22:48:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151691#M8543</guid>
      <dc:creator>PavanYadav</dc:creator>
      <dc:date>2019-09-24T22:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple raster by mask automatically</title>
      <link>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151692#M8544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavan Yadav,&lt;/P&gt;&lt;P&gt;I appreciate your suggestion. It is very helpful.&lt;/P&gt;&lt;P&gt;I got another issue. I want to convert multiple NetCDF files to rasters&lt;/P&gt;&lt;P&gt;using ArcPy or Python.&lt;/P&gt;&lt;P&gt;Here is the code for a NetCDF file that I learned from ESRI. Can you help&lt;/P&gt;&lt;P&gt;me to edit it to read convert multiple file?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;Import system modules&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;Set local variables&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inNetCDFFile = "C:/data/netcdf/rainfall.nc"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;variable = "pptx"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XDimension = "lon"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YDimension = "lat"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;outRasterLayer = "rainfall"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bandDimmension = ""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dimensionValues = ""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;valueSelectionMethod = ""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cellRegistration = ""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;Execute MakeNetCDFRasterLayer&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.MakeNetCDFRasterLayer_md(inNetCDFFile, variable, XDimension,&lt;/P&gt;&lt;P&gt;YDimension,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                               outRasterLayer, bandDimmension,&lt;/P&gt;&lt;P&gt;dimensionValues,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                               valueSelectionMethod, cellRegistration)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2019 04:41:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151692#M8544</guid>
      <dc:creator>gianguyen</dc:creator>
      <dc:date>2019-10-01T04:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple raster by mask automatically</title>
      <link>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151693#M8545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your suggestions. They are very useful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Besides, I also found a tool SAMPLE which can extract value from rasters (single/multi bands) into a grid (fishnet).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, thank you so much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2019 04:45:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151693#M8545</guid>
      <dc:creator>gianguyen</dc:creator>
      <dc:date>2019-10-01T04:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple raster by mask automatically</title>
      <link>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151694#M8546</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/372870"&gt;gia nguyen&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;To filter *.nc files only please try, the following:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;ncFiles = []&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;workspace = r"D:\test"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#datatype limits the results returned. See supported datatypes: &lt;BR /&gt;#&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/walk.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/walk.htm"&gt;Walk—Help | ArcGIS for Desktop&lt;/A&gt;. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;walk = arcpy.da.Walk(workspace) &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;for dirpath, dirnames, filenames in walk:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for filename in filenames:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#NC is not a supported datatype so filtering like this: "if filename[-3:]=='.nc'"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if filename[-3:]=='.nc': &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ncFiles.append(os.path.join(dirpath, filename))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2019 18:55:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151694#M8546</guid>
      <dc:creator>PavanYadav</dc:creator>
      <dc:date>2019-10-01T18:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple raster by mask automatically</title>
      <link>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151695#M8547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm glad you find it useful. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2019 18:56:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151695#M8547</guid>
      <dc:creator>PavanYadav</dc:creator>
      <dc:date>2019-10-01T18:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple raster by mask automatically</title>
      <link>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151696#M8548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Louise Thank you for your response. While waiting for the best solution,&lt;/P&gt;&lt;P&gt;I tried the code below. It works still now. I use it to convert from NetCDF&lt;/P&gt;&lt;P&gt;files to rasters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;from arcpy import env&lt;/P&gt;&lt;P&gt;from arcpy.sa import *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input_Temp_folder = "E:\Mekong\DATA\JMP_Deeplearning_data\Mekong_temp\Temp_2017"&lt;/P&gt;&lt;P&gt;Out_Temp_folder_Max&lt;/P&gt;&lt;P&gt;="E:\Mekong\DATA\JMP_Deeplearning_data\Mekong_temp\Temp_2017\Max"&lt;/P&gt;&lt;P&gt;Out_Temp_folder_Min&lt;/P&gt;&lt;P&gt;="E:\Mekong\DATA\JMP_Deeplearning_data\Mekong_temp\Temp_2017\Min"&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = Input_Temp_folder&lt;/P&gt;&lt;P&gt;arcpy.env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;arcpy.env.scratchWorkspace = Out_Temp_folder_Max # Create scratch workspace&lt;/P&gt;&lt;P&gt;arcpy.env.scratchWorkspace = Out_Temp_folder_Min # create Scratch workspace&lt;/P&gt;&lt;P&gt;variableTemp1 = "T2MMAX"&lt;/P&gt;&lt;P&gt;variableTemp2="T2MMIN"&lt;/P&gt;&lt;P&gt;XDimension = "lon"&lt;/P&gt;&lt;P&gt;YDimension = "lat"&lt;/P&gt;&lt;P&gt;time = "time"&lt;/P&gt;&lt;P&gt;NetCDFfiles = arcpy.ListFiles("*.nc4.nc")&lt;/P&gt;&lt;P&gt;print NetCDFfiles&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for filename in NetCDFfiles:&lt;/P&gt;&lt;P&gt;        print ("Processing: " + filename)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        day = filename[27:35]# extract date in the filenames&lt;/P&gt;&lt;P&gt;        outRasterLayer_Temp_Max = variableTemp1 + "_" + day # create a&lt;/P&gt;&lt;P&gt;time series for names&lt;/P&gt;&lt;P&gt;        outRasterLayer_Temp_Min = variableTemp2 + "_" + day # create a&lt;/P&gt;&lt;P&gt;time series for names&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        InNetCDTemp = arcpy.env.workspace + "/" + filename # get a file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        arcpy.MakeNetCDFRasterLayer_md(InNetCDTemp, variableTemp1,&lt;/P&gt;&lt;P&gt;XDimension, YDimension, outRasterLayer_Temp_Max,time)&lt;/P&gt;&lt;P&gt;        arcpy.MakeNetCDFRasterLayer_md(InNetCDTemp, variableTemp2,&lt;/P&gt;&lt;P&gt;XDimension, YDimension, outRasterLayer_Temp_Min,time)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        outRasterTemp_Folder = Out_Temp_folder_Min&lt;/P&gt;&lt;P&gt;        arcpy.SplitRaster_management&lt;/P&gt;&lt;P&gt;(outRasterLayer_Temp_Max,Out_Temp_folder_Max,outRasterLayer_Temp_Max,"POLYGON_FEATURES","TIFF","NEAREST","","","","DEGREES","","","Mekong_Basin","","","")&lt;/P&gt;&lt;P&gt;        arcpy.SplitRaster_management&lt;/P&gt;&lt;P&gt;(outRasterLayer_Temp_Min,Out_Temp_folder_Min,outRasterLayer_Temp_Min,"POLYGON_FEATURES","TIFF","NEAREST","","","","DEGREES","","","Mekong_Basin","","","")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Oct 2019 20:37:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extract-multiple-raster-by-mask-automatically/m-p/151696#M8548</guid>
      <dc:creator>gianguyen</dc:creator>
      <dc:date>2019-10-16T20:37:42Z</dc:date>
    </item>
  </channel>
</rss>

