232def pt2numpy(pt):
233 """Translate GDAL data type to NumPy data type"""
234 ptnumpy = {
235 gdalc.GDT_Byte : numpy.uint8,
236 gdalc.GDT_Int16 : numpy.int16,
237 gdalc.GDT_UInt16 : numpy.uint16,
238 gdalc.GDT_Int32 : numpy.int32,
239 gdalc.GDT_UInt32 : numpy.uint32,
240 gdalc.GDT_Float32: numpy.float32,
241 gdalc.GDT_Float64: numpy.float64
242 }
243 return ptnumpy.get(pt, numpy.uint8)
244