239
239
" old = n.array( a.shape )\n " ,
240
240
" ndims = len( a.shape )\n " ,
241
241
" if len( newdims ) != ndims:\n " ,
242
- " print \" [congrid] dimensions error. \" \\\n " ,
242
+ " print( \" [congrid] dimensions error. \" \\\n " ,
243
243
" \" This routine currently only support \" \\\n " ,
244
- " \" rebinning to the same number of dimensions.\"\n " ,
244
+ " \" rebinning to the same number of dimensions.\" ) \n " ,
245
245
" return None\n " ,
246
246
" newdims = n.asarray( newdims, dtype=float ) \n " ,
247
247
" dimlist = []\n " ,
268
268
" mint = scipy.interpolate.interp1d( olddims[-1], a, kind=method )\n " ,
269
269
" newa = mint( dimlist[-1] )\n " ,
270
270
" \n " ,
271
- " trorder = [ndims - 1] + range( ndims - 1 )\n " ,
271
+ " trorder = [ndims - 1] + list( range( ndims - 1 ) )\n " ,
272
272
" for i in range( ndims - 2, -1, -1 ):\n " ,
273
273
" newa = newa.transpose( trorder )\n " ,
274
274
" \n " ,
302
302
" newa = scipy.ndimage.map_coordinates(a, newcoords)\n " ,
303
303
" return newa\n " ,
304
304
" else:\n " ,
305
- " print \" Congrid error: Unrecognized interpolation type.\\ n\" , \\\n " ,
305
+ " print( \" Congrid error: Unrecognized interpolation type.\\ n\" , \\\n " ,
306
306
" \" Currently only \\ 'neighbour\\ ', \\ 'nearest\\ ',\\ 'linear\\ ',\" , \\\n " ,
307
- " \" and \\ 'spline\\ ' are supported.\"\n " ,
307
+ " \" and \\ 'spline\\ ' are supported.\" ) \n " ,
308
308
" return None"
309
309
],
310
310
"language" : " python" ,
315
315
"metadata" : {}
316
316
}
317
317
]
318
- }
318
+ }
0 commit comments