I try to automize the creation of NetCDF Raster Layer via Phyton.
I used the tools help to get the basic syntax.
So a simple import from my data with this code works:
[PHP]
>>> import arcpy
>>> arcpy.MakeNetCDFRasterLayer_md("E:/Daten/Geodata/LPJ Outputs/hadley co2 konstant fix 2 mit single crops run/pft_harvest_maize.nc","harvest","longitude","latitude","test_netcdf_raster")
<Result 'test_netcdf_raster'>
[/PHP]
so that's no problem. No I would like to specify the dimension values within the same code. Unfortunatly the tools help doesn't provide an example for this but in the syntax description one can find [[dimension, {value}],...]...
So I tried the following:
[PHP]
>>> import arcpy
>>> arcpy.MakeNetCDFRasterLayer_md("E:/Daten/Geodata/LPJ Outputs/hadley co2 konstant fix 2 mit single crops run/pft_harvest_maize.nc","harvest","longitude","latitude","test_netcdf_raster_2","",[["time",{"1995"}]],"BY_VALUE")
[/PHP]
than I get this error message:
[PHP]
Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\md.py", line 171, in MakeNetCDFRasterLayer
raise e
RuntimeError: Object: Error in executing tool
[/PHP]
😞
so can anybody help me to fix this? Also I would be interested if there is a way to make a loop for this operation, so that I can create NetCDF Raster Layers for the years from 1995-2005 in a loop...
any help would be apreciated.
Best johannes