<?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: netCDF4 and ArcGIS in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278519#M21509</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Something isn't making sense. The line that is throwing the error is doing nothing except checking to see if "elem" is an iterable. If you open up this file: "C:\Python27\ArcGIS10.1\lib\site-packages\netCDF4_utils.py", it looks like the import of numpy as np (on line 1) is only being executed successfully the first time you run the tool. Subsequent runs fail and only return a NoneType object. I have no idea why.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully someone else can enlighten us both.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Mar 2013 12:41:09 GMT</pubDate>
    <dc:creator>PhilMorefield</dc:creator>
    <dc:date>2013-03-26T12:41:09Z</dc:date>
    <item>
      <title>netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278507#M21497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having issues using the netCDF4 module within my python script for one of my ArcGIS tools.&amp;nbsp; The weird thing is, the tool runs fine the first time, but then when I run the tool a second time I am getting an error.&amp;nbsp; The tool is no longer able to read from the netCDF file, and gives the error when I try to read the latitude values of the file.&amp;nbsp; I then have to restart ArcGIS, and the tool then runs successfully once, but then if I run the tool again I get the same error and need to restart again.&amp;nbsp; Does anyone have any idea what is going on here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you !&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 20:01:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278507#M21497</guid>
      <dc:creator>StephenFricke</dc:creator>
      <dc:date>2013-03-19T20:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278508#M21498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The conflict between netCDF4 and ArcGIS has a long and illustrious history. Example &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/18047-quot-DLL-Load-Failed-The-specified-procedure-could-not-be-found.-quot?p=57249#post57249"&gt;here&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your problem sounds different from the one I had a few years ago, though. So small chance it's a problem with your code. Beyond that, there are at least two alternative netCDF readers that do work with ArcGIS:&lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://dirac.cnrs-orleans.fr/plone/software/scientificpython/"&gt;ScientificPython&lt;/A&gt; - I've been submitting Windows installers for this project. Right now the latest one is compatible with AGD 10.0.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://docs.scipy.org/doc/scipy/reference/tutorial/io.html#module-scipy.io.netcdf"&gt;scipy.io.netcdf&lt;/A&gt; - This will bomb on really, really big files. ScientificPython won't.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;SPAN&gt;There are others, and they all use very similar APIs. Unfortunately, none of them offer the cool bells-and-whistles that netCDF4 offers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 20:28:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278508#M21498</guid>
      <dc:creator>PhilMorefield</dc:creator>
      <dc:date>2013-03-19T20:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278509#M21499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The conflict between netCDF4 and ArcGIS has a long and illustrious history. Example &lt;A href="http://forums.arcgis.com/threads/18047-quot-DLL-Load-Failed-The-specified-procedure-could-not-be-found.-quot?p=57249#post57249"&gt;here&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Your problem sounds different from the one I had a few years ago, though. So small chance it's a problem with your code. Beyond that, there are at least two alternative netCDF readers that do work with ArcGIS:&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://dirac.cnrs-orleans.fr/plone/software/scientificpython/"&gt;ScientificPython&lt;/A&gt; - I've been submitting Windows installers for this project. Right now the latest one is compatible with AGD 10.0.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://docs.scipy.org/doc/scipy/reference/tutorial/io.html#module-scipy.io.netcdf"&gt;scipy.io.netcdf&lt;/A&gt; - This will bomb on really, really big files. ScientificPython won't.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;There are others, and they all use very similar APIs. Unfortunately, none of them offer the cool bells-and-whistles that netCDF4 offers.&lt;BR /&gt;&lt;BR /&gt;Hope that helps.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey, thank you for the response.&amp;nbsp; I am running AGD 10.1, which uses python 2.7.&amp;nbsp; It looks like the latest windows installer is for python 2.6.&amp;nbsp; I believe I tried this one and was having compatibility issues with ArcGIS 10.1.&amp;nbsp; Do you know any window installers for python 2.7?&amp;nbsp; Thanks again.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 21:38:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278509#M21499</guid>
      <dc:creator>StephenFricke</dc:creator>
      <dc:date>2013-03-19T21:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278510#M21500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hey, thank you for the response.&amp;nbsp; I am running AGD 10.1, which uses python 2.7.&amp;nbsp; It looks like the latest windows installer is for python 2.6.&amp;nbsp; I believe I tried this one and was having compatibility issues with ArcGIS 10.1.&amp;nbsp; Do you know any window installers for python 2.7?&amp;nbsp; Thanks again.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I submitted an installer for Python 2.7 to the ScientificPython author. He usually posts those to the webpage in ~24 hours. If you need it before he posts it, send me a message with your email.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 12:00:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278510#M21500</guid>
      <dc:creator>PhilMorefield</dc:creator>
      <dc:date>2013-03-20T12:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278511#M21501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just a week ago Christoph Gohlke built a completely static NetCDF4 module specifically for use with ArcGIS 10.1, and in my testing it has worked flawlessly.&amp;nbsp; Check out the link to netCDF4-1.0.5dev-ArcGIS-10.1.win32-py2.7.exe on Christoph's amazing Python libraries for Windows page: &lt;/SPAN&gt;&lt;A href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#netcdf4"&gt;http://www.lfd.uci.edu/~gohlke/pythonlibs/#netcdf4&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 15:23:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278511#M21501</guid>
      <dc:creator>RichardSignell</dc:creator>
      <dc:date>2013-03-20T15:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278512#M21502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Just a week ago Christoph Gohlke built a completely static NetCDF4 module specifically for use with ArcGIS 10.1, and in my testing it has worked flawlessly.&amp;nbsp; Check out the link to netCDF4-1.0.5dev-ArcGIS-10.1.win32-py2.7.exe on Christoph's amazing Python libraries for Windows page: &lt;A href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#netcdf4"&gt;http://www.lfd.uci.edu/~gohlke/pythonlibs/#netcdf4&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;That's a good point. That netCDF4 installer does work for me on a 64-bit Windows 7 machine, but not on my 32-bit Windows XP computers.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 16:20:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278512#M21502</guid>
      <dc:creator>PhilMorefield</dc:creator>
      <dc:date>2013-03-20T16:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278513#M21503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you so much for the responses.&amp;nbsp; I downloaded the python 2.7 version of ScientificPython, and for some reason I am not having success running the module within Arc.&amp;nbsp; I keep getting an error of "IOError: netcdf: Invalid argument", but the same argument seems to be working outside of Arc.&amp;nbsp; I also downloaded the mentioned netCDF4 module and I am getting the same error I was originally getting in the first post.&amp;nbsp; My script runs perfect one time through, but then the next time through I am have problems. I first read in the netcdf file using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;dataset= Dataset('nameofmynetcdf.nc')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And then I try and read the latitudes using the command:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; lt = dataset.variables['lat'][:]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This works perfectly the first time through, but then second time through I get an error for this line which states:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;AttributeError: 'NoneType' object has no attribute 'iterable'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know why this would be?&amp;nbsp; I am reading this data via opendap if that makes any difference at all(?).&amp;nbsp; I would really appreciate any help anyone has to offer.&amp;nbsp; Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 18:23:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278513#M21503</guid>
      <dc:creator>StephenFricke</dc:creator>
      <dc:date>2013-03-22T18:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278514#M21504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thank you so much for the responses.&amp;nbsp; I downloaded the python 2.7 version of ScientificPython, and for some reason I am not having success running the module within Arc.&amp;nbsp; I keep getting an error of "IOError: netcdf: Invalid argument", but the same argument seems to be working outside of Arc.&amp;nbsp; I also downloaded the mentioned netCDF4 module and I am getting the same error I was originally getting in the first post.&amp;nbsp; My script runs perfect one time through, but then the next time through I am have problems. I first read in the netcdf file using:&lt;BR /&gt;&lt;BR /&gt;dataset= Dataset('nameofmynetcdf.nc')&lt;BR /&gt;&lt;BR /&gt;And then I try and read the latitudes using the command:&lt;BR /&gt;&lt;BR /&gt; lt = dataset.variables['lat'][:]&lt;BR /&gt;&lt;BR /&gt;This works perfectly the first time through, but then second time through I get an error for this line which states:&lt;BR /&gt;&lt;BR /&gt;AttributeError: 'NoneType' object has no attribute 'iterable'&lt;BR /&gt;&lt;BR /&gt;Does anyone know why this would be?&amp;nbsp; I am reading this data via opendap if that makes any difference at all(?).&amp;nbsp; I would really appreciate any help anyone has to offer.&amp;nbsp; Thank you!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;It might best if you posted some or all of your code, and included the line number of the error. There are instruction at the top of the Python forum on how to post code here.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 19:45:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278514#M21504</guid>
      <dc:creator>PhilMorefield</dc:creator>
      <dc:date>2013-03-22T19:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278515#M21505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; I also downloaded the mentioned netCDF4 module and I am getting the same error I was originally getting in the first post.&amp;nbsp;&amp;nbsp; I am reading this data via opendap if that makes any difference at all(?).&amp;nbsp; I would really appreciate any help anyone has to offer.&amp;nbsp; Thank you!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See if you can run this python toolbox, which uses NetCDF4 with OPeNDAP in ArcGIS 10.1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://github.com/rsignell-usgs/dap2arc"&gt;https://github.com/rsignell-usgs/dap2arc&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If it works for you more than once,&amp;nbsp; you could then focus on issues with your code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 20:22:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278515#M21505</guid>
      <dc:creator>RichardSignell</dc:creator>
      <dc:date>2013-03-22T20:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278516#M21506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is a condensed version of my code.&amp;nbsp; You probably won't be able to access this data, but if you know of any other opendap data with a latitude variable, you could substitute that in the data line.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
