Changeset 11118
- Timestamp:
- 03/31/07 22:56:23 (2 years ago)
- Files:
-
- branches/1.4/gdal/swig/python/gdal_array.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.4/gdal/swig/python/gdal_array.py
r10473 r11118 19 19 gdalconst.GDT_Float32 : numpy.float32, 20 20 gdalconst.GDT_Float64 : numpy.float64, 21 gdalconst.GDT_CInt16 : numpy.complex ,22 gdalconst.GDT_CInt32 : numpy.complex ,23 gdalconst.GDT_CFloat32 : numpy.complex ,24 gdalconst.GDT_CFloat64 : numpy.complex 6421 gdalconst.GDT_CInt16 : numpy.complex64, 22 gdalconst.GDT_CInt32 : numpy.complex64, 23 gdalconst.GDT_CFloat32 : numpy.complex64, 24 gdalconst.GDT_CFloat64 : numpy.complex128 25 25 } 26 26 … … 43 43 def flip_code(code): 44 44 if isinstance(code, type): 45 # since several things map to complex64 we must carefully select 46 # the opposite that is an exact match (ticket 1518) 47 if code == numpy.complex64: 48 return gdalconst.GDT_CFloat32 49 45 50 for key, value in codes.items(): 46 51 if value == code: … … 99 104 band_array = BandReadAsArray( ds.GetRasterBand(band_index), 100 105 xoff, yoff, xsize, ysize) 101 array_list.append( reshape( band_array, [1,ysize,xsize] ) )106 array_list.append( numpy.reshape( band_array, [1,ysize,xsize] ) ) 102 107 103 108 return numpy.concatenate( array_list ) … … 133 138 buf_xsize, buf_ysize, datatype ) 134 139 ar = numpy.fromstring(band_str,dtype=typecode) 135 ar = numpy.reshape(ar, [ 1,win_ysize,win_xsize])140 ar = numpy.reshape(ar, [buf_ysize,buf_xsize]) 136 141 137 142 return ar
