<?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 Masking NetCDF file with shapefile in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/masking-netcdf-file-with-shapefile/m-p/350318#M12155</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to create a tool which will accept a shapefile, and then use this shapefile as a mask for calculating the mean of various netcdf files.&amp;nbsp; I have read up on the gdal library, but I am very confused on how to use these tools.&amp;nbsp; Instead I have tried to do it with the tools available in arcgis.&amp;nbsp; What I have done in my python script is convert the input shapefile into a raster where all values are 1, then I use the arcpy.RasterToNumpyArray command to convert the raster to a numpy array. I then multiply this array by the arrays I have created from the netcdf files.&amp;nbsp; So the product of the numpy array of the shapefile and the numpy array of the netcdf file should be the array of the netcdf file within the polygon extent, because I masked out all values outside the polygon extent as not a number. The tool runs successfully but my results are off.&amp;nbsp; I have noticed that when I convert the raster of the polygon to a numpy array, the numpy array is much larger than the raster and original polygon.&amp;nbsp; Does anyone know why the RasterToNumpyArray tool would create an array that is much bigger than the raster?&amp;nbsp; The reason I know it is much bigger is because when I convert the product of the numpy arrays back to a raster using the NumpyArrayToRaster command, it is the shape of my input shapfile, but just much larger, and with the same lower left hand corner point.&amp;nbsp; I would really appreciate and insight on what I might be doing wrong.&amp;nbsp; Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Feb 2013 21:48:00 GMT</pubDate>
    <dc:creator>StephenFricke</dc:creator>
    <dc:date>2013-02-07T21:48:00Z</dc:date>
    <item>
      <title>Masking NetCDF file with shapefile</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/masking-netcdf-file-with-shapefile/m-p/350318#M12155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to create a tool which will accept a shapefile, and then use this shapefile as a mask for calculating the mean of various netcdf files.&amp;nbsp; I have read up on the gdal library, but I am very confused on how to use these tools.&amp;nbsp; Instead I have tried to do it with the tools available in arcgis.&amp;nbsp; What I have done in my python script is convert the input shapefile into a raster where all values are 1, then I use the arcpy.RasterToNumpyArray command to convert the raster to a numpy array. I then multiply this array by the arrays I have created from the netcdf files.&amp;nbsp; So the product of the numpy array of the shapefile and the numpy array of the netcdf file should be the array of the netcdf file within the polygon extent, because I masked out all values outside the polygon extent as not a number. The tool runs successfully but my results are off.&amp;nbsp; I have noticed that when I convert the raster of the polygon to a numpy array, the numpy array is much larger than the raster and original polygon.&amp;nbsp; Does anyone know why the RasterToNumpyArray tool would create an array that is much bigger than the raster?&amp;nbsp; The reason I know it is much bigger is because when I convert the product of the numpy arrays back to a raster using the NumpyArrayToRaster command, it is the shape of my input shapfile, but just much larger, and with the same lower left hand corner point.&amp;nbsp; I would really appreciate and insight on what I might be doing wrong.&amp;nbsp; Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 21:48:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/masking-netcdf-file-with-shapefile/m-p/350318#M12155</guid>
      <dc:creator>StephenFricke</dc:creator>
      <dc:date>2013-02-07T21:48:00Z</dc:date>
    </item>
  </channel>
</rss>

