def get_extent(array, units, kpc_per_arcsec, xticks_manual, yticks_manual):
if xticks_manual is not None and yticks_manual is not None:<EOL><INDENT>return np.asarray([xticks_manual[<NUM_LIT:0>], xticks_manual[<NUM_LIT:3>], yticks_manual[<NUM_LIT:0>], yticks_manual[<NUM_LIT:3>]])<EOL><DEDENT>if units in '<STR_LIT>':<EOL><INDENT>return np.asarray([<NUM_LIT:0>, array.shape[<NUM_LIT:1>], <NUM_LIT:0>, array.shape[<NUM_LIT:0>]])<EOL><DEDENT>elif units in '<STR_LIT>' or kpc_per_arcsec is None:<EOL><INDENT>return np.asarray([array.arc_second_minima[<NUM_LIT:1>], array.arc_second_maxima[<NUM_LIT:1>],<EOL>array.arc_second_minima[<NUM_LIT:0>], array.arc_second_maxima[<NUM_LIT:0>]])<EOL><DEDENT>elif units in '<STR_LIT>':<EOL><INDENT>return list(map(lambda tick : tick*kpc_per_arcsec,<EOL>np.asarray([array.arc_second_minima[<NUM_LIT:1>], array.arc_second_maxima[<NUM_LIT:1>],<EOL>array.arc_second_minima[<NUM_LIT:0>], array.arc_second_maxima[<NUM_LIT:0>]])))<EOL><DEDENT>else:<EOL><INDENT>raise exc.PlottingException('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>
Get the extent of the dimensions of the array in the units of the figure (e.g. arc-seconds or kpc).

    This is used to set the extent of the array and thus the y / x axis limits.

    Parameters
    -----------
    array : data.array.scaled_array.ScaledArray
        The 2D array of data which is plotted.
    units : str
        The units of the y / x axis of the plots, in arc-seconds ('arcsec') or kiloparsecs ('kpc').
    kpc_per_arcsec : float
        The conversion factor between arc-seconds and kiloparsecs, required to plot the units in kpc.
    xticks_manual :  [] or None
        If input, the xticks do not use the array's default xticks but instead overwrite them as these values.
    yticks_manual :  [] or None
        If input, the yticks do not use the array's default yticks but instead overwrite them as these values.