from netCDF4 import Dataset
data= 'http://cloud.insideidaho.org:8001/reacch/CMIP5/maca_huss_BNU-ESM_historical_1950_1959_WUSA.nc'
MyData=Dataset(data)
lt = MyData.variables['lat'][:]
arcpy.AddMessage(lt)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I run as a script in an ArcGIS toolbox, it runs successfully the first time, and prints off all of the latitudes, the second time however, I get this error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\netcdf4 trouble\netcdf4problem.py", line 5, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lt = MyData.variables['lat'][:]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "netCDF4.pyx", line 2631, in netCDF4.Variable.__getitem__ (netCDF4.c:32455)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.1\lib\site-packages\netCDF4_utils.py", line 127, in _StartCountStride&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if np.iterable(elem):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AttributeError: 'NoneType' object has no attribute 'iterable'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (netcdf4problem).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:33:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278516#M21506</guid>
      <dc:creator>StephenFricke</dc:creator>
      <dc:date>2021-12-11T13:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278517#M21507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Here is a condensed version of my code.&amp;nbsp; You probably won't be able to access this data, but if you know of any other opendap data with a latitude variable, you could substitute that in the data line.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
from netCDF4 import Dataset
data= 'http://cloud.insideidaho.org:8001/reacch/CMIP5/maca_huss_BNU-ESM_historical_1950_1959_WUSA.nc'
MyData=Dataset(data)
lt = MyData.variables['lat'][:]
arcpy.AddMessage(lt)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;When I run as a script in an ArcGIS toolbox, it runs successfully the first time, and prints off all of the latitudes, the second time however, I get this error message:&lt;BR /&gt;&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "C:\netcdf4 trouble\netcdf4problem.py", line 5, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lt = MyData.variables['lat'][:]&lt;BR /&gt;&amp;nbsp; File "netCDF4.pyx", line 2631, in netCDF4.Variable.__getitem__ (netCDF4.c:32455)&lt;BR /&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.1\lib\site-packages\netCDF4_utils.py", line 127, in _StartCountStride&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if np.iterable(elem):&lt;BR /&gt;AttributeError: 'NoneType' object has no attribute 'iterable'&lt;BR /&gt;&lt;BR /&gt;Failed to execute (netcdf4problem).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Nothing is jumping out at me. I can see that the climate variable has 3,650 time steps. Is your script designed to repeat itself 3,650 times in order to extract the climate variable and lat/lons for each time step?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:33:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278517#M21507</guid>
      <dc:creator>PhilMorefield</dc:creator>
      <dc:date>2021-12-11T13:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278518#M21508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Nothing is jumping out at me. I can see that the climate variable has 3,650 time steps. Is your script designed to repeat itself 3,650 times in order to extract the climate variable and lat/lons for each time step?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Well the tool is designed so that it can extract a particular climate variable for a particular spatial and temporal extent from the netCDF file.&amp;nbsp; There is 3650 time steps because it is daily data for an entire decade(no leap years).&amp;nbsp; If someone wanted data for every day, I have&amp;nbsp; a tool that can extract data for each time step.&amp;nbsp; I just used this very simple example of the tool because I am having the same issue with this small little snippet of code as I am with my longer more complex code.&amp;nbsp; For some reason I am able to run the tool fine when I first open ArcGIS, but after that when I run it again, for whatever reason, I am getting this error.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 03:38:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278518#M21508</guid>
      <dc:creator>StephenFricke</dc:creator>
      <dc:date>2013-03-26T03:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278519#M21509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Something isn't making sense. The line that is throwing the error is doing nothing except checking to see if "elem" is an iterable. If you open up this file: "C:\Python27\ArcGIS10.1\lib\site-packages\netCDF4_utils.py", it looks like the import of numpy as np (on line 1) is only being executed successfully the first time you run the tool. Subsequent runs fail and only return a NoneType object. I have no idea why.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully someone else can enlighten us both.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 12:41:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278519#M21509</guid>
      <dc:creator>PhilMorefield</dc:creator>
      <dc:date>2013-03-26T12:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278520#M21510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Something isn't making sense. The line that is throwing the error is doing nothing except checking to see if "elem" is an iterable. If you open up this file: "C:\Python27\ArcGIS10.1\lib\site-packages\netCDF4_utils.py", it looks like the import of numpy as np (on line 1) is only being executed successfully the first time you run the tool. Subsequent runs fail and only return a NoneType object. I have no idea why.&lt;BR /&gt;&lt;BR /&gt;Hopefully someone else can enlighten us both.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, very frustrating!&amp;nbsp; I appreciate you taking a look though.&amp;nbsp; So does the ScientificPython module not read opendap?&amp;nbsp; I was thinking that may be a decent alternative if this issue can't be worked out, but I get an invalid argument error when I try and put in a url for the netcdf dataset.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2013 15:56:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278520#M21510</guid>
      <dc:creator>StephenFricke</dc:creator>
      <dc:date>2013-03-26T15:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278521#M21511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Yes, very frustrating!&amp;nbsp; I appreciate you taking a look though.&amp;nbsp; So does the ScientificPython module not read opendap?&amp;nbsp; I was thinking that may be a decent alternative if this issue can't be worked out, but I get an invalid argument error when I try and put in a url for the netcdf dataset.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I think netCDF4 is the only package with built-in OPeNDAP support. I've used &lt;/SPAN&gt;&lt;A href="https://pypi.python.org/pypi/Pydap" rel="nofollow noopener noreferrer" target="_blank"&gt;Pydap&lt;/A&gt;&lt;SPAN&gt;, but there are no Windows installers that I know of. You can install it using &lt;/SPAN&gt;&lt;A href="https://pypi.python.org/pypi/pip" rel="nofollow noopener noreferrer" target="_blank"&gt;pip&lt;/A&gt;&lt;SPAN&gt; or &lt;/SPAN&gt;&lt;A href="https://pypi.python.org/pypi/setuptools" rel="nofollow noopener noreferrer" target="_blank"&gt;easy_install&lt;/A&gt;&lt;SPAN&gt;. And it isn't as clean as the netCDF4 syntax:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from pydap.client import open_url

