I am working with the Make NetCDF Feature Layer (Multidimension) tool with Python. I can get it to work properly outside of Python (but have a lot of data to process, so doing it manually is not really an option).
I am having a problem with entering the {row_dimension}. I need to enter two dimensions, "lat" and "lon", but I can't get it to accept a list. It will accept either variable alone and not give an error message, but if I try to enter a list, I get the following error message:
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000237: One or more dimensions are invalid
ERROR 000237: One or more dimensions are invalid
Failed to execute (MakeNetCDFFeatureLayer).
The help file suggests that a list would be the input? Is there something obvious that I am missing, or is this a bug?
http://help.arcgis.com/en/arcgisdesk...0000005000000/
I have also tried using the raster tool, but receive an error message that my data have irregular spacing and that I need to use the make feature layer tool and interpolate.
A simplified version of my code is below:
I am having a problem with entering the {row_dimension}. I need to enter two dimensions, "lat" and "lon", but I can't get it to accept a list. It will accept either variable alone and not give an error message, but if I try to enter a list, I get the following error message:
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000237: One or more dimensions are invalid
ERROR 000237: One or more dimensions are invalid
Failed to execute (MakeNetCDFFeatureLayer).
The help file suggests that a list would be the input? Is there something obvious that I am missing, or is this a bug?
http://help.arcgis.com/en/arcgisdesk...0000005000000/
I have also tried using the raster tool, but receive an error message that my data have irregular spacing and that I need to use the make feature layer tool and interpolate.
A simplified version of my code is below:
Code:
#Import arcpy
import arcpy
#Set up paths
bpath = "C:\\docs\\Work\\historical_climate\\ESRL\\"
dpath = bpath + "ncfiles\\"
vpath = bpath + "vector\\"
#Set up file names
ncfile = dpath + "air.sfc.1871.nc"
nclyr = "nclyr"
ncfilout = vpath + "test.shp"
#Set up inputs for NetCDF to Feature layer
variable = ["air","time"]
x_variable = "lon"
y_variable = "lat"
#THIS IS THE PROBLEM. x_variable alone works (but does not give the needed output). [x_variable] does not. This apparently can't take a list.
row_dimension = [x_variable,y_variable]
arcpy.MakeNetCDFFeatureLayer_md (ncfile, variable, x_variable, y_variable, nclyr, row_dimension)
arcpy.CopyFeatures_management (nclyr, ncfilout)