# Buggy code
def __call__(self, plot):
    x0, x1 = plot.xlim
    y0, y1 = plot.ylim
    xx0, xx1 = plot._axes.get_xlim()
    yy0, yy1 = plot._axes.get_ylim()
    nx = plot.image._A.shape[1] // self.factor
    ny = plot.image._A.shape[0] // self.factor
    indices = np.argsort(plot.data["dx"])[::-1]

    pixX = np.zeros((ny, nx), dtype="f8")
    pixY = np.zeros((ny, nx), dtype="f8")
    pixelize_off_axis_cartesian(
        pixX,
        plot.data["x"],
        plot.data["y"],
        plot.data["z"],
        plot.data["px"],
        plot.data["py"],
        plot.data["pdx"],
        plot.data["pdy"],
        plot.data["pdz"],
        plot.data.center,
        plot.data._inv_mat,
        indices,
        plot.data[self.field_x],
        (x0, x1, y0, y1),
    )
    pixelize_off_axis_cartesian(
        pixY,
        plot.data["x"],
        plot.data["y"],
        plot.data["z"],
        plot.data["px"],
        plot.data["py"],
        plot.data["pdx"],
        plot.data["pdy"],
        plot.data["pdz"],
        plot.data.center,
        plot.data._inv_mat,
        indices,
        plot.data[self.field_y],
        (x0, x1, y0, y1),
    )
    X, Y = np.meshgrid(
        np.linspace(xx0, xx1, nx, endpoint=True),
        np.linspace(yy0, yy1, ny, endpoint=True),
    )

    if self.normalize:
        nn = np.sqrt(pixX**2 + pixY**2)
        pixX /= nn
        pixY /= nn

    plot._axes.quiver(X, Y, pixX, pixY, scale=self.scale, scale_units=self.scale_units)
    plot._axes.set_xlim(xx0, xx1)
    plot._axes.set_ylim(yy0, yy1)


# Traceback (ValueError)
Traceback (most recent call last):
File "C:\Miniconda-x64\envs\test\lib\site-packages\nose\loader.py", line 251, in generate
for test in g():
File "c:\projects\yt\yt\utilities\lib\tests\test_alt_ray_tracers.py", line 65, in test_cylindrical_ray_trace
t, s, rztheta, inds = cylindrical_ray_trace(p1, p2, left_grid, right_grid)
File "yt\utilities\lib\alt_ray_tracers.pyx", line 203, in yt.utilities.lib.alt_ray_tracers.cylindrical_ray_trace (yt/utilities/lib/alt_ray_tracers.c:6000)
tsect, tinds = np.unique(tsect[tmask], return_index=True)
ValueError: Item size of buffer (1 byte) does not match size of 'int64_t' (8 bytes)

# Fixed code
def __call__(self, plot):
    x0, x1 = plot.xlim
    y0, y1 = plot.ylim
    xx0, xx1 = plot._axes.get_xlim()
    yy0, yy1 = plot._axes.get_ylim()
    nx = plot.image._A.shape[1] // self.factor
    ny = plot.image._A.shape[0] // self.factor
    indices = np.argsort(plot.data["dx"])[::-1].astype(np.int_)

    pixX = np.zeros((ny, nx), dtype="f8")
    pixY = np.zeros((ny, nx), dtype="f8")
    pixelize_off_axis_cartesian(
        pixX,
        plot.data["x"],
        plot.data["y"],
        plot.data["z"],
        plot.data["px"],
        plot.data["py"],
        plot.data["pdx"],
        plot.data["pdy"],
        plot.data["pdz"],
        plot.data.center,
        plot.data._inv_mat,
        indices,
        plot.data[self.field_x],
        (x0, x1, y0, y1),
    )
    pixelize_off_axis_cartesian(
        pixY,
        plot.data["x"],
        plot.data["y"],
        plot.data["z"],
        plot.data["px"],
        plot.data["py"],
        plot.data["pdx"],
        plot.data["pdy"],
        plot.data["pdz"],
        plot.data.center,
        plot.data._inv_mat,
        indices,
        plot.data[self.field_y],
        (x0, x1, y0, y1),
    )
    X, Y = np.meshgrid(
        np.linspace(xx0, xx1, nx, endpoint=True),
        np.linspace(yy0, yy1, ny, endpoint=True),
    )

    if self.normalize:
        nn = np.sqrt(pixX**2 + pixY**2)
        pixX /= nn
        pixY /= nn

    plot._axes.quiver(X, Y, pixX, pixY, scale=self.scale, scale_units=self.scale_units)
    plot._axes.set_xlim(xx0, xx1)
    plot._axes.set_ylim(yy0, yy1)