daymetfile = open_url(r'http://daymet.ornl.gov/thredds/dodsC/allcf/2011/12484_2011/tmax.nc')
var_raw = daymetfile['tmax'].array[100,:,:]&amp;nbsp; # this slices out data for the 100th day

# then I had to do some reshaping of the array and convert it to a raster using arcpy
# maybe there is a better way to do this?
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I would say that netCDF4 is the preferred alternative. The error you're getting doesn't make much sense.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you running the condensed code you posted earlier out of a &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00150000002r000000" rel="nofollow noopener noreferrer" target="_blank"&gt;Custom Toolbox or Python Toolbox?&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:33:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278521#M21511</guid>
      <dc:creator>PhilMorefield</dc:creator>
      <dc:date>2021-12-11T13:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278522#M21512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I think netCDF4 is the only package with built-in OPeNDAP support. I've used &lt;A href="https://pypi.python.org/pypi/Pydap" rel="nofollow noopener noreferrer" target="_blank"&gt;Pydap&lt;/A&gt;, but there are no Windows installers that I know of. You can install it using &lt;A href="https://pypi.python.org/pypi/pip" rel="nofollow noopener noreferrer" target="_blank"&gt;pip&lt;/A&gt; or &lt;A href="https://pypi.python.org/pypi/setuptools" rel="nofollow noopener noreferrer" target="_blank"&gt;easy_install&lt;/A&gt;. And it isn't as clean as the netCDF4 syntax:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from pydap.client import open_url

