load("\\thalassa\ProjectLibrary\901805_Coastal_Biogeochemical_Sensing\Spray_Data\26220301\real_time_binned\26220301sat.mat");
%% Figure 1: map
map = figure(1);
% Color points by serial date number (s.sdn) and use satellite basemap
c = s.sdn;
geoscatter(s.lat,s.lon,20,c,'filled')
colormap(jet)
cb = colorbar;
% Show a few readable date ticks on the colorbar
if numel(c)>1 && all(isfinite([min(c) max(c)])) && (max(c)>min(c))
	cbTicks = linspace(min(c),max(c),6);
	cb.Ticks = cbTicks;
	cb.TickLabels = cellstr(datestr(cbTicks,'yyyy-mm-dd'));
end
title('Monterey Bay Glider Transects')
subtitle('Spray2: SN203')
try
	geobasemap('satellite')
catch
	% geobasemap may not be available; ignore if error
end

% Save the map with same full-page landscape specs
set(map,'Units','inches');
set(map,'Position',[0.5 0.5 11 8.5]);
set(map,'PaperUnits','inches');
set(map,'PaperSize',[11 8.5]);
set(map,'PaperPositionMode','manual');
set(map,'PaperPosition',[0 0 11 8.5]);
print(map,'-dpng','-r300','MB_pH_Transect_map_landscape.png')
%% Figure 2: Transect
fig = figure(2);
tl = tiledlayout(2,2);
title(tl, 'Monterey Bay Glider Transects')
subtitle(tl, 'Spray2: SN203')
nexttile
contourf(s.sdn,s.depth(:,1),s.tc)
axis ij
colorbar
title('Temperature [^oC]')
datetick('x',2,'keeplimits')
nexttile
contourf(s.sdn,s.depth(:,1),s.psal)
axis ij
colorbar
title('Salinity [PSU]')
datetick('x',2,'keeplimits')
nexttile
contourf(s.sdn,s.depth(:,1),s.doxy)
axis ij
colorbar
title('Dissolved Oxygen [\mumol/kg]')
datetick('x',2,'keeplimits')
nexttile
contourf(s.sdn,s.depth(:,1),s.pHin)
axis ij
colorbar
title('pH insitu [total]')
datetick('x',2,'keeplimits')

% Save full-page landscape PNG (US Letter 11 x 8.5 inches)
set(fig,'Units','inches');
set(fig,'Position',[0.5 0.5 11 8.5]);
set(fig,'PaperUnits','inches');
set(fig,'PaperSize',[11 8.5]);
set(fig,'PaperPositionMode','manual');
set(fig,'PaperPosition',[0 0 11 8.5]);
print(fig,'-dpng','-r300','MB_pH_Transect_landscape.png')