PRO distance_2d_arr, xsize, ysize, x0, y0, dist
; Description: This module creates a two-dimensional pixel array "dist" of size "xsize" by "ysize" with
; values representing the distance of each pixel from the pixel coordinates "(x0,y0)".
;
; Input Parameters:
;
; xsize - INTEGER/LONG - The size of the two-dimensional pixel array "dist" in the x direction (pix).
; If this value is zero or negative, then it will be reset to the default value
; of "1".
; ysize - INTEGER/LONG - The size of the two-dimensional pixel array "dist" in the y direction (pix).
; If this value is zero or negative, then it will be reset to the default value
; of "1".
; x0 - FLOAT/DOUBLE - The x coordinate of the point from which distances are to be calculated (pix).
; y0 - FLOAT/DOUBLE - The y coordinate of the point from which distances are to be calculated (pix).
;
; Output Parameters:
;
; dist - DOUBLE ARRAY - A two-dimensional pixel array of size "xsize" by "ysize" with values
; representing the distance of each pixel from the pixel coordinates "(x0,y0)".
; If the module fails, then "dist" is returned with a value of "0.0".
;
; Author: Dan Bramich (dan.bramich@hotmail.co.uk)
;
; History:
;
; 24/04/2009 - Further module optimisation performed resulting in a ~12.9% speed increase (dmb).
; 24/07/2008 - Module created (dmb)
;Check that "xsize", "ysize", "x0" and "y0" are numbers of the correct type, and reset the values of
;"xsize" and "ysize" if they are out of range
;Generate the two-dimensional pixel array representing distances from "(x0,y0)"