Dan Patterson, @Joshus, I have made some changes in the script, rather than using CSV for extracting particular time period, i am using below script to extract desired time period raster from NetCDF, here line no 14 controlling the time period,
if int(nowFile[-2]) > 6
In above line > 6 is extracting the all year data after 1988, when i increase the value by 1 then extracting year also sifting by1 year (e.g. If i put 7 then it would be extract all the year of 1989).
But i want to make a condition for extracting the specific year, e.g1985 to 1990, i don't want pre and post data of that year.
Any assist would be greatly appreciated. Thanks
nc_FP = arcpy.NetCDFFileProperties(inNetCDF)
print nc_FP
nc_Dim = nc_FP.getDimensions()
for dimension in nc_Dim:
if dimension == "time":
top = nc_FP.getDimensionSize(dimension)
for i in range(0, top):
dimension_values = nc_FP.getDimensionValue(dimension, i)
nowFile = str(dimension_values)
nowFile = nowFile.translate(None, '/')
if int(nowFile[-2]) > 8:
dv1 = ["time", dimension_values]
dimension_values = [dv1]
arcpy.MakeNetCDFRasterLayer_md(inNetCDF, variable, x_dimension, y_dimension, nowFile, band_dimension, dimension_values, valueSelectionMethod)
print "success"
outname = outLoc + nowFile
arcpy.CopyRaster_management(nowFile, outname + ".tif", "", "", "", "NONE", "NONE", "")
else: print "Enter a Valid year"