Skip to Content.

mget-help - [mget-help] can't interpolate NASA ocean color; netcdf4 fail; however netcdf4 is installed

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


[mget-help] can't interpolate NASA ocean color; netcdf4 fail; however netcdf4 is installed


Chronological Thread 
  • From: Rui Prieto <>
  • To: , Marta Tobeña <>
  • Subject: [mget-help] can't interpolate NASA ocean color; netcdf4 fail; however netcdf4 is installed
  • Date: Wed, 6 Apr 2016 15:40:11 +0000

Hi Jason and others,

have a request for help: while trying to get oceancolor data interpolated to points, we keept getting the error regarding missing netCDF4 module for Python (report reproduced at the end of the message)

System (on this machine; the problem is occurring in all machines):

ArcGIS 10.2.2.3552 (10.3 on the way but will still take some time to be installed on all machines)
Mget: 0.8a62
Windows: 8.1 Pro, 64 bit
Machine: Intel Core i7-4710MQ @ 2.5 Ghz; 32 GB RAM

Actions:

1. downloaded netCDF4-1.2.3.1-cp27-cp27m-win32.whl from the site https://pypi.python.org/pypi/netCDF4/
2. installed using pip from command pip install --no-index --find-links=LocalPathToWheelFile PackageName

APPARENTLY it installed well:

C:\Users\rprieto\Downloads>"c:\python27\python.exe" "C:\Users\rprieto\AppData\Local\Temp\listPackage.py"
                         wheel    0.26.0   0.29.0 available
                    setuptools    20.6.7   up to date
                       netCDF4   1.2.3.1   1.2.3 available
                         numpy    1.11.0   up to date
                           pip     8.1.1   up to date
                    virtualenv    15.0.1   up to date

3. rebooted PC and tried again; got same error
4. tried with the 64 bit version of the NetCDF4 module and got the same error again; tried the +numpy version at no avail; tried the 32 bit version again, no luck...


Any help will be welcome.

Cheers from the Azores,

Rui Prieto


Executing: OceanColorLevel3SMITimeSeriesInterpolateAtArcGISPoints Aqua Daily 4km CHL_chlor_a bmutest1 test Date Nearest # # -9999 60 300 # 256 16 16 3
Start Time: Wed Apr 06 15:09:51 2016
Running script OceanColorLevel3SMITimeSeriesInterpolateAtArcGISPoints...
In order to access the netCDF-4 files that NASA OceanColor began publishing in June 2015, this tool requires the netCDF4 module for Python 2.7, which does not appear to be installed. Until you install it, this tool will attempt to access the HDF files that NASA used to publish, which may be out of date or no longer exist. If you are an ArcGIS user, you can upgrade to ArcGIS 10.3 or later; ArcGIS 10.3 and later automatically install the netCDF4 module when ArcGIS installs Python. If this will not work for you, you can manually install the package yourself. Go to https://pypi.python.org/pypi/netCDF4/ and look for "Windows binary installers". You must restart ArcGIS after installing it.
Interpolating values for 3060 points of ArcGIS FeatureLayer "bmutest1" of ShapeFile "C:\Users\rprieto\Desktop\bmutest1\bmutest1.shp".
Update stopped before all points were processed: 0:01:14 elapsed, 423 points updated, 0 deleted, 0 unchanged, 0:00:00.176496 per point, 2637 points not processed.
Update in progress: 0:01:14 elapsed, 423 points updated, 0 deleted, 1 unchanged, 0:00:00.176080 per point, 2636 remaining, estimated completion time: 15:18:59.
Failed script OceanColorLevel3SMITimeSeriesInterpolateAtArcGISPoints...

