% plt_map_sam.m - plot sampling runs and injection

clear h

figure(1)
clf

Lat_min=29.8;
Lat_max=30.5;
Lon_min=-68;
Lon_max=-67;


m_proj('mercator','lat',[Lat_min Lat_max],'lon',[Lon_min Lon_max])

hold on
if 1
  % plot inj tracks
  load INJ_003_fl
  load INJ_003_spd
  aa=find(lon > -50);
  lat(aa)=nan;
  lon(aa)=nan;

  p1_spd = spd_1;
  p2_spd = spd_2;
  psf6_1 = pump_1 + p1_sf6;
  psf6_2 = pump_2 + p2_sf6;
  ind_p1 = find(psf6_1 == 2);
  ind_p2 = find(psf6_2 == 2);
  h(1)=m_plot(lon(ind_p2),lat(ind_p2),'linewidth',2,'color','r');

  load INJ_004_fl
  psf6_1 = pump_1 + p1_sf6;
  psf6_2 = pump_2 + p2_sf6;
  ind_p1 = find(psf6_1 == 2);
  ind_p2 = find(psf6_2 == 2);
  m_plot(lon(ind_p2),lat(ind_p2),'linewidth',2,'color','r');
end

%%%%%%%%%%%%%%% Sampling casts start here
cast = 2;
 %%%%%%%%%%%% sam002
  load SAM_002_fl
  aa=find(sampl == 1);
  h(3)=m_plot(lon(aa),lat(aa),'b');

cast = 3
  %%%%%%%%%%%% sam003
  load SAM_003_fl
  aa=find(sampl == 1);
  m_plot(lon(aa),lat(aa),'b');

cast = 4
  %%%%%%%%%%%% sam004
  load SAM_004_fl
  aa=find(sampl == 1);
  m_plot(lon(aa),lat(aa),'b');

cast = 5
  %%%%%%%%%%%% sam005
  load SAM_005_fl
  aa=find(sampl == 1);
  m_plot(lon(aa),lat(aa),'b');

cast = 6
  %%%%%%%%%%%% sam006
  load SAM_006_fl
  aa=find(lon > -67.6366);
  lat(aa)=nan;
  lon(aa)=nan;
  aa=find(sampl == 1);
  m_plot(lon(aa),lat(aa),'b');

cast = 7
  %%%%%%%%%%%% sam007
  load SAM_007_fl
  aa=find(lon > -67.6366);
  lat(aa)=nan;
  lon(aa)=nan;

  aa=find(sampl == 1);
  m_plot(lon(aa),lat(aa),'b');


m_grid('box','on','tickdir','in','fontweight','bold'); 

% this makes the color reappear
set(findobj('tag','m_grid_color'),'facecolor','none')

xlabel('Longitude')
ylabel('Latitude')
title('EDDIES OC415-2 - Injection and Sampling Casts')

legend(h,'Inject','Sample')


print -dpng injsam_only_map.png
