Geographic Information Systems Asked by 1milenac on July 28, 2020
I am trying to perform an object-based classification using a python-based script with rsgislib. Although, when converting to dB, an error is appearing. Any ideas why is this happening?
Create and Calculate dB columns
ratDataset = gdal.Open(clumpsImg, gdal.GA_Update)
HHPow = rat.readColumn(ratDataset, 'HHPow')
HVPow = rat.readColumn(ratDataset, 'HVPow')
HHHVPow = rat.readColumn(ratDataset, 'HHHVPow')
HHdB = numpy.where(HHPow>0, 10*numpy.log10(HHPow), 0)
HVdB = numpy.where(HVPow>0, 10*numpy.log10(HVPow), 0)
HHHVdB = numpy.where(HHHVPow>0, 10*numpy.log10(HHHVPow), 0)
rat.writeColumn(ratDataset, "HHdB", HHdB)
rat.writeColumn(ratDataset, "HVdB", HVdB)
rat.writeColumn(ratDataset, "HHHVdB", HHHVdB)
ratDataset = None
And I keep getting the following error:
Writing Stats (Mean, ) to Output RAT
/data/3_to_5_copy/16_PerformObjClass.py:63: RuntimeWarning: divide by zero encountered in log10
HHdB = numpy.where(HHPow>0, 10numpy.log10(HHPow), 0)
/data/3_to_5_copy/16_PerformObjClass.py:64: RuntimeWarning: divide by zero encountered in log10
HVdB = numpy.where(HVPow>0, 10numpy.log10(HVPow), 0)
/data/3_to_5_copy/16_PerformObjClass.py:65: RuntimeWarning: divide by zero encountered in log10
HHHVdB = numpy.where(HHHVPow>0, 10*numpy.log10(HHHVPow), 0)
Creating output image using input image
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP