Skip to Content.

mget-help - RE: [mget-help] Python error - interpolating no data tool

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


From: Jason Roberts <>
To: Jenelle Yonkman <>
Cc: "" <>
Subject: RE: [mget-help] Python error - interpolating no data tool
Date: Thu, 30 Apr 2015 19:18:35 +0000
Accept-language: en-US
Authentication-results: livingoceans.org; dkim=none (message not signed) header.d=none;

Hi Jenelle,

 

Thanks for your interest in MGET. I should be able to help with this.

 

It has come up twice before on the mget-help list. The first time, it was because someone was trying to run the tool on a raster that did not actually have any No Data values. What they were doing made sense in their mind—they wanted to fill in missing values—it was just the missing values were coded as 0 instead of No Data. In that case, ArcGIS will sometimes not define a No Data value for the raster. This ultimately results in ArcGIS providing “None” to MGET someplace deep inside the tool. I did not anticipate that this would ever happen—that someone would run the tool on a raster that had no No Data values—so I did not code the tool to fail in a graceful way. The solution was for the person to change the 0 values to No Data (e.g. by using the Spatial Analyst Set Null tool) and then try MGET again. That worked fine.

 

The second case it was because someone had their rasters in a geodatabase. In this case, we discovered that ArcGIS can represent No Data using a special floating point number called “Not a Number” (NaN). That is not unreasonable. The problem was that ArcGIS provided no way for Python-based tools such as MGET to distinguish between a raster that used NaN for No Data, and a raster that did not have a No Data value at all. In both cases, when MGET inquired with ArcGIS what the No Data value was, ArcGIS returned None. This is arguably a bug in ArcGIS’s Python API. The solution was to export the rasters out of the geodatabase to a format such as .IMG in which the No Data value would not be NaN. Then run the MGET tool on those exported rasters.

 

Can you please check for both of these situations? If neither applies, we’ll have to delve deeper.

 

All the best,

 

Jason

 

From: Jenelle Yonkman [mailto:]
Sent: Wednesday, April 29, 2015 5:42 PM
To:
Subject: [mget-help] Python error - interpolating no data tool

 

Hello,

 

I’m a new MGET user and am running into some trouble using the interpolate no data cells tool. I can see that this has happened to at least one other person (https://lists.nicholas.duke.edu/sympa/arc/mget-help/2013-11/msg00015.html) but wasn’t able to find an answer. I do have the Matlab MCR installed, and am running ArcGIS 10.1. I was previously using MGET 0.8a57 and just upgraded to 0.8a58 but receive the same error message with both versions:

 

Running script InterpolatorInpaintArcGISRaster...

python.exe: Error: Invalid noDataValue: None

RuntimeError: python.exe returned exit code 1, indicating failure.

The following consequences resulted from the original error:

Execution of C:\Python27\ArcGIS10.1\python.exe failed.

 

Traceback (most recent call last):

  File "C:\Program Files\GeoEco\ArcGISToolbox\Scripts\InterpolatorInpaintArcGISRaster.py", line 5, in <module>

    ExecuteMethodFromCommandLineAsArcGISTool('GeoEco.SpatialAnalysis.Interpolation', 'Interpolator', 'InpaintArcGISRaster')

  File "C:\Python27\ArcGIS10.1\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.1\lib\site-packages\GeoEco\SpatialAnalysis\Interpolation.py", line 726, in InpaintArcGISRaster

    ArcGISWorkspace(os.path.dirname(outputRaster), ArcGISRaster, pathCreationExpressions=[os.path.basename(outputRaster)]).ImportDatasets([InpaintedGrid(ArcGISRasterBand.ConstructFromArcGISPath(inputRaster), method, maxHoleSize, xEdgesWrap)], {False: u'Add', True: u'Replace'}[overwriteExisting], reportProgress=False)

  File "C:\Python27\ArcGIS10.1\lib\site-packages\GeoEco\Datasets\__init__.py", line 820, in ImportDatasets

    self._ImportDatasets(datasets, mode.lower(), reportProgress, options)

  File "C:\Python27\ArcGIS10.1\lib\site-packages\GeoEco\Datasets\Collections.py", line 694, in _ImportDatasets

    self._ImportDatasetsToPath(pathComponentsForPath[path], datasetsForPath[path], mode, progressReporter, options)

  File "C:\Python27\ArcGIS10.1\lib\site-packages\GeoEco\Datasets\ArcGIS.py", line 609, in _ImportDatasetsToPath

    self.DatasetType._ImportDatasetsToPath(os.path.join(self.Path, *pathComponents), sourceDatasets, mode, progressReporter, options)

  File "C:\Python27\ArcGIS10.1\lib\site-packages\GeoEco\Datasets\ArcGIS.py", line 1141, in _ImportDatasetsToPath

    GDALDataset._ImportDatasetsToPath(tempRaster, sourceDatasets, mode, None, {'useArcGISSpatialReference': True, 'useUnscaledData': useUnscaledData, 'calculateStatistics': False, 'blockSize': blockSize})

  File "C:\Python27\ArcGIS10.1\lib\site-packages\GeoEco\Datasets\GDAL.py", line 1073, in _ImportDatasetsToPath

    data = "sourceDatasets[i].Data[rowsCopied:rowsCopied+rowsToCopy," :]

  File "C:\Python27\ArcGIS10.1\lib\site-packages\GeoEco\Datasets\__init__.py", line 3670, in __getitem__

    return getattr(self._Grid(), self._GetMethod)(key)

  File "C:\Python27\ArcGIS10.1\lib\site-packages\GeoEco\Datasets\__init__.py", line 3310, in _GetUnscaledDataAsArray

    data, actualNoDataValue = self._ReadNumpyArray(reorderedSliceList)

  File "C:\Python27\ArcGIS10.1\lib\site-packages\GeoEco\Datasets\Virtual.py", line 3379, in _ReadNumpyArray

    maxRunTime=None)

  File "C:\Python27\ArcGIS10.1\lib\site-packages\GeoEco\DataManagement\Processes.py", line 575, in ExecuteProgram

    process.Execute()

  File "C:\Python27\ArcGIS10.1\lib\site-packages\GeoEco\DataManagement\Processes.py", line 498, in Execute

    Logger.RaiseException(RuntimeError(_(u'%(name)s returned exit code %(code)i, indicating failure.') % {u'name' : programName, u'code' : self.ExitCode}))

  File "C:\Python27\ArcGIS10.1\lib\site-packages\GeoEco\Logging.py", line 104, in RaiseException

    raise exception

RuntimeError: python.exe returned exit code 1, indicating failure.

 

Failed to execute (InterpolatorInpaintArcGISRaster).

Failed at Wed Apr 29 14:38:03 2015 (Elapsed Time: 21.00 seconds)

 

 

Any input or ideas would be much appreciated.

 

Thanks,

 

Jenelle

Archives powered by MHonArc.
Top of Page