% example of how to plot polar coords on a x-y plot, % using the file of alignment measurements made at deployment % % assumes overlaying on a fanbeam image, that has already been rotated to % correct for the ADCP compass N and declination % tripod_defs % fo mvco % have to correct the original measurements for adcp and declination rotcor=-90+(-360+adcp3val)+decl; % convert range and bearing to cartesian to overlay on fan image [xl1,yl1]=xycoord(fn_lg1_rng, fn_lg1_brn+rotcor); [xl2,yl2]=xycoord(fn_lg2_rng, fn_lg2_brn+rotcor); [xl3,yl3]=xycoord(fn_lg3_rng, fn_lg3_brn+rotcor); plot(xl1,yl1,'r*') hold on plot(xl2,yl2,'r*') plot(xl3,yl3,'r*') plot([xl1 xl2 xl3 xl1],[yl1 yl2 yl3 yl1],'r--') text(xl3,yl3+.1,'r* are tripod feet') % now add poking Eyeball [xpe,ype]=xycoord(fn_pe_rng, fn_pe_brn+rotcor); plot(xpe,ype,'go') text(xpe,ype+.2,'poking eyeball') % now add the pencilbeam path [xpb,ypb]=xycoord(fn_pb_rng, fn_pb_brn+rotcor); plot(xpb,ypb,'c*') % now do the trig to find the line scanned by the pencil beam pbradius=prng_conf*(sin(deg2rad(psector/2))); pbend1r=sqrt((fn_pb_rng^2)+(pbradius^2)); %in case the transducer is lower than the range configured allows h_need=cos(deg2rad(psector/2))*prng_conf; if pb_hab < h_need new_len=tan(deg2rad(psector/2))*pb_hab; pbend1r=sqrt((pb_hab^2)+(new_len^2)); end pbend1ang=rad2deg(atan(pbradius/fn_pb_rng)); [x2,y2]=xycoord(pbend1r, fn_pb_brn + pbend1ang +rotcor); [x3,y3]=xycoord(pbend1r, fn_pb_brn + (-pbend1ang) +rotcor); plot(x2,y2,'b*') plot(x3,y3,'b*') text(x3,y3+.2,'pencil path') plot([x2 x3],[y2 y3],'b')