diff --git a/FlowManager/displayManager.m b/FlowManager/displayManager.m index 492bfd39c..a2d862776 100644 --- a/FlowManager/displayManager.m +++ b/FlowManager/displayManager.m @@ -286,7 +286,7 @@ function dataClickCallback(ax, type, point) graphFunc = getGraphFunc(graphType, 'graph', varName); if strcmpi(func2str(graphFunc), 'graphTimeSeriesTimeDepth') - lineMooring2DVarSection(sample_data{1}, varName, point(1), false, false, '') + lineMooring2DVarSection(sample_data{setIdx}, varName, point(1), false, false, '') end end @@ -377,7 +377,7 @@ function dataClickCallback(ax, type, point) graphFunc = getGraphFunc(graphType, 'graph', varName); if strcmpi(func2str(graphFunc), 'graphTimeSeriesTimeDepth') - lineMooring2DVarSection(sample_data{1}, varName, point(1), true, false, '') + lineMooring2DVarSection(sample_data{setIdx}, varName, point(1), true, false, '') end end diff --git a/GUI/dataFileStatusDialog.m b/GUI/dataFileStatusDialog.m index 7dd740e74..5e65e6350 100644 --- a/GUI/dataFileStatusDialog.m +++ b/GUI/dataFileStatusDialog.m @@ -86,7 +86,7 @@ % we have to handle the case when InstrumentDepth is not documented instDepths = {deployments.InstrumentDepth}; - instDepths{cellfun(@isempty, instDepths)} = NaN; + instDepths(cellfun(@isempty, instDepths)) = {NaN}; instDepths = cell2mat(instDepths); [~, iSort] = sort(instDepths); diff --git a/GUI/mainWindow.m b/GUI/mainWindow.m index d71ecdd93..6a5c39c3a 100644 --- a/GUI/mainWindow.m +++ b/GUI/mainWindow.m @@ -278,23 +278,23 @@ function mainWindow(... switch mode case 'timeSeries' hToolsCheckPlannedDepths = uimenu(hToolsMenu, 'label', 'Check measured against planned depths'); - hToolsCheckPlannedDepthsNonQC = uimenu(hToolsCheckPlannedDepths, 'label', 'non QC'); - hToolsCheckPlannedDepthsQC = uimenu(hToolsCheckPlannedDepths, 'label', 'QC'); + hToolsCheckPlannedDepthsNonQC = uimenu(hToolsCheckPlannedDepths, 'label', 'all data'); + hToolsCheckPlannedDepthsQC = uimenu(hToolsCheckPlannedDepths, 'label', 'only good and non QC''d data'); hToolsCheckPressDiffs = uimenu(hToolsMenu, 'label', 'Check pressure differences between selected instrument and nearest neighbours'); - hToolsCheckPressDiffsNonQC = uimenu(hToolsCheckPressDiffs, 'label', 'non QC'); - hToolsCheckPressDiffsQC = uimenu(hToolsCheckPressDiffs, 'label', 'QC'); + hToolsCheckPressDiffsNonQC = uimenu(hToolsCheckPressDiffs, 'label', 'all data'); + hToolsCheckPressDiffsQC = uimenu(hToolsCheckPressDiffs, 'label', 'only good and non QC''d data'); hToolsLineDepth = uimenu(hToolsMenu, 'label', 'Line plot mooring''s depths'); - hToolsLineDepthNonQC = uimenu(hToolsLineDepth, 'label', 'non QC'); - hToolsLineDepthQC = uimenu(hToolsLineDepth, 'label', 'QC'); + hToolsLineDepthNonQC = uimenu(hToolsLineDepth, 'label', 'all data'); + hToolsLineDepthQC = uimenu(hToolsLineDepth, 'label', 'only good and non QC''d data'); hToolsLineCommonVar = uimenu(hToolsMenu, 'label', 'Line plot mooring''s 1D variables'); - hToolsLineCommonVarNonQC = uimenu(hToolsLineCommonVar, 'label', 'non QC'); - hToolsLineCommonVarQC = uimenu(hToolsLineCommonVar, 'label', 'QC'); + hToolsLineCommonVarNonQC = uimenu(hToolsLineCommonVar, 'label', 'all data'); + hToolsLineCommonVarQC = uimenu(hToolsLineCommonVar, 'label', 'only good and non QC''d data'); hToolsScatterCommonVar = uimenu(hToolsMenu, 'label', 'Scatter plot mooring''s 1D variables VS depth'); - hToolsScatterCommonVarNonQC = uimenu(hToolsScatterCommonVar, 'label', 'non QC'); - hToolsScatterCommonVarQC = uimenu(hToolsScatterCommonVar, 'label', 'QC'); + hToolsScatterCommonVarNonQC = uimenu(hToolsScatterCommonVar, 'label', 'all data'); + hToolsScatterCommonVarQC = uimenu(hToolsScatterCommonVar, 'label', 'only good and non QC''d data'); hToolsScatter2DCommonVar = uimenu(hToolsMenu, 'label', 'Scatter plot mooring''s 2D variables VS depth'); - hToolsScatter2DCommonVarNonQC = uimenu(hToolsScatter2DCommonVar, 'label', 'non QC'); - hToolsScatter2DCommonVarQC = uimenu(hToolsScatter2DCommonVar, 'label', 'QC'); + hToolsScatter2DCommonVarNonQC = uimenu(hToolsScatter2DCommonVar, 'label', 'all data'); + hToolsScatter2DCommonVarQC = uimenu(hToolsScatter2DCommonVar, 'label', 'only good and non QC''d data'); %set menu callbacks set(hToolsCheckPlannedDepthsNonQC, 'callBack', {@displayCheckPlannedDepths, false}); @@ -311,8 +311,8 @@ function mainWindow(... set(hToolsScatter2DCommonVarQC, 'callBack', {@displayScatterMooringVar, true, false}); case 'profile' hToolsLineCastVar = uimenu(hToolsMenu, 'label', 'Line plot profile variables'); - hToolsLineCastVarNonQC = uimenu(hToolsLineCastVar, 'label', 'non QC'); - hToolsLineCastVarQC = uimenu(hToolsLineCastVar, 'label', 'QC'); + hToolsLineCastVarNonQC = uimenu(hToolsLineCastVar, 'label', 'all data'); + hToolsLineCastVarQC = uimenu(hToolsLineCastVar, 'label', 'only good and non QC''d data'); %set menu callbacks set(hToolsLineCastVarNonQC, 'callBack', {@displayLineCastVar, false}); @@ -587,8 +587,6 @@ function displayLineCastVar(source,ev, isQC) %DISPLAYLINECASTVAR Opens a new window where all the % variables collected by the CTD cast are line-plotted. % - stringQC = 'non QC'; - if isQC; stringQC = 'QC'; end % get all params names lenSampleData = length(sample_data); diff --git a/GUI/startDialog.m b/GUI/startDialog.m index 524955a95..9b17f87c7 100644 --- a/GUI/startDialog.m +++ b/GUI/startDialog.m @@ -75,10 +75,11 @@ % retrieve all field trip IDs; they are displayed as a drop down menu if isCSV - fieldTrips = executeCSVQuery('FieldTrip', [], []); + executeQueryFunc = @executeCSVQuery; else - fieldTrips = executeDDBQuery('FieldTrip', [], []); + executeQueryFunc = @executeDDBQuery; end + fieldTrips = executeQueryFunc('FieldTrip', [], []); if isempty(fieldTrips), error('No field trip entries in DDB'); end diff --git a/GUI/updateViewMetadata.m b/GUI/updateViewMetadata.m index 781216187..f3d3c7961 100644 --- a/GUI/updateViewMetadata.m +++ b/GUI/updateViewMetadata.m @@ -152,7 +152,7 @@ function updateTable(data, prefix, tempType, dateFmt, mode) % make sure numeric values are not rounded (too much) case 'N', - data{i,2} = sprintf('%.10f', data{i,2}); + data{i,2} = sprintf('%.10f ', data{i,2}); % make everything else a string - i'm assuming that when % num2str is passed a string, it will return that string diff --git a/GUI/viewMetadata.m b/GUI/viewMetadata.m index 65ef8f2b5..eb614168b 100644 --- a/GUI/viewMetadata.m +++ b/GUI/viewMetadata.m @@ -206,7 +206,7 @@ function viewMetadata(parent, sample_data, updateCallback, repCallback, mode) % make sure numeric values are not rounded (too much) case 'N', - data{i,2} = sprintf('%.10g', data{i,2}); + data{i,2} = sprintf('%.10g ', data{i,2}); % make everything else a string - i'm assuming that when % num2str is passed a string, it will return that string @@ -435,13 +435,17 @@ function applyUpdate(prefix, templateDir, fieldName, fieldValue, tempType) % numbers are just numbers case 'N' - temp = str2double(fieldValue); + temp = str2num(fieldValue); %#ok str2num used on purpose to deal with arrays % reject anything that is not a number if isempty(temp) error([fieldName ' must be a number']); end + if length(temp) > 1 + fieldValue = ['[' fieldValue ']']; + end + % qc flag is different depending on qc set in use case 'Q' diff --git a/Graph/checkMooringPlannedDepths.m b/Graph/checkMooringPlannedDepths.m index f6f0776da..baa243831 100644 --- a/Graph/checkMooringPlannedDepths.m +++ b/Graph/checkMooringPlannedDepths.m @@ -54,20 +54,26 @@ function checkMooringPlannedDepths(sample_data, isQC, saveToFile, exportDir) if ~islogical(saveToFile), error('saveToFile must be a logical'); end if ~ischar(exportDir), error('exportDir must be a string'); end +monitorRect = getRectMonitor(); +iBigMonitor = getBiggestMonitor(); + varTitle = imosParameters('DEPTH', 'long_name'); varUnit = imosParameters('DEPTH', 'uom'); -stringQC = 'non QC'; -if isQC, stringQC = 'QC'; end +stringQC = 'all'; +if isQC, stringQC = 'only good and non QC''d'; end -%plot depth information -monitorRect = getRectMonitor(); -iBigMonitor = getBiggestMonitor(); +title = [sample_data{1}.deployment_code ' mooring planned vs measured ' stringQC ' ' varTitle]; -title = [sample_data{1}.deployment_code ' mooring planned depth vs measured depth ' stringQC '''d good ' varTitle]; +% retrieve good flag values +qcSet = str2double(readProperty('toolbox.qc_set')); +rawFlag = imosQCFlag('raw', qcSet, 'flag'); +goodFlag = imosQCFlag('good', qcSet, 'flag'); +pGoodFlag = imosQCFlag('probablyGood', qcSet, 'flag'); +goodFlags = [rawFlag, goodFlag, pGoodFlag]; -%extract the essential data and -%sort instruments by depth +% extract the essential data and +% sort instruments by depth lenSampleData = length(sample_data); instrumentDesc = cell(lenSampleData, 1); hLineVar = nan(lenSampleData, 1); @@ -112,8 +118,8 @@ function checkMooringPlannedDepths(sample_data, isQC, saveToFile, exportDir) timeFlags = sample_data{i}.dimensions{iTime}.flags; presFlags = sample_data{i}.variables{iPresRel}.flags; - iGood = (timeFlags == 0 | timeFlags == 1 | timeFlags == 2) ... - & (presFlags == 1 | presFlags == 2); + iGood = ismember(timeFlags, goodFlags) ... + & ismember(presFlags, goodFlags); end if all(~iGood) && isQC diff --git a/Graph/checkMooringPresDiffs.m b/Graph/checkMooringPresDiffs.m index 75ba7b21b..f3c0273c8 100644 --- a/Graph/checkMooringPresDiffs.m +++ b/Graph/checkMooringPresDiffs.m @@ -54,21 +54,27 @@ function checkMooringPresDiffs(sample_data, iSampleMenu, isQC, saveToFile, expor if ~islogical(saveToFile), error('saveToFile must be a logical'); end if ~ischar(exportDir), error('exportDir must be a string'); end +monitorRect = getRectMonitor(); +iBigMonitor = getBiggestMonitor(); + presRelCode = 'PRES_REL'; presCode = 'PRES'; varTitle = imosParameters(presRelCode, 'long_name'); varUnit = imosParameters(presRelCode, 'uom'); -stringQC = 'non QC'; -if isQC, stringQC = 'QC'; end +stringQC = 'all'; +if isQC, stringQC = 'only good and non QC''d'; end -%plot depth information -monitorRect = getRectMonitor(); -iBigMonitor = getBiggestMonitor(); +title = [sample_data{1}.deployment_code ' mooring ' stringQC ' ' varTitle ' differences']; -title = [sample_data{1}.deployment_code ' mooring pressure differences ' stringQC '''d ' varTitle]; +% retrieve good flag values +qcSet = str2double(readProperty('toolbox.qc_set')); +rawFlag = imosQCFlag('raw', qcSet, 'flag'); +goodFlag = imosQCFlag('good', qcSet, 'flag'); +pGoodFlag = imosQCFlag('probablyGood', qcSet, 'flag'); +goodFlags = [rawFlag, goodFlag, pGoodFlag]; -%sort instruments by depth +% sort instruments by depth lenSampleData = length(sample_data); instrumentDesc = cell(lenSampleData, 1); metaDepth = nan(lenSampleData, 1); @@ -186,7 +192,7 @@ function checkMooringPresDiffs(sample_data, iSampleMenu, isQC, saveToFile, expor timeFlags = sample_data{iCurrSam}.dimensions{iCurrTime}.flags; varFlags = sample_data{iCurrSam}.variables{iCurrPresRel}.flags; - iGood = (timeFlags == 0 | timeFlags == 1 | timeFlags == 2) & (varFlags == 1 | varFlags == 2); + iGood = ismember(timeFlags, goodFlags) & ismember(varFlags, goodFlags); end curSamTime(~iGood) = NaN; @@ -235,7 +241,7 @@ function checkMooringPresDiffs(sample_data, iSampleMenu, isQC, saveToFile, expor timeFlags = sample_data{iOthers(i)}.dimensions{iOtherTime}.flags; varFlags = sample_data{iOthers(i)}.variables{iOtherPresRel}.flags; - iGood = (timeFlags == 0 | timeFlags == 1 | timeFlags == 2) & (varFlags == 1 | varFlags == 2); + iGood = ismember(timeFlags, goodFlags) & ismember(varFlags, goodFlags); end if all(~iGood) && isQC diff --git a/Graph/lineCastVar.m b/Graph/lineCastVar.m index c7214f640..9d0cd51a4 100644 --- a/Graph/lineCastVar.m +++ b/Graph/lineCastVar.m @@ -67,9 +67,6 @@ function lineCastVar(sample_data, varNames, isQC, saveToFile, exportDir) title = [sample_data{1}.site_code ' profile on ' datestr(sample_data{1}.time_coverage_start, 'yyyy-mm-dd UTC')]; -lineStyle = {'-', '--', ':', '-.'}; -lenLineStyle = length(lineStyle); - initiateFigure = true; lenVarNames = length(varNames); @@ -169,8 +166,7 @@ function lineCastVar(sample_data, varNames, isQC, saveToFile, exportDir) hLineVar(i + 1) = line(dataVar, ... yLine, ... - 'Color', cMap(i, :), ... - 'LineStyle', lineStyle{mod(i, lenLineStyle)+1}); + 'Color', cMap(i, :)); xLim = get(hAxCastVar, 'XLim'); yLim = get(hAxCastVar, 'YLim'); diff --git a/Graph/lineMooring1DVar.m b/Graph/lineMooring1DVar.m index 18e113bd7..8b3eeeef4 100644 --- a/Graph/lineMooring1DVar.m +++ b/Graph/lineMooring1DVar.m @@ -54,19 +54,25 @@ function lineMooring1DVar(sample_data, varName, isQC, saveToFile, exportDir) if ~islogical(saveToFile), error('saveToFile must be a logical'); end if ~ischar(exportDir), error('exportDir must be a string'); end +monitorRect = getRectMonitor(); +iBigMonitor = getBiggestMonitor(); + varTitle = imosParameters(varName, 'long_name'); varUnit = imosParameters(varName, 'uom'); -stringQC = 'non QC'; -if isQC, stringQC = 'QC'; end +stringQC = 'all'; +if isQC, stringQC = 'only good and non QC''d'; end -%plot depth information -monitorRect = getRectMonitor(); -iBigMonitor = getBiggestMonitor(); +title = [sample_data{1}.deployment_code ' mooring''s instruments ' stringQC ' ' varTitle]; -title = [sample_data{1}.deployment_code ' mooring''s instruments ' stringQC '''d good ' varTitle]; +% retrieve good flag values +qcSet = str2double(readProperty('toolbox.qc_set')); +rawFlag = imosQCFlag('raw', qcSet, 'flag'); +goodFlag = imosQCFlag('good', qcSet, 'flag'); +pGoodFlag = imosQCFlag('probablyGood', qcSet, 'flag'); +goodFlags = [rawFlag, goodFlag, pGoodFlag]; -%sort instruments by depth +% sort instruments by depth lenSampleData = length(sample_data); metaDepth = nan(lenSampleData, 1); xMin = nan(lenSampleData, 1); @@ -90,7 +96,7 @@ function lineMooring1DVar(sample_data, varName, isQC, saveToFile, exportDir) timeFlags = sample_data{i}.dimensions{iTime}.flags; varFlags = sample_data{i}.variables{iVar}.flags; - iGood = (timeFlags == 1 | timeFlags == 2) & (varFlags == 1 | varFlags == 2); + iGood = ismember(timeFlags, goodFlags) & ismember(varFlags, goodFlags); end if iVar @@ -105,9 +111,6 @@ function lineMooring1DVar(sample_data, varName, isQC, saveToFile, exportDir) xMin = min(xMin); xMax = max(xMax); -lineStyle = {'-', '--', ':', '-.'}; -lenLineStyle = length(lineStyle); - instrumentDesc = cell(lenSampleData + 1, 1); hLineVar = nan(lenSampleData + 1, 1); @@ -199,7 +202,7 @@ function lineMooring1DVar(sample_data, varName, isQC, saveToFile, exportDir) timeFlags = sample_data{iSort(i)}.dimensions{iTime}.flags; varFlags = sample_data{iSort(i)}.variables{iVar}.flags; - iGood = (timeFlags == 1 | timeFlags == 2) & (varFlags == 1 | varFlags == 2); + iGood = ismember(timeFlags, goodFlags) & ismember(varFlags, goodFlags); end if all(~iGood) && isQC @@ -217,8 +220,7 @@ function lineMooring1DVar(sample_data, varName, isQC, saveToFile, exportDir) hLineVar(i + 1) = line(xLine, ... dataVar, ... - 'Color', cMap(i, :), ... - 'LineStyle', lineStyle{mod(i, lenLineStyle)+1}); + 'Color', cMap(i, :)); userData.idx = iSort(i); userData.xName = 'TIME'; userData.yName = varName; @@ -346,13 +348,13 @@ function lineMooring1DVar(sample_data, varName, isQC, saveToFile, exportDir) end if strcmp(xName, 'TIME') - xStr = datestr(posClic(1),'yyyy-mm-dd HH:MM:SS.FFF'); + xStr = datestr(posClic(1),'dd-mm-yyyy HH:MM:SS.FFF'); else xStr = [num2str(posClic(1)) ' ' xUnits]; end if strcmp(yName, 'TIME') - yStr = datestr(posClic(2),'yyyy-mm-dd HH:MM:SS.FFF'); + yStr = datestr(posClic(2),'dd-mm-yyyy HH:MM:SS.FFF'); else yStr = [num2str(posClic(2)) ' (' yUnits ')']; %num2str(posClic(2),4) end @@ -365,7 +367,11 @@ function lineMooring1DVar(sample_data, varName, isQC, saveToFile, exportDir) %% function zoomDateTick(obj,event_obj,hAx) - datetick(hAx,'x','dd-mm-yy HH:MM:SS','keeplimits') + xLim = get(hAx, 'XLim'); + currXTicks = get(hAx, 'xtick'); + newXTicks = linspace(xLim(1), xLim(2), length(currXTicks)); + set(hAx, 'xtick', newXTicks); + datetick(hAx,'x','dd-mm-yy HH:MM:SS','keepticks'); end end \ No newline at end of file diff --git a/Graph/lineMooring2DVarSection.m b/Graph/lineMooring2DVarSection.m index f23f2ea52..3db00ce13 100644 --- a/Graph/lineMooring2DVarSection.m +++ b/Graph/lineMooring2DVarSection.m @@ -57,7 +57,6 @@ function lineMooring2DVarSection(sample_data, varName, timeValue, isQC, saveToFi if ~islogical(saveToFile), error('saveToFile must be a logical'); end if ~ischar(exportDir), error('exportDir must be a string'); end -%plot depth information monitorRect = getRectMonitor(); iBigMonitor = getBiggestMonitor(); diff --git a/Graph/pcolorMooring2DVar.m b/Graph/pcolorMooring2DVar.m index 7db9b8fb6..f209ef8c9 100644 --- a/Graph/pcolorMooring2DVar.m +++ b/Graph/pcolorMooring2DVar.m @@ -60,12 +60,18 @@ function pcolorMooring2DVar(sample_data, varName, isQC, saveToFile, exportDir) stringQC = 'non QC'; if isQC, stringQC = 'QC'; end -%plot depth information monitorRect = getRectMonitor(); iBigMonitor = getBiggestMonitor(); title = [sample_data{1}.deployment_code ' mooring''s instruments ' stringQC '''d good ' varTitle]; +% retrieve good flag values +qcSet = str2double(readProperty('toolbox.qc_set')); +rawFlag = imosQCFlag('raw', qcSet, 'flag'); +goodFlag = imosQCFlag('good', qcSet, 'flag'); +pGoodFlag = imosQCFlag('probablyGood', qcSet, 'flag'); +goodFlags = [rawFlag, goodFlag, pGoodFlag]; + %sort instruments by depth lenSampleData = length(sample_data); metaDepth = nan(lenSampleData, 1); @@ -180,11 +186,11 @@ function pcolorMooring2DVar(sample_data, varName, isQC, saveToFile, exportDir) timeFlags = sample_data{iSort(i)}.dimensions{iTime}.flags; varFlags = sample_data{iSort(i)}.variables{iVar}.flags; - iGoodTime = (timeFlags == 1 | timeFlags == 2); + iGoodTime = ismember(timeFlags, goodFlags); nGoodTime = sum(iGoodTime); iGood = repmat(iGoodTime, [1, size(sample_data{iSort(i)}.variables{iVar}.data, 2)]); - iGood = iGood & (varFlags == 1 | varFlags == 2); + iGood = iGood & ismember(varFlags, goodFlags); iGoodHeight = any(iGood, 1); nGoodHeight = sum(iGoodHeight); diff --git a/Graph/scatterMooring1DVarAgainstDepth.m b/Graph/scatterMooring1DVarAgainstDepth.m index 942788369..49dbd4d1f 100644 --- a/Graph/scatterMooring1DVarAgainstDepth.m +++ b/Graph/scatterMooring1DVarAgainstDepth.m @@ -54,21 +54,27 @@ function scatterMooring1DVarAgainstDepth(sample_data, varName, isQC, saveToFile, if ~islogical(saveToFile), error('saveToFile must be a logical'); end if ~ischar(exportDir), error('exportDir must be a string'); end -varTitle = imosParameters(varName, 'long_name'); -varUnit = imosParameters(varName, 'uom'); - if any(strcmpi(varName, {'DEPTH', 'PRES', 'PRES_REL'})), return; end -stringQC = 'non QC'; -if isQC, stringQC = 'QC'; end - -%plot depth information monitorRect = getRectMonitor(); iBigMonitor = getBiggestMonitor(); -title = [sample_data{1}.deployment_code ' mooring''s instruments ' stringQC '''d good ' varTitle]; +varTitle = imosParameters(varName, 'long_name'); +varUnit = imosParameters(varName, 'uom'); + +stringQC = 'all'; +if isQC, stringQC = 'only good and non QC''d'; end + +title = [sample_data{1}.deployment_code ' mooring''s instruments ' stringQC ' ' varTitle]; + +% retrieve good flag values +qcSet = str2double(readProperty('toolbox.qc_set')); +rawFlag = imosQCFlag('raw', qcSet, 'flag'); +goodFlag = imosQCFlag('good', qcSet, 'flag'); +pGoodFlag = imosQCFlag('probablyGood', qcSet, 'flag'); +goodFlags = [rawFlag, goodFlag, pGoodFlag]; -%sort instruments by depth +% sort instruments by depth lenSampleData = length(sample_data); metaDepth = nan(lenSampleData, 1); xMin = nan(lenSampleData, 1); @@ -91,7 +97,7 @@ function scatterMooring1DVarAgainstDepth(sample_data, varName, isQC, saveToFile, timeFlags = sample_data{i}.dimensions{iTime}.flags; varFlags = sample_data{i}.variables{izVar}.flags; - iGood = (timeFlags == 1 | timeFlags == 2) & (varFlags == 1 | varFlags == 2); + iGood = ismember(timeFlags, goodFlags) & ismember(varFlags, goodFlags); end if izVar @@ -134,11 +140,11 @@ function scatterMooring1DVarAgainstDepth(sample_data, varName, isQC, saveToFile, timeFlags = sample_data{iSort(i)}.dimensions{iTime}.flags; varFlags = sample_data{iSort(i)}.variables{izVar}.flags; - iGood = (timeFlags == 1 | timeFlags == 2) & (varFlags == 1 | varFlags == 2); + iGood = ismember(timeFlags, goodFlags) & ismember(varFlags, goodFlags); if iDepth depthFlags = sample_data{iSort(i)}.variables{iDepth}.flags; - iGood = iGood & (depthFlags == 1 | depthFlags == 2); + iGood = iGood & ismember(depthFlags, goodFlags); end end @@ -239,13 +245,13 @@ function scatterMooring1DVarAgainstDepth(sample_data, varName, isQC, saveToFile, varFlags = sample_data{iSort(i)}.variables{izVar}.flags; varValues = sample_data{iSort(i)}.variables{izVar}.data; - iGood = (timeFlags == 1 | timeFlags == 2) & ... - (varFlags == 1 | varFlags == 2) & ... + iGood = ismember(timeFlags, goodFlags) & ... + ismember(varFlags, goodFlags) & ... ~isnan(varValues); if iDepth depthFlags = sample_data{iSort(i)}.variables{iDepth}.flags; - iGoodDepth = (depthFlags == 1 | depthFlags == 2); + iGoodDepth = ismember(depthFlags, goodFlags); end end @@ -471,7 +477,7 @@ function scatterMooring1DVarAgainstDepth(sample_data, varName, isQC, saveToFile, xUnits = sam.variables{ixVar}.units; end if strcmp(xName, 'TIME') - xStr = datestr(posClic(1),'yyyy-mm-dd HH:MM:SS.FFF'); + xStr = datestr(posClic(1),'dd-mm-yyyy HH:MM:SS.FFF'); else xStr = [num2str(posClic(1)) ' ' xUnits]; end @@ -489,7 +495,7 @@ function scatterMooring1DVarAgainstDepth(sample_data, varName, isQC, saveToFile, yUnits = sam.variables{iyVar}.units; end if strcmp(yName, 'TIME') - yStr = datestr(posClic(2),'yyyy-mm-dd HH:MM:SS.FFF'); + yStr = datestr(posClic(2),'dd-mm-yyyy HH:MM:SS.FFF'); else yStr = [num2str(posClic(2)) ' ' yUnits]; %num2str(posClic(2),4) end @@ -512,7 +518,7 @@ function scatterMooring1DVarAgainstDepth(sample_data, varName, isQC, saveToFile, timeData = sam.dimensions{iTime}.data(userData.iGood); idx = find(abs(timeData-posClic(1))