AnsweredAssumed Answered

Batch conversion of NetCDF to raster - python script

Question asked by robkay21 on Aug 9, 2012
Latest reply on Aug 21, 2012 by robkay21
Hi everyone
I've got a lot of netCDF files that I have to convert to rasters.  Each netCDF will be divided into 12 rasters based on the "month" dimension (jan = 1 .... dec = 12).  I've written a script to loop through all the netCDF files in my workspace and convert them to the rasters, each with an appropriate name.  I need some help fixing the script, it falls over before converting anything and gives me the following error:

Processing: E:\SOLAR_DATA\netcdf\monthly_means_daily_ghe\ghe_stats_1990-1990.nc
Traceback (most recent call last):
  File "N:/gdmp/Solar/BOMNetCDFConversion/rob_working.py", line 90, in <module>
    arcpy.MakeNetCDFRasterLayer_md(nc, variable, xdimension, ydimension, nowFileNew, "", ncDimValue, valueSelectionMethod)
  File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\md.py", line 165, in MakeNetCDFRasterLayer
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000238: One or more dimension values are invalid
Failed to execute (MakeNetCDFRasterLayer).

My script is attached.

Any help would be greatly appreciated
Cheers
Rob

Attachments

Outcomes