@decorator_util.jit()<EOL>def resized_array_2d_from_array_2d_and_resized_shape(array_2d, resized_shape, origin=(-<NUM_LIT:1>, -<NUM_LIT:1>), pad_value=<NUM_LIT:0.0>):
y_is_even = int(array_2d.shape[<NUM_LIT:0>]) % <NUM_LIT:2> == <NUM_LIT:0><EOL>x_is_even = int(array_2d.shape[<NUM_LIT:1>]) % <NUM_LIT:2> == <NUM_LIT:0><EOL>if origin is (-<NUM_LIT:1>, -<NUM_LIT:1>):<EOL><INDENT>if y_is_even:<EOL><INDENT>y_centre = int(array_2d.shape[<NUM_LIT:0>] / <NUM_LIT:2>)<EOL><DEDENT>elif not y_is_even:<EOL><INDENT>y_centre = int(array_2d.shape[<NUM_LIT:0>] / <NUM_LIT:2>)<EOL><DEDENT>if x_is_even:<EOL><INDENT>x_centre = int(array_2d.shape[<NUM_LIT:1>] / <NUM_LIT:2>)<EOL><DEDENT>elif not x_is_even:<EOL><INDENT>x_centre = int(array_2d.shape[<NUM_LIT:1>] / <NUM_LIT:2>)<EOL><DEDENT>origin = (y_centre, x_centre)<EOL><DEDENT>resized_array = np.zeros(shape=resized_shape)<EOL>if y_is_even:<EOL><INDENT>y_min = origin[<NUM_LIT:0>] - int(resized_shape[<NUM_LIT:0>] / <NUM_LIT:2>)<EOL>y_max = origin[<NUM_LIT:0>] + int((resized_shape[<NUM_LIT:0>] / <NUM_LIT:2>)) + <NUM_LIT:1><EOL><DEDENT>elif not y_is_even:<EOL><INDENT>y_min = origin[<NUM_LIT:0>] - int(resized_shape[<NUM_LIT:0>] / <NUM_LIT:2>)<EOL>y_max = origin[<NUM_LIT:0>] + int((resized_shape[<NUM_LIT:0>] / <NUM_LIT:2>)) + <NUM_LIT:1><EOL><DEDENT>if x_is_even:<EOL><INDENT>x_min = origin[<NUM_LIT:1>] - int(resized_shape[<NUM_LIT:1>] / <NUM_LIT:2>)<EOL>x_max = origin[<NUM_LIT:1>] + int((resized_shape[<NUM_LIT:1>] / <NUM_LIT:2>)) + <NUM_LIT:1><EOL><DEDENT>elif not x_is_even:<EOL><INDENT>x_min = origin[<NUM_LIT:1>] - int(resized_shape[<NUM_LIT:1>] / <NUM_LIT:2>)<EOL>x_max = origin[<NUM_LIT:1>] + int((resized_shape[<NUM_LIT:1>] / <NUM_LIT:2>)) + <NUM_LIT:1><EOL><DEDENT>for y_resized, y in enumerate(range(y_min, y_max)):<EOL><INDENT>for x_resized, x in enumerate(range(x_min, x_max)):<EOL><INDENT>if y >= <NUM_LIT:0> and y < array_2d.shape[<NUM_LIT:0>] and x >= <NUM_LIT:0> and x < array_2d.shape[<NUM_LIT:1>]:<EOL><INDENT>if y_resized >= <NUM_LIT:0> and y_resized < resized_shape[<NUM_LIT:0>] and x_resized >= <NUM_LIT:0> and x_resized < resized_shape[<NUM_LIT:1>]:<EOL><INDENT>resized_array[y_resized, x_resized] = array_2d[y, x]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if y_resized >= <NUM_LIT:0> and y_resized < resized_shape[<NUM_LIT:0>] and x_resized >= <NUM_LIT:0> and x_resized < resized_shape[<NUM_LIT:1>]:<EOL><INDENT>resized_array[y_resized, x_resized] = pad_value<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return resized_array<EOL>
Resize an array to a new size around a central pixel.

    If the origin (e.g. the central pixel) of the resized array is not specified, the central pixel of the array is \
    calculated automatically. For example, a (5,5) array's central pixel is (2,2). For even dimensions the central \
    pixel is assumed to be the lower indexed value, e.g. a (6,4) array's central pixel is calculated as (2,1).

    The default origin is (-1, -1) because numba requires that the function input is the same type throughout the \
    function, thus a default 'None' value cannot be used.

    Parameters
    ----------
    array_2d : ndarray
        The 2D array that is resized.
    resized_shape : (int, int)
        The (y,x) new pixel dimension of the trimmed array.
    origin : (int, int)
        The oigin of the resized array, e.g. the central pixel around which the array is extracted.

    Returns
    -------
    ndarray
        The resized 2D array from the input 2D array.

    Examples
    --------
    array_2d = np.ones((5,5))
    resize_array = resize_array_2d(array_2d=array_2d, new_shape=(2,2), origin=(2, 2))