function [ source_p_mask ] = arrayGeometry( SOURCE, kgrid , BOUND )
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
%   PHYSICAL PROPERTIES
x_0=1;  %[grid poits]
y_0=1;  %[grid poits]
z_0=1+ceil(BOUND.boundary_thck/kgrid.dz);  %[grid poits]

num_column=length(SOURCE.delay(1,:))
num_row=length(SOURCE.delay(:,1))

matrix.X=ones(num_row,num_column).*x_0
matrix.Y=ones(num_row,num_column).*y_0
matrix.Z=ones(num_row,num_column).*z_0

SOURCE.spacing_x=round(SOURCE.spacing_x/kgrid.dx);
SOURCE.spacing_y=round(SOURCE.spacing_y/kgrid.dy);
SOURCE.spacing_z=round(SOURCE.spacing_z/kgrid.dz);

length_inX= x_0+SOURCE.spacing_x*(num_column-1);
length_inY= y_0+SOURCE.spacing_y*(num_row-1);

move_X=round(SOURCE.center_array_X/kgrid.dx-length_inX/2);
move_Y=round(SOURCE.center_array_Y/kgrid.dy-length_inY/2);


%define source matrix.X(x coordinates) and matrix.Y(y coordinates)

for i=1:num_column  
    matrix.X(1:num_row,i)=matrix.X(1:num_row,i)+SOURCE.spacing_x*(i-1)+move_X;
end
for k=1:num_row
    matrix.Y(k,1:num_column)=matrix.Y(k,1:num_column)+SOURCE.spacing_y*(k-1)+move_Y;
end


% SOURCE.P MASK
source_p_mask = zeros(kgrid.Nx, kgrid.Ny, kgrid.Nz);
source_p_mask(matrix.X,matrix.Y,matrix.Z)=1



end

