def render_overhead_chunk((chunk_file, map_size, render_options)):
    chunk = nbt.NBTFile(chunk_file, 'rb')
    array_offset_X = (abs(map_size['x_min']) + chunk['Level']['xPos'].value) * Level.chunk_size_X
    array_offset_Z = (abs(map_size['z_min']) + chunk['Level']['zPos'].value) * Level.chunk_size_Z

    try:
        blocks = numpy.fromstring(chunk['Level']['Blocks'].value, dtype=numpy.uint8).reshape(Level.chunk_size_X, Level.chunk_size_Z, Level.chunk_size_Y)
        for y in xrange(Level.chunk_size_Y):
            colors = Level.base_block_colors[blocks[...,y]].reshape(Level.chunk_size_X, Level.chunk_size_Z, Level.color_depth)
            image_array[array_offset_Z : array_offset_Z + Level.chunk_size_Z,
                array_offset_X : array_offset_X + Level.chunk_size_X] = overlay_chunk(
                    colors.swapaxes(0, 1),
                    image_array[array_offset_Z : array_offset_Z + Level.chunk_size_Z,
                        array_offset_X : array_offset_X + Level.chunk_size_X])
        print str((array_offset_X, array_offset_Z)) % 'Finished chunk %s'
    except IndexError, err:
        print 'Failed chunk: %s' % err
dataset/ETHPy150Open aheadley/pynemap/pynemap.py/render_overhead_chunk/swapped operands of `%`