Hi Dan,
The error occurs during processing any 6th image. To be more precise, the RAT of each input image before being fed in 'populateRATWithPercentiles' contains ~2000 columns. I tried to work with ERDAS .img raster format to store RAT, but getting the same error. It's not a memory issue either, cause memory consumption is at 30% before crashing and I'm getting either "Warning 1: Caught exception in KEADataset constructor Could not get image block size. Process finished with exit code 139" or "Warning 1: Caught exception in KEADataset constructor The image band data type was not specified. Process finished with exit code 139"
Here is the code:
os.chdir(PCA_VI_Stack_resamp)
Stack_rasters = glob.glob("*.bsq")
Stack_rasters.sort()
os.chdir(Clumps_rasterized)
Clump_rasters = glob.glob("*.kea")
Clump_rasters.sort()
bandList = range (447) # number of bands
print bandList
for idx, kea in enumerate(Clump_rasters):
kea_out = kea.split('.')
inputImage = PCA_VI_Stack_resamp + '/' + Stack_rasters[idx]
clumpsFile = Clumps_rasterized + '/' + Clump_rasters[idx]
rastergis.populateStats(clumpsFile, addclrtab=True, calcpyramids=True, ignorezero=True, ratband=1)
for i in bandList:
band=i+1
bandPercentiles = []
bandPercentiles.append(rastergis.BandAttPercentiles(percentile=25.0, fieldName=fieldNamePerList[i] + 'Per25'))
bandPercentiles.append(rastergis.BandAttPercentiles(percentile=50.0, fieldName=fieldNamePerList[i] + 'Per50'))
bandPercentiles.append(rastergis.BandAttPercentiles(percentile=75.0, fieldName=fieldNamePerList[i] + 'Per75'))
rastergis.populateRATWithPercentiles(inputImage, clumpsFile, band, bandPercentiles)
Hope you can help.
Cheers,
Yuri