function my_plot_grid_15

load output_0_12_17_xoffset_1.5 -ascii;     %take in data from output_0

figure;

x=output_0(:,1);
y=output_0(:,2);
z=output_0(:,3);
vx=output_0(:,4);
vy=output_0(:,5);
vz=output_0(:,6);
xo=output_0(:,7);
yo=output_0(:,8);
zo=output_0(:,9);
vxo=output_0(:,10);
vyo=output_0(:,11);
vzo=output_0(:,12);
n=output_0(:,13);

focal_plane=find(n==12);
primary=find(n==1);

j=1;

for i=1: length(x)
    if n(i)==1, currz=((x(i)*x(i)+y(i)*y(i)));
    end
    if n(i)==12,
        spotx(j)=xo(i);
        spoty(j)=yo(i);
        spotc(j)=currz;
        j=j+1;
    end
end
    
plot(spotx,spoty,'.');