daymetfile = open_url(r'http://daymet.ornl.gov/thredds/dodsC/allcf/2011/12484_2011/tmax.nc')
var_raw = daymetfile['tmax'].array[100,:,:]&amp;nbsp; # this slices out data for the 100th day

# then I had to do some reshaping of the array and convert it to a raster using arcpy
# maybe there is a better way to do this?
&lt;/PRE&gt;&lt;BR /&gt;I would say that netCDF4 is the preferred alternative. The error you're getting doesn't make much sense.&lt;BR /&gt;&lt;BR /&gt;Are you running the condensed code you posted earlier out of a &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00150000002r000000" rel="nofollow noopener noreferrer" target="_blank"&gt;Custom Toolbox or Python Toolbox?&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pydap is what I have been using, but recently I have been trying to access data on a thredds server rather than an opendap server, and pydap was giving me issues on the thredds server that I never experienced with the opendap server, so that is when I decided to try netcdf4.&amp;nbsp; The netcdf4 module worked on the thredds server, but only once, like I have explained, and then I keep getting this error each subsequent run.&amp;nbsp; This code is being run out of a normal toolbox.&amp;nbsp; I have never used a python toolbox, do you think that could be the problem?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:33:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278522#M21512</guid>
      <dc:creator>StephenFricke</dc:creator>
      <dc:date>2021-12-11T13:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278523#M21513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;pydap is what I have been using, but recently I have been trying to access data on a thredds server rather than an opendap server, and pydap was giving me issues on the thredds server that I never experienced with the opendap server, so that is when I decided to try netcdf4.&amp;nbsp; The netcdf4 module worked on the thredds server, but only once, like I have explained, and then I keep getting this error each subsequent run.&amp;nbsp; This code is being run out of a normal toolbox.&amp;nbsp; I have never used a python toolbox, do you think that could be the problem?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Well, the good news is that I can replicate your problem exactly. I'm using ArcGIS 10.0 sp5 on Windows 7 64. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But Rich's tool seems to work fine on ArcGIS 10.1. My guess is that netCDF4 isn't playing nice with the standard toolbox. The only difference I can see between Rich's project and this error is the use of a Python Toolbox.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Mar 2013 22:55:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278523#M21513</guid>
      <dc:creator>PhilMorefield</dc:creator>
      <dc:date>2013-03-27T22:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278524#M21514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am running into the same issue, using ArcGIS 10.2.2 and the netCDF4 module.&lt;/P&gt;&lt;P&gt;I can confirm that this has nothing to do with the script, which runs fine outside or Arcgis. It also runs fine the first time, before crashing invariably:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; File "netCDF4.pyx", line 2986, in netCDF4.Variable.__getitem__ (netCDF4.c:36632)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\ArcGIS10.2\lib\site-packages\netCDF4_utils.py", line 137, in _StartCountStride&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if np.iterable(elem):&lt;/P&gt;&lt;P&gt;AttributeError: 'NoneType' object has no attribute 'iterable'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would a completely statically linked version of netCDF4 fix this problem on 10.2.2 as well? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI, for whoever might run into a similar issue, I manage to partially resolve the issue by not running the script "in process". I&amp;nbsp; also had to isolate the netcdf part of the code in its own script, (run outside the main process). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is very messy because it basically opens a command prompt and starts the script like this:&lt;/P&gt;&lt;P&gt;path_to_script.py "arg1" "arg2" "arg3" .... If users have conflicting python instances, or if py files are not associated with the correct interpreter (for example if associated with a text aditor as many people do) it will fail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help or idea appreciated...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 14:36:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278524#M21514</guid>
      <dc:creator>ClementBouscasse</dc:creator>
      <dc:date>2014-09-22T14:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278525#M21515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have exactly the same issue, a script from a custom toolbox can be executed only once and then it results in an "AttributeError: 'NoneType' object has no attribute 'iterable'" when trying to subset a variable like:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; background-color: #f6f6f6;"&gt; lt = MyData.variables['lat'][:]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; background-color: #f6f6f6;"&gt;ArcGIS 10.1 SP1 on Win 7 with netCDF4 1.0.4 installed along with the ArcGIS Multidimensional Toolbox.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated!&lt;/P&gt;&lt;P&gt;Filip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2015 08:22:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278525#M21515</guid>
      <dc:creator>FilipKrál</dc:creator>
      <dc:date>2015-02-17T08:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: netCDF4 and ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278526#M21516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the best solution to this issue is to use the scientific python package available with ArcGIS Pro and soon to be available for ArcGIS 10.4. &lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.esri.com/esri/esri-insider/2014/11/05/strengthening-the-link-between-gis-and-science/" title="http://blogs.esri.com/esri/esri-insider/2014/11/05/strengthening-the-link-between-gis-and-science/"&gt;Strengthening the Link between GIS and Science | Esri Insider&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migration-blogpost/54750"&gt;Esri and the Scientific Community 2015 Roadmap&lt;/A&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 17:35:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/netcdf4-and-arcgis/m-p/278526#M21516</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2015-11-05T17:35:18Z</dc:date>
    </item>
  </channel>
</rss>

