def coord2pix(y, downsample):
    """convert real coordinates to pixels indices for 3D 2D projection
    """
    # x * downsample + downsample / 2.0 - 0.5 = y
    return (y + 0.5 - downsample / 2.0) / downsample