#NEWLINE# def get_indices( source_ds , target_width , target_height ) : #NEWLINE# #INDENT# 'Returns x, y lists of all possible resampling offsets.\n\n    source_ds     - dataset to get offsets from\n    target_width  - target pixel width\n    target_height - target pixel height (negative)\n    ' #NEWLINE# source_geotransform = source_ds . GetGeoTransform ( ) #NEWLINE# source_width = source_geotransform [ 1 ] #NEWLINE# source_height = source_geotransform [ 5 ] #NEWLINE# dx = ( target_width / source_width ) #NEWLINE# dy = ( target_height / source_height ) #NEWLINE# target_x = np . arange ( ( dx / 2 ) , source_ds . RasterXSize , dx ) #NEWLINE# target_y = np . arange ( ( dy / 2 ) , dy . RasterYSize , dy ) #NEWLINE# return np . meshgrid ( target_x , target_y )