andrea1609

Make NetCDF Raster Layer in Batch Error

Discussion created by andrea1609 on Apr 17, 2012
Latest reply on Apr 18, 2012 by philmorefield
Hi,
I have written a script in Python to create NetCDF raster layers:

def Modelling(inPathNetCDF, inPathCov, outPath, concentration):
    netcdfName = os.path.basename(inPathNetCDF).split('.')[0]
    covName = os.path.basename(inPathCov)
    env.workspace = outPath
    netcdfList = netcdfName.split('_')[4]
    modelName = (netcdfName.split('_')[2]).lower()
    dateForTitle = netcdfList[6:8] + netcdfList[4:6] + netcdfList[:4]
    date18Z = netcdfList[6:8] + '/' + netcdfList[4:6] + '/' + netcdfList[:4]
    arcpy.MakeNetCDFRasterLayer_md(inPathNetCDF, 'IceConc', 'lon', 'lat', 'tmpNetCDF18', '', '"time" "%s 6:00:00 PM"' %date18Z, 'BY_VALUE')
    arcpy.CopyRaster_management('tmpNetCDF18', outPath + os.sep + outNetcdfName18Z)

Essentially, the script runs successfully sometimes, but the majority of the time Python completely crashes. I am wondering whether there is a bug with the MakeNetCDFRasterLayer module?

Outcomes