54def pt2numpy(pt):
55 """Translate WKT Raster pixel type to NumPy data type"""
56 numpytypes = {
57 '8BUI' : numpy.uint8,
58 '16BSI' : numpy.int16,
59 '16BUI' : numpy.uint16,
60 '32BSI' : numpy.int32,
61 '32BUI' : numpy.uint32,
62 '32BF' : numpy.float32,
63 '64BF' : numpy.float64
64 }
65 if hasattr(numpy, 'float16'):
66 numpytypes['16BF'] = numpy.float16
67 return numpytypes.get(pt, numpy.uint8)
68