Traceback (most recent call last):
  File "C:\Program Files\GeoEco\ArcGISToolbox\Scripts\OceanColorLevel3SMITimeSeriesInterpolateAtArcGISPoints.py", line 5, in <module>
    ExecuteMethodFromCommandLineAsArcGISTool('GeoEco.DataProducts.NASA.OceanColor', 'OceanColorLevel3SMITimeSeries', 'InterpolateAtArcGISPoints')
  File "C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\ArcGISScripts.py", line 210, in ExecuteMethodFromCommandLineAsArcGISTool
    exec sourceCode in globals(), locals()
  File "<string>", line 1, in <module>
  File "C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\DataProducts\NASA\OceanColor.py", line 627, in InterpolateAtArcGISPoints
    Interpolator.InterpolateGridsValuesForTableOfPoints([grid], ArcGISTable(points), [valueField], tField=tField, where=where, orderBy=orderBy, method=method, noDataValue=noDataValue, gridsWrap=True, numBlocksToCacheInMemory=numBlocksToCacheInMemory, xBlockSize=xBlockSize, yBlockSize=yBlockSize, tBlockSize=tBlockSize)
  File "C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\SpatialAnalysis\Interpolation.py", line 568, in InterpolateGridsValuesForTableOfPoints
    value = cls._InterpolatePointOnGrid_NearestNeighbor(grids[i], transformedCoords, noDataValues[i], debugLoggingEnabled)
  File "C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\SpatialAnalysis\Interpolation.py", line 51, in _InterpolatePointOnGrid_NearestNeighbor
    value = grid.Data.__getitem__(tuple(nearestIndices))
  File "C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\Datasets\__init__.py", line 3671, in __getitem__
    return getattr(self._Grid(), self._GetMethod)(key)
  File "C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\Datasets\__init__.py", line 3311, in _GetUnscaledDataAsArray
    data, actualNoDataValue = self._ReadNumpyArray(reorderedSliceList)
  File "C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\Datasets\Virtual.py", line 1744, in _ReadNumpyArray
    self._Cache.insert(0, [regionToRead, self._Grid._ReadNumpyArray(regionToRead)[0]])
  File "C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\Datasets\Virtual.py", line 340, in _ReadNumpyArray
    data[t] = self._CachedDatasets[i].UnscaledData.__getitem__(tuple(sliceList[1:]))
  File "C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\Datasets\__init__.py", line 3671, in __getitem__
    return getattr(self._Grid(), self._GetMethod)(key)
  File "C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\Datasets\__init__.py", line 3311, in _GetUnscaledDataAsArray
    data, actualNoDataValue = self._ReadNumpyArray(reorderedSliceList)
  File "C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\Datasets\HDF4.py", line 335, in _ReadNumpyArray
    sds = self._GetSDS()
  File "C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\Datasets\HDF4.py", line 328, in _GetSDS
    self.ParentCollection._Open()
  File "C:\Python27\ArcGIS10.2\lib\site-packages\GeoEco\Datasets\HDF4.py", line 226, in _Open
    raise RuntimeError(_(u'Failed to open %(dn)s. The file may not be in HDF 4 format. Detailed error information: pyhdf\'s SD constructor reported %(e)s: %(msg)s.') % {u'dn': self._DisplayName, u'e': e.__class__.__name__, u'msg': self._Str(e)})
RuntimeError: Failed to open HDF version 4 file c:\users\rprieto\appdata\local\temp\arc7e02\GeoEco_OceanColorLevel3SMIFileSearcher_Temp_wbsam2\A2006072.L3m_DAY_CHL_chlor_a_4km.nc (a local copy of A2006072.L3m_DAY_CHL_chlor_a_4km.nc from NASA OceanColor data archive). The file may not be in HDF 4 format. Detailed error information: pyhdf's SD constructor reported HDF4Error: SD : cannot open c:\users\rprieto\appdata\local\temp\arc7e02\GeoEco_OceanColorLevel3SMIFileSearcher_Temp_wbsam2\A2006072.L3m_DAY_CHL_chlor_a_4km.nc.

Failed to execute (OceanColorLevel3SMITimeSeriesInterpolateAtArcGISPoints).
Failed at Wed Apr 06 15:11:15 2016 (Elapsed Time: 1 minutes 24 seconds)



Archive powered by MHonArc 2.6.19.

Top of Page