diff --git a/Graph/TimeSeries/graphTimeSeriesTimeDepth.m b/Graph/TimeSeries/graphTimeSeriesTimeDepth.m index 1c0962501..b9ac026c2 100644 --- a/Graph/TimeSeries/graphTimeSeriesTimeDepth.m +++ b/Graph/TimeSeries/graphTimeSeriesTimeDepth.m @@ -76,14 +76,19 @@ h = pcolor(ax, double(xPcolor), double(yPcolor), double(var.data')); set(h, 'FaceColor', 'flat', 'EdgeColor', 'none'); -cb = colorbar('peer', ax); +% 'peer' input is not recommended starting in R2014b +if verLessThan('matlab', '8.4') + cb = colorbar('peer', ax); +else + cb = colorbar(ax); +end % reset position to what it was without the colorbar so that it aligns with % 1D datasets set(ax, 'Position', posWithoutCb); % Attach the context menu to colorbar -hMenu = setTimeSerieColorbarContextMenu(var); +hMenu = setTimeSeriesColorbarContextMenu(ax, var); set(cb, 'uicontextmenu', hMenu); % Let's redefine properties after pcolor to make sure grid lines appear @@ -96,7 +101,7 @@ 'Layer', 'top', ... 'Tag', 'axis2D'); -if all(all(colormap == rkbwr)) +if all(all(colormap(ax) == rkbwr)) set(cb, 'YLim', [0 360], 'YTick', [0 90 180 270 360]); end diff --git a/Graph/TimeSeries/graphTimeSeriesTimeFrequency.m b/Graph/TimeSeries/graphTimeSeriesTimeFrequency.m index bf7fba4a0..2b046a9a3 100644 --- a/Graph/TimeSeries/graphTimeSeriesTimeFrequency.m +++ b/Graph/TimeSeries/graphTimeSeriesTimeFrequency.m @@ -76,15 +76,20 @@ h = pcolor(ax, double(xPcolor), double(yPcolor), double(var.data')); set(h, 'FaceColor', 'flat', 'EdgeColor', 'none'); -cb = colorbar('peer', ax); +% 'peer' input is not recommended starting in R2014b +if verLessThan('matlab', '8.4') + cb = colorbar('peer', ax); +else + cb = colorbar(ax); +end % reset position to what it was without the colorbar so that it aligns with % 1D datasets set(ax, 'Position', posWithoutCb); % Attach the context menu to colorbar -hMenu = setTimeSerieColorbarContextMenu(var); -set(cb,'uicontextmenu',hMenu); +hMenu = setTimeSeriesColorbarContextMenu(ax, var); +set(cb, 'uicontextmenu', hMenu); % Let's redefine properties after pcolor to make sure grid lines appear % above color data and XTick and XTickLabel haven't changed diff --git a/Graph/TimeSeries/graphTimeSeriesTimeFrequencyDirection.m b/Graph/TimeSeries/graphTimeSeriesTimeFrequencyDirection.m index c2f683634..14b601d55 100644 --- a/Graph/TimeSeries/graphTimeSeriesTimeFrequencyDirection.m +++ b/Graph/TimeSeries/graphTimeSeriesTimeFrequencyDirection.m @@ -203,11 +203,16 @@ 'Position' , posUi2(mainPanel, 50, 1, 50, 1, 0), ... 'String' ,'Time cursor'); -cb = colorbar('peer',ax); +% 'peer' input is not recommended starting in R2014b +if verLessThan('matlab', '8.4') + cb = colorbar('peer', ax); +else + cb = colorbar(ax); +end % Attach the context menu to colorbar -hMenu = setTimeSerieColorbarContextMenu(myVar); -set(cb,'uicontextmenu',hMenu); +hMenu = setTimeSeriesColorbarContextMenu(ax, myVar); +set(cb, 'uicontextmenu', hMenu); cbLabel = imosParameters(myVar.name, 'uom'); cbLabel = [myVar.name ' (' cbLabel ')']; diff --git a/Graph/TimeSeries/setTimeSerieColorbarContextMenu.m b/Graph/TimeSeries/setTimeSeriesColorbarContextMenu.m similarity index 76% rename from Graph/TimeSeries/setTimeSerieColorbarContextMenu.m rename to Graph/TimeSeries/setTimeSeriesColorbarContextMenu.m index ed68a1c6e..300d90061 100644 --- a/Graph/TimeSeries/setTimeSerieColorbarContextMenu.m +++ b/Graph/TimeSeries/setTimeSeriesColorbarContextMenu.m @@ -1,11 +1,12 @@ -function hMenu = setTimeSerieColorbarContextMenu(var) -%SETTIMESERIECOLORBARCONTEXTMENU returns a context menu for colorbar -% specific to variables. +function hMenu = setTimeSeriesColorbarContextMenu(ax, var) +%SETTIMESERIESCOLORBARCONTEXTMENU sets a colorbar uicontextmenu and returns its handle +% specific to an axes and a variable. % % This function is used for defining the colorbar context menus of each % axis 2D displayed. % % Inputs: +% ax - The handle of the targeted axes. % var - The variable structure from sample_data.variables{k} if % it is the k_th variable. % @@ -32,8 +33,9 @@ % along with this program. % If not, see . % -narginchk(1, 1); +narginchk(2, 2); +if ~ishandle(ax), error('ax must be a graphic object handle'); end if ~isstruct(var), error('var must be a struct'); end hMenu = []; @@ -52,8 +54,8 @@ switch upper(var.name(1:4)) case {'UCUR', 'VCUR', 'WCUR', 'ECUR', 'VEL1', 'VEL2', 'VEL3', 'VEL4'} % 0 centred parameters - colormap(r_b); - cbCLimRange('', '', 'full, 0 centred', var.data); % full is chosen to attract attention on any potential outlier + colormap(ax, r_b); + cbCLimRange('', '', ax, 'full, 0 centred', var.data); % full is chosen to attract attention on any potential outlier % Define a context menu hMenu = uicontextmenu; @@ -68,13 +70,13 @@ uimenu(mainItem1, 'Label', 'other', 'Callback', hcb13); mainItem2 = uimenu(hMenu, 'Label', 'Color range'); - uimenu(mainItem2, 'Label', 'full, 0 centred (default)', 'Callback', {@cbCLimRange, 'full, 0 centred', var.data}); - uimenu(mainItem2, 'Label', 'auto, 0 centred [0 +/-2*stdDev]', 'Callback', {@cbCLimRange, 'auto, 0 centred', var.data}); - uimenu(mainItem2, 'Label', 'manual', 'Callback', {@cbCLimRange, 'manual', var.data}); + uimenu(mainItem2, 'Label', 'full, 0 centred (default)', 'Callback', {@cbCLimRange, ax, 'full, 0 centred', var.data}); + uimenu(mainItem2, 'Label', 'auto, 0 centred [0 +/-2*stdDev]', 'Callback', {@cbCLimRange, ax, 'auto, 0 centred', var.data}); + uimenu(mainItem2, 'Label', 'manual', 'Callback', {@cbCLimRange, ax, 'manual', var.data}); case {'CDIR', 'SSWD'} % directions - colormap(rkbwr); - cbCLimRange('', '', 'direction [0; 360]', var.data); + colormap(ax, rkbwr); + cbCLimRange('', '', ax, 'direction [0; 360]', var.data); % Define a context menu hMenu = uicontextmenu; @@ -89,12 +91,12 @@ uimenu(mainItem1, 'Label', 'other', 'Callback', hcb13); mainItem2 = uimenu(hMenu, 'Label', 'Color range'); - uimenu(mainItem2, 'Label', 'direction [0; 360] (default)', 'Callback', {@cbCLimRange, 'direction [0; 360]', var.data}); - uimenu(mainItem2, 'Label', 'manual', 'Callback', {@cbCLimRange, 'manual', var.data}); + uimenu(mainItem2, 'Label', 'direction [0; 360] (default)', 'Callback', {@cbCLimRange, ax, 'direction [0; 360]', var.data}); + uimenu(mainItem2, 'Label', 'manual', 'Callback', {@cbCLimRange, ax, 'manual', var.data}); case 'PERG' % percentages - colormap(parula); - cbCLimRange('', '', 'percent [0; 100]', var.data); + colormap(ax, parula); + cbCLimRange('', '', ax, 'percent [0; 100]', var.data); % Define a context menu hMenu = uicontextmenu; @@ -111,12 +113,12 @@ uimenu(mainItem1, 'Label', 'other', 'Callback', hcb13); mainItem2 = uimenu(hMenu, 'Label', 'Color range'); - uimenu(mainItem2, 'Label', 'percent [0; 100] (default)', 'Callback', {@cbCLimRange, 'percent [0; 100]', var.data}); - uimenu(mainItem2, 'Label', 'manual', 'Callback', {@cbCLimRange, 'manual', var.data}); + uimenu(mainItem2, 'Label', 'percent [0; 100] (default)', 'Callback', {@cbCLimRange, ax, 'percent [0; 100]', var.data}); + uimenu(mainItem2, 'Label', 'manual', 'Callback', {@cbCLimRange, ax, 'manual', var.data}); case {'CSPD', 'VDEN', 'VDEV', 'VDEP', 'VDES'} % [0; oo[ paremeters - colormap(parula); - cbCLimRange('', '', 'full', var.data); % full is chosen to attract attention on any potential outlier + colormap(ax, parula); + cbCLimRange('', '', ax, 'full', var.data); % full is chosen to attract attention on any potential outlier % Define a context menu hMenu = uicontextmenu; @@ -133,17 +135,17 @@ uimenu(mainItem1, 'Label', 'other', 'Callback', hcb13); mainItem2 = uimenu(hMenu, 'Label', 'Color range'); - uimenu(mainItem2, 'Label', 'full', 'Callback', {@cbCLimRange, 'full', var.data}); - uimenu(mainItem2, 'Label', 'full from 0 (default)', 'Callback', {@cbCLimRange, 'full from 0', var.data}); - uimenu(mainItem2, 'Label', 'auto [mean +/-2*stdDev]', 'Callback', {@cbCLimRange, 'auto', var.data}); - uimenu(mainItem2, 'Label', 'auto from 0 [0; mean +2*stdDev]', 'Callback', {@cbCLimRange, 'auto from 0', var.data}); - uimenu(mainItem2, 'Label', 'manual', 'Callback', {@cbCLimRange, 'manual', var.data}); + uimenu(mainItem2, 'Label', 'full', 'Callback', {@cbCLimRange, ax, 'full', var.data}); + uimenu(mainItem2, 'Label', 'full from 0 (default)', 'Callback', {@cbCLimRange, ax, 'full from 0', var.data}); + uimenu(mainItem2, 'Label', 'auto [mean +/-2*stdDev]', 'Callback', {@cbCLimRange, ax, 'auto', var.data}); + uimenu(mainItem2, 'Label', 'auto from 0 [0; mean +2*stdDev]', 'Callback', {@cbCLimRange, ax, 'auto from 0', var.data}); + uimenu(mainItem2, 'Label', 'manual', 'Callback', {@cbCLimRange, ax, 'manual', var.data}); case {'SSWV'} % [0; oo[ paremeter with special jet_w colormap % let's apply a colormap like jet but starting from white load('jet_w.mat', '-mat', 'jet_w'); - colormap(jet_w); - cbCLimRange('', '', 'full', var.data); % full is chosen to attract attention on any potential outlier + colormap(ax, jet_w); + cbCLimRange('', '', ax, 'full', var.data); % full is chosen to attract attention on any potential outlier % Define a context menu hMenu = uicontextmenu; @@ -162,15 +164,15 @@ uimenu(mainItem1, 'Label', 'other', 'Callback', hcb14); mainItem2 = uimenu(hMenu, 'Label', 'Color range'); - uimenu(mainItem2, 'Label', 'full', 'Callback', {@cbCLimRange, 'full', var.data}); - uimenu(mainItem2, 'Label', 'full from 0 (default)', 'Callback', {@cbCLimRange, 'full from 0', var.data}); - uimenu(mainItem2, 'Label', 'auto [mean +/-2*stdDev]', 'Callback', {@cbCLimRange, 'auto', var.data}); - uimenu(mainItem2, 'Label', 'auto from 0 [0; mean +2*stdDev]', 'Callback', {@cbCLimRange, 'auto from 0', var.data}); - uimenu(mainItem2, 'Label', 'manual', 'Callback', {@cbCLimRange, 'manual', var.data}); + uimenu(mainItem2, 'Label', 'full', 'Callback', {@cbCLimRange, ax, 'full', var.data}); + uimenu(mainItem2, 'Label', 'full from 0 (default)', 'Callback', {@cbCLimRange, ax, 'full from 0', var.data}); + uimenu(mainItem2, 'Label', 'auto [mean +/-2*stdDev]', 'Callback', {@cbCLimRange, ax, 'auto', var.data}); + uimenu(mainItem2, 'Label', 'auto from 0 [0; mean +2*stdDev]', 'Callback', {@cbCLimRange, ax, 'auto from 0', var.data}); + uimenu(mainItem2, 'Label', 'manual', 'Callback', {@cbCLimRange, ax, 'manual', var.data}); otherwise - colormap(parula); - cbCLimRange('', '', 'full', var.data); % full is chosen to attract attention on any potential outlier + colormap(ax, parula); + cbCLimRange('', '', ax, 'full', var.data); % full is chosen to attract attention on any potential outlier % Define a context menu hMenu = uicontextmenu; @@ -189,20 +191,20 @@ uimenu(mainItem1, 'Label', 'other', 'Callback', hcb14); mainItem2 = uimenu(hMenu, 'Label', 'Color range'); - uimenu(mainItem2, 'Label', 'full (default)', 'Callback', {@cbCLimRange, 'full', var.data}); - uimenu(mainItem2, 'Label', 'full from 0', 'Callback', {@cbCLimRange, 'full from 0', var.data}); - uimenu(mainItem2, 'Label', 'full, 0 centred', 'Callback', {@cbCLimRange, 'full, 0 centred', var.data}); - uimenu(mainItem2, 'Label', 'auto [mean +/-2*stdDev]', 'Callback', {@cbCLimRange, 'auto', var.data}); - uimenu(mainItem2, 'Label', 'auto from 0 [0; mean +2*stdDev]', 'Callback', {@cbCLimRange, 'auto from 0', var.data}); - uimenu(mainItem2, 'Label', 'auto, 0 centred [0 +/-2*stdDev]', 'Callback', {@cbCLimRange, 'auto, 0 centred', var.data}); - uimenu(mainItem2, 'Label', 'manual', 'Callback', {@cbCLimRange, 'manual', var.data}); + uimenu(mainItem2, 'Label', 'full (default)', 'Callback', {@cbCLimRange, ax, 'full', var.data}); + uimenu(mainItem2, 'Label', 'full from 0', 'Callback', {@cbCLimRange, ax, 'full from 0', var.data}); + uimenu(mainItem2, 'Label', 'full, 0 centred', 'Callback', {@cbCLimRange, ax, 'full, 0 centred', var.data}); + uimenu(mainItem2, 'Label', 'auto [mean +/-2*stdDev]', 'Callback', {@cbCLimRange, ax, 'auto', var.data}); + uimenu(mainItem2, 'Label', 'auto from 0 [0; mean +2*stdDev]', 'Callback', {@cbCLimRange, ax, 'auto from 0', var.data}); + uimenu(mainItem2, 'Label', 'auto, 0 centred [0 +/-2*stdDev]', 'Callback', {@cbCLimRange, ax, 'auto, 0 centred', var.data}); + uimenu(mainItem2, 'Label', 'manual', 'Callback', {@cbCLimRange, ax, 'manual', var.data}); end end % Callback function for CLim range -function cbCLimRange(src,eventdata, cLimMode, data) +function cbCLimRange(src,eventdata, ax, cLimMode, data) CLim = NaN(1, 2); @@ -253,7 +255,7 @@ function cbCLimRange(src,eventdata, cLimMode, data) CLim = [-2*stdDev, 2*stdDev]; case 'manual' - CLimCurr = get(gca, 'CLim'); + CLimCurr = get(ax, 'CLim'); prompt = {['{\bf', sprintf('Colorbar range :}\n\nmin value :')],... 'max value :'}; def = {num2str(CLimCurr(1)), num2str(CLimCurr(2))}; @@ -278,6 +280,6 @@ function cbCLimRange(src,eventdata, cLimMode, data) if CLim(1) == CLim(2), CLim(2) = CLim(1) + 1; end % CLim must be increasing -set(gca, 'CLim', CLim); +set(ax, 'CLim', CLim); end \ No newline at end of file diff --git a/Graph/diagramMooring1DVarAgainstOther.m b/Graph/diagramMooring1DVarAgainstOther.m index 5767e28a0..7a0623128 100644 --- a/Graph/diagramMooring1DVarAgainstOther.m +++ b/Graph/diagramMooring1DVarAgainstOther.m @@ -243,7 +243,12 @@ function diagramMooring1DVarAgainstOther(sample_data, varName, yAxisVarName, isQ if ~strcmpi(yAxisVarName, 'DEPTH') % colorbar not needed when Y axis is already DEPTH - hCBar = colorbar('peer', hAxMooringVar); + % 'peer' input is not recommended starting in R2014b + if verLessThan('matlab', '8.4') + hCBar = colorbar('peer', hAxMooringVar); + else + hCBar = colorbar(hAxMooringVar); + end set(get(hCBar, 'Title'), 'String', 'DEPTH (m)', 'Interpreter', 'none'); end diff --git a/Graph/diagramMooring2DVarAgainstOther.m b/Graph/diagramMooring2DVarAgainstOther.m index 6a8bd600f..5dd6e6151 100644 --- a/Graph/diagramMooring2DVarAgainstOther.m +++ b/Graph/diagramMooring2DVarAgainstOther.m @@ -141,6 +141,7 @@ function diagramMooring2DVarAgainstOther(sample_data, varName, yAxisVarName, isQ iHeight = getVar(sample_data{iSort(i)}.dimensions, 'HEIGHT_ABOVE_SENSOR'); if iHeight == 0, iHeight = getVar(sample_data{iSort(i)}.dimensions, 'DIST_ALONG_BEAMS'); end % is equivalent when tilt is negligeable iVar = getVar(sample_data{iSort(i)}.variables, varName); + iYAxisVar = getVar(sample_data{iSort(i)}.variables, yAxisVarName); if iVar && iYAxisVar && iHeight && ... size(sample_data{iSort(i)}.variables{iVar}.data, 2) > 1 && ... @@ -305,7 +306,12 @@ function diagramMooring2DVarAgainstOther(sample_data, varName, yAxisVarName, isQ if ~strcmpi(yAxisVarName, 'DEPTH') % colorbar not needed when Y axis is already DEPTH - hCBar = colorbar('peer', hAxMooringVar); + % 'peer' input is not recommended starting in R2014b + if verLessThan('matlab', '8.4') + hCBar = colorbar('peer', hAxMooringVar); + else + hCBar = colorbar(hAxMooringVar); + end set(get(hCBar, 'Title'), 'String', 'DEPTH (m)', 'Interpreter', 'none'); end diff --git a/Graph/lineMooring1DVar.m b/Graph/lineMooring1DVar.m index 991e1f6a0..ef697f650 100644 --- a/Graph/lineMooring1DVar.m +++ b/Graph/lineMooring1DVar.m @@ -300,7 +300,12 @@ function lineMooring1DVar(sample_data, varName, isQC, saveToFile, exportDir) % Let's add a fake colorbar to have consistent display with or % without colorbar - cb = colorbar('peer', hAxMooringVar); + % 'peer' input is not recommended starting in R2014b + if verLessThan('matlab', '8.4') + cb = colorbar('peer', hAxMooringVar); + else + cb = colorbar(hAxMooringVar); + end set(get(cb, 'YLabel'), 'String', 'TEST'); pos_with_colorbar = get(hAxMooringVar, 'Position'); colorbar(cb, 'off'); diff --git a/Graph/pcolorMooring2DVar.m b/Graph/pcolorMooring2DVar.m index b8ab53d4f..51a29139d 100644 --- a/Graph/pcolorMooring2DVar.m +++ b/Graph/pcolorMooring2DVar.m @@ -208,21 +208,38 @@ function pcolorMooring2DVar(sample_data, varName, isQC, saveToFile, exportDir) 'YDir', 'normal', ... 'Layer', 'top'); - hCBar = colorbar('peer', hAxMooringVar); + % 'peer' input is not recommended starting in R2014b + if verLessThan('matlab', '8.4') + hCBar = colorbar('peer', hAxMooringVar); + else + hCBar = colorbar(hAxMooringVar); + end colormap(hAxMooringVar, cMap); switch cType case 'direction' - hCBar = colorbar('peer', hAxMooringVar, 'YLim', [0 360], 'YTick', [0 90 180 270 360]); + if verLessThan('matlab', '8.4') + hCBar = colorbar('peer', hAxMooringVar, 'YLim', [0 360], 'YTick', [0 90 180 270 360]); + else + hCBar = colorbar(hAxMooringVar, 'YLim', [0 360], 'YTick', [0 90 180 270 360]); + end set(hAxMooringVar, 'CLim', [0 360]); set(hCBar, 'YTick', [0 90 180 270 360]); case 'centeredOnZero' yLimMax = max(max(dataVar)); - hCBar = colorbar('peer', hAxMooringVar, 'YLim', [-yLimMax yLimMax]); + if verLessThan('matlab', '8.4') + hCBar = colorbar('peer', hAxMooringVar, 'YLim', [-yLimMax yLimMax]); + else + hCBar = colorbar(hAxMooringVar, 'YLim', [-yLimMax yLimMax]); + end set(hAxMooringVar, 'CLim', [-yLimMax yLimMax]); case 'positiveFromZero' yLimMax = max(max(dataVar)); - hCBar = colorbar('peer', hAxMooringVar, 'YLim', [0 yLimMax]); + if verLessThan('matlab', '8.4') + hCBar = colorbar('peer', hAxMooringVar, 'YLim', [0 yLimMax]); + else + hCBar = colorbar(hAxMooringVar, 'YLim', [0 yLimMax]); + end set(hAxMooringVar, 'CLim', [0 yLimMax]); end diff --git a/Graph/scatterMooring1DVarAgainstDepth.m b/Graph/scatterMooring1DVarAgainstDepth.m index 479967938..ea4944a31 100644 --- a/Graph/scatterMooring1DVarAgainstDepth.m +++ b/Graph/scatterMooring1DVarAgainstDepth.m @@ -225,7 +225,12 @@ function scatterMooring1DVarAgainstDepth(sample_data, varName, isQC, saveToFile, cMap = colormap(hAxMooringVar, parula(nColors)); end - hCBar = colorbar('peer', hAxMooringVar); + % 'peer' input is not recommended starting in R2014b + if verLessThan('matlab', '8.4') + hCBar = colorbar('peer', hAxMooringVar); + else + hCBar = colorbar(hAxMooringVar); + end set(get(hCBar, 'Title'), 'String', [varName ' (' varUnit ')'], 'Interpreter', 'none'); initiateFigure = false; diff --git a/Graph/scatterMooring2DVarAgainstDepth.m b/Graph/scatterMooring2DVarAgainstDepth.m index 0b3d0176d..effdd6ff5 100644 --- a/Graph/scatterMooring2DVarAgainstDepth.m +++ b/Graph/scatterMooring2DVarAgainstDepth.m @@ -274,7 +274,12 @@ function scatterMooring2DVarAgainstDepth(sample_data, varName, isQC, saveToFile, set(zoomH,'ActionPostCallback',{@zoomDateTick, hAxMooringVar}); set(panH,'ActionPostCallback',{@zoomDateTick, hAxMooringVar}); - hCBar = colorbar('peer', hAxMooringVar, 'YLim', CLim); + % 'peer' input is not recommended starting in R2014b + if verLessThan('matlab', '8.4') + hCBar = colorbar('peer', hAxMooringVar, 'YLim', CLim); + else + hCBar = colorbar(hAxMooringVar, 'YLim', CLim); + end colormap(hAxMooringVar, cMap); set(hAxMooringVar, 'CLim', CLim); diff --git a/IMOS/imosParameters.txt b/IMOS/imosParameters.txt index 21c81c97b..a3566fe13 100644 --- a/IMOS/imosParameters.txt +++ b/IMOS/imosParameters.txt @@ -39,9 +39,9 @@ CDOM, 1, concentration_of_colored_dissolved_organic_matter_in_sea CHC, 1, mass_concentration_of_petroleum_hydrocarbons_in_sea_water, ug l-1, , , E, 999999.0, , , float CHR, 0, mass_concentration_of_refined_hydrocarbons_in_sea_water, ug l-1, , , E, 999999.0, , , float CNDC, 1, sea_water_electrical_conductivity, S m-1, , , C, 999999.0, 0.0, 50000.0, float -CPHL, 0, mass_concentration_of_inferred_chlorophyll_from_relative_fluorescence_units_in_sea_water, mg m-3, , , K, 999999.0, 0.0, 100.0, float -CHLF, 0, mass_concentration_of_inferred_chlorophyll_from_relative_fluorescence_units_in_sea_water, mg m-3, , , K, 999999.0, 0.0, 100.0, float -CHLU, 0, mass_concentration_of_inferred_chlorophyll_from_relative_fluorescence_units_in_sea_water, mg m-3, , , K, 999999.0, 0.0, 100.0, float +CPHL, 0, mass_concentration_of_inferred_chlorophyll_from_relative_fluorescence_units_in_sea_water, mg m-3, , , K, 999999.0, 0.0, 5.0, float +CHLF, 0, mass_concentration_of_inferred_chlorophyll_from_relative_fluorescence_units_in_sea_water, mg m-3, , , K, 999999.0, 0.0, 5.0, float +CHLU, 0, mass_concentration_of_inferred_chlorophyll_from_relative_fluorescence_units_in_sea_water, mg m-3, , , K, 999999.0, 0.0, 5.0, float CSPD, 1, sea_water_speed, m s-1, , , V, 999999.0, 0.0, 10.0, float CSPD_STD, 0, sea_water_speed_standard_deviation, m s-1, , , V, 999999.0, 0.0, 10.0, float DENS, 1, sea_water_density, kg m-3, , , D, 999999.0, , , float @@ -142,8 +142,8 @@ TAU, 1, magnitude_of_surface_downward_stress, TEMP, 1, sea_water_temperature, degrees_Celsius,, , T, 999999.0, -2.5, 40.0, float TIME, 1, time, days since 1950-01-01 00:00:00 UTC, , , , 999999.0, 0.0, 90000.0, double TIMESERIES, 0, unique_identifier_for_each_timeseries_feature_instance_in_this_file, , , , , , , , int -TURB, 1, sea_water_turbidity, 1, , , U, 999999.0, 0.0, 1000.0, float -TURBF, 0, sea_water_turbidity_in_FTU, 1, , , U, 999999.0, 0.0, 1000.0, float +TURB, 1, sea_water_turbidity, 1, , , U, 999999.0, 0.0, 4.0, float +TURBF, 0, sea_water_turbidity_in_FTU, 1, , , U, 999999.0, 0.0, 4.0, float TRAJECTORY, 0, unique_identifier_for_each_trajectory_feature_instance_in_this_file, , , , , , , , int UCUR, 1, eastward_sea_water_velocity, m s-1, , true north, V, 999999.0, -10.0, 10.0, float UCUR_MAG, 1, eastward_sea_water_velocity, m s-1, , magnetic north, V, 999999.0, -10.0, 10.0, float diff --git a/Parser/addAWACWaveToSample.m b/Parser/addAWACWaveToSample.m index 406018fa4..81e5e6188 100644 --- a/Parser/addAWACWaveToSample.m +++ b/Parser/addAWACWaveToSample.m @@ -178,8 +178,8 @@ sample_data{2}.variables{i}.data = sample_data{2}.variables{i}.typeCastFunc(vars{i, 3}); if any(strcmpi(vars{i, 1}, {'SSWD', 'WPDI', 'SSDS', 'VDIR', 'HEADING', 'SSWV'})) - sample_data.variables{i}.compass_correction_applied = magDec; - sample_data.variables{i}.comment = magBiasComment; + sample_data{2}.variables{i}.compass_correction_applied = magDec; + sample_data{2}.variables{i}.comment = magBiasComment; end end clear vars; diff --git a/Parser/aquadoppProfilerParse.m b/Parser/aquadoppProfilerParse.m index 3d7746ecd..b3f236652 100644 --- a/Parser/aquadoppProfilerParse.m +++ b/Parser/aquadoppProfilerParse.m @@ -128,7 +128,7 @@ time = [structures.(profilerType)(:).Time]'; analn1 = [structures.(profilerType)(:).Analn1]'; battery = [structures.(profilerType)(:).Battery]'; -analn2 = [structures.(profilerType)(:).Analn2]'; +soundSpeed = [structures.(profilerType)(:).Analn2]'; heading = [structures.(profilerType)(:).Heading]'; pitch = [structures.(profilerType)(:).Pitch]'; roll = [structures.(profilerType)(:).Roll]'; @@ -168,6 +168,7 @@ clear structures; % battery / 10.0 (0.1 V -> V) +% soundSpeed / 10.0 (0.1 m/s -> m/s) % heading / 10.0 (0.1 deg -> deg) % pitch / 10.0 (0.1 deg -> deg) % roll / 10.0 (0.1 deg -> deg) @@ -175,6 +176,7 @@ % temperature / 100.0 (0.01 deg -> deg) % velocities / 1000.0 (mm/s -> m/s) assuming earth coordinates battery = battery / 10.0; +soundSpeed = soundSpeed / 10.0; heading = heading / 10.0; pitch = pitch / 10.0; roll = roll / 10.0; @@ -329,12 +331,13 @@ 'TEMP', 1, temperature; ... 'PRES_REL', 1, pressure; ... 'VOLT', 1, battery; ... + 'SSPD', 1, soundSpeed; ... 'PITCH', 1, pitch; ... 'ROLL', 1, roll; ... 'HEADING_MAG', 1, heading }; clear analn1 analn2 time distance velocity1 velocity2 velocity3 ... - backscatter1 backscatter2 backscatter3 ... + backscatter1 backscatter2 backscatter3 soundSpeed ... temperature pressure battery pitch roll heading status; if velocityProcessed diff --git a/Parser/aquadoppVelocityParse.m b/Parser/aquadoppVelocityParse.m index 27561c381..598a8ba8f 100644 --- a/Parser/aquadoppVelocityParse.m +++ b/Parser/aquadoppVelocityParse.m @@ -84,7 +84,7 @@ time = [structures.Id1(:).Time]'; analn1 = [structures.Id1(:).Analn1]'; battery = [structures.Id1(:).Battery]'; -analn2 = [structures.Id1(:).Analn2]'; +soundSpeed = [structures.Id1(:).Analn2]'; heading = [structures.Id1(:).Heading]'; pitch = [structures.Id1(:).Pitch]'; roll = [structures.Id1(:).Roll]'; @@ -99,6 +99,7 @@ clear structures; % battery / 10.0 (0.1 V -> V) +% soundSpeed / 10.0 (0.1 m/s -> m/s) % heading / 10.0 (0.1 deg -> deg) % pitch / 10.0 (0.1 deg -> deg) % roll / 10.0 (0.1 deg -> deg) @@ -106,6 +107,7 @@ % temperature / 100.0 (0.01 deg -> deg) % velocities / 1000.0 (mm/s -> m/s) assuming earth coordinates battery = battery / 10.0; +soundSpeed = soundSpeed / 10.0; heading = heading / 10.0; pitch = pitch / 10.0; roll = roll / 10.0; @@ -179,11 +181,12 @@ 'TEMP', 1, temperature; ... 'PRES_REL', 1, pressure; ... 'VOLT', 1, battery; ... + 'SSPD', 1, soundSpeed; ... 'PITCH', 1, pitch; ... 'ROLL', 1, roll; ... 'HEADING_MAG', 1, heading }; -clear analn1 analn2 time distance velocity1 velocity2 velocity3 ... +clear analn1 soundSpeed time distance velocity1 velocity2 velocity3 ... backscatter1 backscatter2 backscatter3 ... temperature pressure battery pitch roll heading; diff --git a/Parser/awacParse.m b/Parser/awacParse.m index 67b755b81..58a6e1e2b 100644 --- a/Parser/awacParse.m +++ b/Parser/awacParse.m @@ -100,7 +100,7 @@ time = [structures.Id32(:).Time]'; analn1 = [structures.Id32(:).Analn1]'; battery = [structures.Id32(:).Battery]'; -analn2 = [structures.Id32(:).Analn2]'; +soundSpeed = [structures.Id32(:).Analn2]'; heading = [structures.Id32(:).Heading]'; pitch = [structures.Id32(:).Pitch]'; roll = [structures.Id32(:).Roll]'; @@ -140,6 +140,7 @@ clear structures; % battery / 10.0 (0.1 V -> V) +% soundSpeed / 10.0 (0.1 m/s -> m/s) % heading / 10.0 (0.1 deg -> deg) % pitch / 10.0 (0.1 deg -> deg) % roll / 10.0 (0.1 deg -> deg) @@ -147,6 +148,7 @@ % temperature / 100.0 (0.01 deg -> deg) % velocities / 1000.0 (mm/s -> m/s) assuming earth coordinates battery = battery / 10.0; +soundSpeed = soundSpeed / 10.0; heading = heading / 10.0; pitch = pitch / 10.0; roll = roll / 10.0; @@ -297,12 +299,13 @@ 'TEMP', 1, temperature; ... 'PRES_REL', 1, pressure; ... 'VOLT', 1, battery; ... + 'SSPD', 1, soundSpeed; ... 'PITCH', 1, pitch; ... 'ROLL', 1, roll; ... 'HEADING_MAG', 1, heading }; clear analn1 analn2 time distance velocity1 velocity2 velocity3 ... - backscatter1 backscatter2 backscatter3 ... + backscatter1 backscatter2 backscatter3 soundSpeed ... temperature pressure battery pitch roll heading status; if velocityProcessed diff --git a/Parser/continentalParse.m b/Parser/continentalParse.m index d5cda2ec2..1d9c4c776 100644 --- a/Parser/continentalParse.m +++ b/Parser/continentalParse.m @@ -101,7 +101,7 @@ time = [structures.Id36(:).Time]'; analn1 = [structures.Id36(:).Analn1]'; battery = [structures.Id36(:).Battery]'; -analn2 = [structures.Id36(:).Analn2]'; +soundSpeed = [structures.Id36(:).Analn2]'; heading = [structures.Id36(:).Heading]'; pitch = [structures.Id36(:).Pitch]'; roll = [structures.Id36(:).Roll]'; @@ -141,6 +141,7 @@ clear structures; % battery / 10.0 (0.1 V -> V) +% soundSpeed / 10.0 (0.1 m/s -> m/s) % heading / 10.0 (0.1 deg -> deg) % pitch / 10.0 (0.1 deg -> deg) % roll / 10.0 (0.1 deg -> deg) @@ -148,6 +149,7 @@ % temperature / 100.0 (0.01 deg -> deg) % velocities / 1000.0 (mm/s -> m/s) assuming earth coordinates battery = battery / 10.0; +soundSpeed = soundSpeed / 10.0; heading = heading / 10.0; pitch = pitch / 10.0; roll = roll / 10.0; @@ -296,12 +298,13 @@ 'TEMP', 1, temperature; ... 'PRES_REL', 1, pressure; ... 'VOLT', 1, battery; ... + 'SSPD', 1, soundSpeed; ... 'PITCH', 1, pitch; ... 'ROLL', 1, roll; ... 'HEADING_MAG', 1, heading }; clear analn1 analn2 time distance velocity1 velocity2 velocity3 ... - backscatter1 backscatter2 backscatter3 ... + backscatter1 backscatter2 backscatter3 soundSpeed ... temperature pressure battery pitch roll heading status; if velocityProcessed diff --git a/Parser/workhorseParse.m b/Parser/workhorseParse.m index ad6192128..abb86d31c 100644 --- a/Parser/workhorseParse.m +++ b/Parser/workhorseParse.m @@ -158,6 +158,7 @@ temperature = variable.temperature; pressure = variable.pressure; salinity = variable.salinity; + soundSpeed = variable.speedOfSound; pitch = variable.pitch; roll = variable.roll; heading = variable.heading; @@ -386,6 +387,7 @@ 'TEMP', 1, temperature, ''; ... 'PRES_REL', 1, pressure, ''; ... 'PSAL', 1, salinity, ''; ... + 'SSPD', 1, soundSpeed, ''; ... 'PITCH', 1, pitch, ''; ... 'ROLL', 1, roll, ''; ... ['HEADING' magExt], 1, heading, magBiasComment; ... @@ -396,7 +398,7 @@ backscatter2 backscatter3 backscatter4 temperature pressure ... salinity correlation1 correlation2 correlation3 correlation4 ... percentGood1 percentGood2 percentGood3 percentGood4 pitch roll ... - heading voltage; + heading voltage soundSpeed; nVars = size(vars, 1); sample_data.variables = cell(nVars, 1); diff --git a/Preprocessing/adcpBinMappingPP.m b/Preprocessing/adcpBinMappingPP.m index 671a0b5c5..f6bad21e3 100644 --- a/Preprocessing/adcpBinMappingPP.m +++ b/Preprocessing/adcpBinMappingPP.m @@ -60,21 +60,24 @@ % do not process if Nortek with more than 3 beams absic4Idx = getVar(sample_data{k}.variables, 'ABSIC4'); if absic4Idx && isNortek, continue; end - - heightAboveSensorIdx = getVar(sample_data{k}.dimensions, 'HEIGHT_ABOVE_SENSOR'); + + % do not process if dist_along_beams, pitch or roll are missing from dataset distAlongBeamsIdx = getVar(sample_data{k}.dimensions, 'DIST_ALONG_BEAMS'); pitchIdx = getVar(sample_data{k}.variables, 'PITCH'); rollIdx = getVar(sample_data{k}.variables, 'ROLL'); + if ~distAlongBeamsIdx || ~pitchIdx || ~rollIdx, continue; end - % do not process if pitch, roll, and dist_along_beams not present in data set - if ~(distAlongBeamsIdx && pitchIdx && rollIdx), continue; end - - % do not process if velocity data not vertically bin-mapped and there - % is no velocity data in beam coordinates (useless) + % do not process if ENU velocity data not vertically bin-mapped and there + % is no beam velocity data (ENU velocity is not going to be bin-mapped later so useless) + heightAboveSensorIdx = getVar(sample_data{k}.dimensions, 'HEIGHT_ABOVE_SENSOR'); ucurIdx = getVar(sample_data{k}.variables, 'UCUR'); if ~ucurIdx, ucurIdx = getVar(sample_data{k}.variables, 'UCUR_MAG'); end vel1Idx = getVar(sample_data{k}.variables, 'VEL1'); - if any(sample_data{k}.variables{ucurIdx}.dimensions == distAlongBeamsIdx) && ~vel1Idx, continue; end + if ucurIdx % in the case of datasets originally collected in beam coordinates there is no UCUR + if ~any(sample_data{k}.variables{ucurIdx}.dimensions == heightAboveSensorIdx) && ~vel1Idx + continue; + end + end % We apply tilt corrections to project DIST_ALONG_BEAMS onto the vertical % axis HEIGHT_ABOVE_SENSOR. diff --git a/Preprocessing/adcpNortekVelocityBeam2EnuPP.m b/Preprocessing/adcpNortekVelocityBeam2EnuPP.m index 05d33a4d9..1bf650804 100644 --- a/Preprocessing/adcpNortekVelocityBeam2EnuPP.m +++ b/Preprocessing/adcpNortekVelocityBeam2EnuPP.m @@ -53,7 +53,10 @@ % do not process if not current profiler ADCP distAlongBeamsIdx = getVar(sample_data{k}.dimensions, 'DIST_ALONG_BEAMS'); - if ~distAlongBeamsIdx, continue; end + heightAboveSensorIdx = getVar(sample_data{k}.dimensions, 'HEIGHT_ABOVE_SENSOR'); + if ~distAlongBeamsIdx + if ~heightAboveSensorIdx, continue; end + end % do not process if heading, pitch and roll not present in data set isMagCorrected = true; @@ -91,8 +94,9 @@ pitch = sample_data{k}.variables{pitchIdx}.data; roll = sample_data{k}.variables{rollIdx}.data; - dist = sample_data{k}.dimensions{distAlongBeamsIdx}.data; - heightAboveSensorIdx = getVar(sample_data{k}.dimensions, 'HEIGHT_ABOVE_SENSOR'); + if distAlongBeamsIdx + dist = sample_data{k}.dimensions{distAlongBeamsIdx}.data; + end if any(sample_data{k}.variables{vel1Idx}.dimensions == heightAboveSensorIdx) dist = sample_data{k}.dimensions{heightAboveSensorIdx}.data; end @@ -137,49 +141,60 @@ % we update the velocity values in ENU coordinates vars = {'UCUR', 'VCUR', 'WCUR'}; - varSuffix = ''; - if ~isMagCorrected, varSuffix = '_MAG'; end + varSuffix = {'', '', ''}; + if ~isMagCorrected, varSuffix = {'_MAG', '_MAG', ''}; end for l=1:length(vars) - if strcmpi(vars{l}, 'WCUR') - curIdx = getVar(sample_data{k}.variables, vars{l}); - else - curIdx = getVar(sample_data{k}.variables, [vars{l} varSuffix]); - end - sample_data{k}.variables{curIdx}.data = squeeze(velENU(l, :, :)); + varName = [vars{l} varSuffix{l}]; + curIdx = getVar(sample_data{k}.variables, varName); + if curIdx + % we update the velocity values in ENU coordinates + sample_data{k}.variables{curIdx}.data = squeeze(velENU(l, :, :)); - % need to update the dimensions/coordinates in case velocity in Beam - % coordinates would have been previously bin-mapped - sample_data{k}.variables{curIdx}.dimensions = sample_data{k}.variables{vel1Idx}.dimensions; - sample_data{k}.variables{curIdx}.coordinates = sample_data{k}.variables{vel1Idx}.coordinates; - - if ~isfield(sample_data{k}.variables{curIdx}, 'comment') - sample_data{k}.variables{curIdx}.comment = Beam2EnuComment; + % need to update the dimensions/coordinates in case velocity in Beam + % coordinates would have been previously bin-mapped + sample_data{k}.variables{curIdx}.dimensions = sample_data{k}.variables{vel1Idx}.dimensions; + sample_data{k}.variables{curIdx}.coordinates = sample_data{k}.variables{vel1Idx}.coordinates; + + if ~isfield(sample_data{k}.variables{curIdx}, 'comment') + sample_data{k}.variables{curIdx}.comment = Beam2EnuComment; + else + sample_data{k}.variables{curIdx}.comment = [sample_data{k}.variables{curIdx}.comment ' ' Beam2EnuComment]; + end else - sample_data{k}.variables{curIdx}.comment = [sample_data{k}.variables{curIdx}.comment ' ' Beam2EnuComment]; + % we create a new variable for velocity values in ENU coordinates + sample_data{k} = addVar(... + sample_data{k}, ... + varName, ... + squeeze(velENU(l, :, :)), ... + sample_data{k}.variables{vel1Idx}.dimensions, ... + Beam2EnuComment, ... + sample_data{k}.variables{vel1Idx}.coordinates); end end - % let's look for remaining variables assigned to DIST_ALONG_BEAMS, - % if none we can remove this dimension - isDistAlongBeamsUsed = false; - for j=1:length(sample_data{k}.variables) - if any(sample_data{k}.variables{j}.dimensions == distAlongBeamsIdx) - isDistAlongBeamsUsed = true; - break; + if distAlongBeamsIdx + % let's look for remaining variables assigned to DIST_ALONG_BEAMS, + % if none we can remove this dimension + isDistAlongBeamsUsed = false; + for j=1:length(sample_data{k}.variables) + if any(sample_data{k}.variables{j}.dimensions == distAlongBeamsIdx) + isDistAlongBeamsUsed = true; + break; + end end - end - if ~isDistAlongBeamsUsed - if length(sample_data{k}.dimensions) > distAlongBeamsIdx - for j=1:length(sample_data{k}.variables) - dimToUpdate = sample_data{k}.variables{j}.dimensions > distAlongBeamsIdx; - if any(dimToUpdate) - sample_data{k}.variables{j}.dimensions(dimToUpdate) = sample_data{k}.variables{j}.dimensions(dimToUpdate) - 1; + if ~isDistAlongBeamsUsed + if length(sample_data{k}.dimensions) > distAlongBeamsIdx + for j=1:length(sample_data{k}.variables) + dimToUpdate = sample_data{k}.variables{j}.dimensions > distAlongBeamsIdx; + if any(dimToUpdate) + sample_data{k}.variables{j}.dimensions(dimToUpdate) = sample_data{k}.variables{j}.dimensions(dimToUpdate) - 1; + end end end + sample_data{k}.dimensions(distAlongBeamsIdx) = []; + + Beam2EnuComment = [Beam2EnuComment ' DIST_ALONG_BEAMS is not used by any variable left and has been removed.']; end - sample_data{k}.dimensions(distAlongBeamsIdx) = []; - - Beam2EnuComment = [Beam2EnuComment ' DIST_ALONG_BEAMS is not used by any variable left and has been removed.']; end if ~isfield(sample_data{k}, 'history') diff --git a/imosToolbox.m b/imosToolbox.m index 512c99282..ebdbd520c 100644 --- a/imosToolbox.m +++ b/imosToolbox.m @@ -37,7 +37,7 @@ function imosToolbox(auto, varargin) % % Set current toolbox version -toolboxVersion = ['2.5.40 - ' computer]; +toolboxVersion = ['2.5.41 - ' computer]; if nargin == 0, auto = 'manual'; end diff --git a/imosToolbox_Linux64.bin b/imosToolbox_Linux64.bin index 1c9f38d69..faa7e57b8 100755 Binary files a/imosToolbox_Linux64.bin and b/imosToolbox_Linux64.bin differ diff --git a/imosToolbox_Win32.exe b/imosToolbox_Win32.exe index 09b09ccae..6b6d336af 100644 Binary files a/imosToolbox_Win32.exe and b/imosToolbox_Win32.exe differ diff --git a/imosToolbox_Win64.exe b/imosToolbox_Win64.exe index 95ca8337a..251d1eab7 100644 Binary files a/imosToolbox_Win64.exe and b/imosToolbox_Win64.exe differ