Loop 'populateRATWithPercentiles' error

21 views
Skip to first unread message

Iurii Shendryk

unread,
Feb 18, 2015, 6:03:15 PM2/18/15
to rsgislib...@googlegroups.com
Hi,

When looping through 40 images and populating an attribute table with a percentile of the pixel values using populateRATWithPercentiles, after 4-5 successful iterations I'm getting following error:

Warning 1: Caught exception in KEADataset constructor The image band data type was not specified.
Process finished with exit code 139

Any ideas on how to fix this?

Thank you in advance,
Yuri

Daniel Clewley

unread,
Feb 19, 2015, 2:40:19 AM2/19/15
to Iurii Shendryk, RSGISLib Support
Hi Yuri,

Does the error always occur at the same image or after any 5 images?

Dan

--
You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-suppo...@googlegroups.com.
To post to this group, send email to rsgislib...@googlegroups.com.
Visit this group at http://groups.google.com/group/rsgislib-support.
For more options, visit https://groups.google.com/d/optout.

Iurii Shendryk

unread,
Feb 19, 2015, 7:50:34 PM2/19/15
to rsgislib...@googlegroups.com, iurii.s...@gmail.com
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
Reply all
Reply to author
Forward
0 new messages