diff --git a/CTD_Chipod/mfiles/CalibrateChipodCTD.m b/CTD_Chipod/mfiles/CalibrateChipodCTD.m index 62c1f15..8262668 100644 --- a/CTD_Chipod/mfiles/CalibrateChipodCTD.m +++ b/CTD_Chipod/mfiles/CalibrateChipodCTD.m @@ -82,7 +82,11 @@ loglog(f,p2,f,p,'linewidth',2); axis tight grid on - legend('digital','analog','location','best') + try + legend('digital','analog','location','best','AutoUpdate','off') + catch + legend('digital','analog','location','best'); + end xlabel('Frequency [hz]') title(['Spectra of dT/dt - \tau =' num2str(chidat.cal.coef.T1P)]) ylabel('\Phi_{T_z} [^oC^2/s^{-2}]') @@ -114,7 +118,11 @@ loglog(f,p2,f,p,'linewidth',2); axis tight grid on - legend('digital','analog','location','best') + try + legend('digital','analog','location','best','AutoUpdate','off') + catch + legend('digital','analog','location','best'); + end xlabel('Frequency [hz]') title(['T2- Spectra of dT/dt - \tau =' num2str(chidat.cal.coef.T1P)]) ylabel('\Phi_{T_z} [^oC^2/s^{-2}]') diff --git a/CTD_Chipod/mfiles/MakeCasts_CTDchipod_function.m b/CTD_Chipod/mfiles/MakeCasts_CTDchipod_function.m index ea7dfca..16948b1 100644 --- a/CTD_Chipod/mfiles/MakeCasts_CTDchipod_function.m +++ b/CTD_Chipod/mfiles/MakeCasts_CTDchipod_function.m @@ -198,10 +198,12 @@ function MakeCasts_CTDchipod_function(the_project,mixpath) savedir_cal = fullfile(chi_proc_path_specific,'cal') ; ChkMkDir(savedir_cal) - % Plot the raw CTD data - ax = PlotRawCTD(CTD_24hz) ; - print(fullfile(chi_fig_path_specific,[whSN '_Cast_' castStr '_Fig0_RawCTD']),'-dpng') - + if ~exist(fullfile(chi_fig_path_specific,[whSN '_Cast_' castStr '_Fig0_RawCTD.png']),'file') + % Plot the raw CTD data + ax = PlotRawCTD(CTD_24hz) ; + print(fullfile(chi_fig_path_specific,[whSN '_Cast_' castStr '_Fig0_RawCTD']),'-dpng') + end + try %~~ Load chipod data diff --git a/CTD_Chipod/mfiles/PlotChipodDataRaw_General.m b/CTD_Chipod/mfiles/PlotChipodDataRaw_General.m index 708468b..2d0bac4 100644 --- a/CTD_Chipod/mfiles/PlotChipodDataRaw_General.m +++ b/CTD_Chipod/mfiles/PlotChipodDataRaw_General.m @@ -64,7 +64,16 @@ function PlotChipodDataRaw_General(the_project,mixpath) clear data head chidat close all - + + if saveplot==1 + figdir = fullfile(fig_path,'chipodraw',whSN); + figname = [chi_file_list(whfile).name(1:end-4)] ; + if exist(fullfile(figdir,[figname,'.png']),'file') + disp([figname,' has already been plotted; skipping...']) + continue; + end + end + %~~~ load chipod data try % 'big' chipod @@ -175,9 +184,9 @@ function PlotChipodDataRaw_General(the_project,mixpath) end if saveplot==1 - figdir = fullfile(fig_path,'chipodraw',whSN); +% figdir = fullfile(fig_path,'chipodraw',whSN); ChkMkDir(figdir) - figname = [chi_file_list(whfile).name(1:end-4)] ; +% figname = [chi_file_list(whfile).name(1:end-4)] ; print( fullfile(figdir,figname),'-dpng') end diff --git a/CTD_Chipod/mfiles/Plot_TP_profiles_EachCast_CTDchipod.m b/CTD_Chipod/mfiles/Plot_TP_profiles_EachCast_CTDchipod.m index d7f100c..0a2614c 100644 --- a/CTD_Chipod/mfiles/Plot_TP_profiles_EachCast_CTDchipod.m +++ b/CTD_Chipod/mfiles/Plot_TP_profiles_EachCast_CTDchipod.m @@ -49,6 +49,14 @@ function Plot_TP_profiles_EachCast_CTDchipod(the_project) waitbar(icast/Ncasts,hb) castname=CTDlist(icast).name(1:end-4) + if saveplot==1 + figdir=fullfile(BaseDir_data,'Figures','TPprofiles_AllSN'); + if exist(fullfile(figdir,['TP_profs_' castname '.png']),'file') + disp('Figure already plotted') + continue; + end + end + % Set up figure figure(1);clf agutwocolumn(1) diff --git a/CTD_Chipod/mfiles/do_chi_calc_ctd_chipod.m b/CTD_Chipod/mfiles/do_chi_calc_ctd_chipod.m index e605ee5..8f205b3 100644 --- a/CTD_Chipod/mfiles/do_chi_calc_ctd_chipod.m +++ b/CTD_Chipod/mfiles/do_chi_calc_ctd_chipod.m @@ -239,7 +239,7 @@ function do_chi_calc_ctd_chipod(the_project,mixpath,varargin) ylabel('P [db]') xlabel('# good data windows') title([whSN ' cast ' castStr ' - ' C.castdir 'cast'],'interpreter','none') - print('-dpng',fullfile(chi_fig_path_specific,[whSN '_' castStr '_Fig' num2str(whfig) '_' C.castdir 'cast_chi_' whsens '_avgPhist'])) + print('-dpng',fullfile(chi_fig_path_specific,[whSN '_Cast_' castStr '_Fig' num2str(whfig) '_' C.castdir 'cast_chi_' whsens '_avgPhist'])) whfig=whfig+1; end @@ -321,7 +321,7 @@ function do_chi_calc_ctd_chipod(the_project,mixpath,varargin) title([whSN],'interpreter','none') axes(ax(3)) title(['Sensor ' whsens]) - print('-dpng',fullfile(chi_fig_path_specific,[whSN '_' castStr '_Fig' num2str(whfig) '_' C.castdir 'cast_chi_' whsens '_avg_chi_KT_dTdz'])) + print('-dpng',fullfile(chi_fig_path_specific,[whSN '_Cast_' castStr '_Fig' num2str(whfig) '_' C.castdir 'cast_chi_' whsens '_avg_chi_KT_dTdz'])) whfig=whfig+1; %~~~ diff --git a/CTD_Chipod/mfiles/ezpc.m b/CTD_Chipod/mfiles/ezpc.m index 2996e16..34519ac 100644 --- a/CTD_Chipod/mfiles/ezpc.m +++ b/CTD_Chipod/mfiles/ezpc.m @@ -16,4 +16,21 @@ x=varargin{1};y=varargin{2};var=varargin{3}; end +% added by EPA, Mar 2022: + +if numel(y)>length(y) + y=y(:,1); +end +if numel(x)>length(x) + x=x(1,:); +end +good_x=find(~isnan(x)); +x=x(good_x); +var=var(:,good_x); +newx=[(3*x(1)-x(2)),(x(1:end-1)+x(2:end)),(x(end)*3-x(end-1))]/2; +[x,y]=meshgrid(newx,y); +var=[var,nan(length(y),1)]; + +% back to original programming: + h=pcolor(x,y,var);shading flat;axis ij