def fluximage(ri, li, rs, v, x, y, N, wBx, wBy):
    '\n    Creates a flux image out of a perpendicular deflection field. \n\n    Args:\n        ri:\n        li:\n        rs:\n        v:\n        x (array): Perpendicular deflection field x-coordinates.\n        y (array): Perpendicular deflection field y-coordinates.\n        wBx (array): Perpendicular deflection field x-component.\n        wBy (array): Perpendicular deflection field y-component.\n\n    Returns:\n        flux_image (array): Generated flux image.\n    '
    magnify = (((rs + ri) + (0.5 * li)) / (ri + (0.5 * li)))
    print('Creating interpolator functions...')
    fwBx = sp.interpolate.RegularGridInterpolator((x[:, 0], y[0, :]), wBx, bounds_error=False)
    fwBy = sp.interpolate.RegularGridInterpolator((x[:, 0], y[0, :]), wBy, bounds_error=False)
    print('DONE')
    prot_num = int(np.sqrt(N))
    dx = (x[(1, 0)] - x[(0, 0)])
    dy = (y[(0, 1)] - y[(0, 0)])
    samp_x = np.linspace((x[(0, 0)] + (0.5 * dx)), (x[((- 1), 0)] - (0.5 * dx)), num=prot_num)
    samp_y = np.linspace((y[(0, 0)] + (0.5 * dy)), (y[(0, (- 1))] - (0.5 * dy)), num=prot_num)
    (samp_x, samp_y) = np.meshgrid(samp_x, samp_y, indexing='ij')
    print('Interpolating proton deflections...')
    samp_wBx = fwBx((samp_x, samp_y))
    samp_wBy = fwBy((samp_x, samp_y))
    print('DONE')
    screen_x = ((magnify * samp_x) + ((rs / v) * samp_wBx))
    screen_y = ((magnify * samp_y) + ((rs / v) * samp_wBy))
    print('Histogramming protons...')
    flux_image = np.histogram2d(screen_x.ravel(), screen_y.ravel(), bins=x.shape)
    print('DONE')
    return flux_image[0]
Creates a flux image out of a perpendicular deflection field. 

Args:
    ri:
    li:
    rs:
    v:
    x (array): Perpendicular deflection field x-coordinates.
    y (array): Perpendicular deflection field y-coordinates.
    wBx (array): Perpendicular deflection field x-component.
    wBy (array): Perpendicular deflection field y-component.

Returns:
    flux_image (array): Generated flux image.
def fluximage(ri, li, rs, v, x, y, N, wBx, wBy):
    '\n    Creates a flux image out of a perpendicular deflection field. \n\n    Args:\n        ri:\n        li:\n        rs:\n        v:\n        x (array): Perpendicular deflection field x-coordinates.\n        y (array): Perpendicular deflection field y-coordinates.\n        wBx (array): Perpendicular deflection field x-component.\n        wBy (array): Perpendicular deflection field y-component.\n\n    Returns:\n        flux_image (array): Generated flux image.\n    '
    magnify = (((rs + ri) + (0.5 * li)) / (ri + (0.5 * li)))
    print('Creating interpolator functions...')
    fwBx = sp.interpolate.RegularGridInterpolator((x[:, 0], y[0, :]), wBx, bounds_error=False)
    fwBy = sp.interpolate.RegularGridInterpolator((x[:, 0], y[0, :]), wBy, bounds_error=False)
    print('DONE')
    prot_num = int(np.sqrt(N))
    dx = (x[(1, 0)] - x[(0, 0)])
    dy = (y[(0, 1)] - y[(0, 0)])
    samp_x = np.linspace((x[(0, 0)] + (0.5 * dx)), (x[((- 1), 0)] - (0.5 * dx)), num=prot_num)
    samp_y = np.linspace((y[(0, 0)] + (0.5 * dy)), (y[(0, (- 1))] - (0.5 * dy)), num=prot_num)
    (samp_x, samp_y) = np.meshgrid(samp_x, samp_y, indexing='ij')
    print('Interpolating proton deflections...')
    samp_wBx = fwBx((samp_x, samp_y))
    samp_wBy = fwBy((samp_x, samp_y))
    print('DONE')
    screen_x = ((magnify * samp_x) + ((rs / v) * samp_wBx))
    screen_y = ((magnify * samp_y) + ((rs / v) * samp_wBy))
    print('Histogramming protons...')
    flux_image = np.histogram2d(screen_x.ravel(), screen_y.ravel(), bins=x.shape)
    print('DONE')
    return flux_image[0]