Skip to content

Commit

Permalink
Merge pull request #520 from aodn/2.5.40
Browse files Browse the repository at this point in the history
2.5.40
  • Loading branch information
ggalibert authored Oct 23, 2018
2 parents bde9388 + 66fdef9 commit a324086
Show file tree
Hide file tree
Showing 28 changed files with 228 additions and 65 deletions.
4 changes: 2 additions & 2 deletions FlowManager/displayManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ function exportNetCDFCallback()
callbacks.exportNetCDFRequestCallback();

stateSelectCallback('', panel, updateCallback, lastState, ...
sample_data, graphType, setIdx, vars, extraSetIdx);
sample_data, graphType, setIdx, vars, extraSetIdx, isFlagVisible);
state = lastState;
end

Expand All @@ -651,7 +651,7 @@ function exportRawCallback()
callbacks.exportRawRequestCallback();

stateSelectCallback('', panel, updateCallback, lastState, ...
sample_data, graphType, setIdx, vars, extraSetIdx);
sample_data, graphType, setIdx, vars, extraSetIdx, isFlagVisible);
state = lastState;
end
end
Expand Down
17 changes: 10 additions & 7 deletions FlowManager/exportManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,25 @@ function exportManager(dataSets, levelNames, output, auto)
if length(dataSets{k}) ~= numSets, error('data set length mismatch'); end
end

suffix = '';
extension = '';
varOpts = false;
switch (output)
case 'raw', suffix = 'txt';
case 'netcdf'
varOpts = true;
suffix = 'nc';
otherwise, error(['unknown output type: ' output]);
case 'raw'

case 'netcdf'
varOpts = true;
extension = '.nc';

otherwise
error(['unknown output type: ' output]);
end

% get the toolbox execution mode
mode = readProperty('toolbox.mode');

setNames = cell(numSets, 1);
for k = 1:numSets
setNames{k} = genIMOSFileName(dataSets{1}{k}, suffix);
setNames{k} = genIMOSFileName(dataSets{1}{k}, extension);
end

% prompt user for export directory, and data sets to export
Expand Down
26 changes: 13 additions & 13 deletions Graph/TimeSeries/setTimeSerieColorbarContextMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
uimenu(mainItem1, 'Label', 'other', 'Callback', hcb13);

mainItem2 = uimenu(hMenu, 'Label', 'Color range');
uimenu(mainItem2, 'Label', 'full, 0 centred', 'Callback', {@cbCLimRange, 'full, 0 centred', var.data});
uimenu(mainItem2, 'Label', 'auto, 0 centred [0 +/-2*stdDev] (default)', '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, '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});

case {'CDIR', 'SSWD'} % directions
colormap(rkbwr);
Expand Down Expand Up @@ -133,11 +133,11 @@
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', '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] (default)', 'Callback', {@cbCLimRange, 'auto from 0', var.data});
uimenu(mainItem2, 'Label', 'manual', 'Callback', {@cbCLimRange, 'manual', var.data});
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});

case {'SSWV'} % [0; oo[ paremeter with special jet_w colormap
% let's apply a colormap like jet but starting from white
Expand All @@ -162,11 +162,11 @@
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', '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] (default)', 'Callback', {@cbCLimRange, 'auto from 0', var.data});
uimenu(mainItem2, 'Label', 'manual', 'Callback', {@cbCLimRange, 'manual', var.data});
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});

otherwise
colormap(parula);
Expand Down
2 changes: 1 addition & 1 deletion Graph/checkMooringPlannedDepths.m
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function checkMooringPlannedDepths(sample_data, isQC, saveToFile, exportDir)

%now plot all the calculated depths on one plot to choose region for comparison:
%plot
fileName = genIMOSFileName(sample_data{1}, 'png');
fileName = genIMOSFileName(sample_data{1}, '.png');
visible = 'on';
if saveToFile, visible = 'off'; end
hFigPress = figure(...
Expand Down
2 changes: 1 addition & 1 deletion Graph/checkMooringPresDiffs.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function checkMooringPresDiffs(sample_data, iSampleMenu, isQC, saveToFile, expor
backgroundColor = [1 1 1]; % white

%plot
fileName = genIMOSFileName(sample_data{iCurrSam}, 'png');
fileName = genIMOSFileName(sample_data{iCurrSam}, '.png');
visible = 'on';
if saveToFile, visible = 'off'; end
hFigPressDiff = figure(...
Expand Down
2 changes: 1 addition & 1 deletion Graph/diagramMooring1DVarAgainstOther.m
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function diagramMooring1DVarAgainstOther(sample_data, varName, yAxisVarName, isQ

if isPlottable(i)
if initiateFigure
fileName = genIMOSFileName(sample_data{iSort(i)}, 'png');
fileName = genIMOSFileName(sample_data{iSort(i)}, '.png');
visible = 'on';
if saveToFile, visible = 'off'; end
hFigMooringVar = figure(...
Expand Down
2 changes: 1 addition & 1 deletion Graph/diagramMooring2DVarAgainstOther.m
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ function diagramMooring2DVarAgainstOther(sample_data, varName, yAxisVarName, isQ

if isPlottable(i)
if initiateFigure
fileName = genIMOSFileName(sample_data{iSort(i)}, 'png');
fileName = genIMOSFileName(sample_data{iSort(i)}, '.png');
visible = 'on';
if saveToFile, visible = 'off'; end
hFigMooringVar = figure(...
Expand Down
2 changes: 1 addition & 1 deletion Graph/lineCastVar.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function lineCastVar(sample_data, varNames, isQC, saveToFile, exportDir)

if iVar > 0
if initiateFigure
fileName = genIMOSFileName(sample_data{i}, 'png');
fileName = genIMOSFileName(sample_data{i}, '.png');
visible = 'on';
if saveToFile, visible = 'off'; end
hFigCastVar = figure(...
Expand Down
2 changes: 1 addition & 1 deletion Graph/lineMooring1DVar.m
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function lineMooring1DVar(sample_data, varName, isQC, saveToFile, exportDir)
if iVar > 0 && size(sample_data{iSort(i)}.(typeVar){iVar}.data, 2) == 1 && ... % we're only plotting 1D variables but no current
all(~strncmpi(sample_data{iSort(i)}.(typeVar){iVar}.name, {'UCUR', 'VCUR', 'WCUR', 'CDIR', 'CSPD', 'VEL1', 'VEL2', 'VEL3', 'VEL4'}, 4))
if initiateFigure
fileName = genIMOSFileName(sample_data{iSort(i)}, 'png');
fileName = genIMOSFileName(sample_data{iSort(i)}, '.png');
visible = 'on';
if saveToFile, visible = 'off'; end
hFigMooringVar = figure(...
Expand Down
2 changes: 1 addition & 1 deletion Graph/lineMooring2DVarSection.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function lineMooring2DVarSection(sample_data, varName, timeValue, isQC, saveToFi

if iVar > 0
if initiateFigure
fileName = genIMOSFileName(sample_data, 'png');
fileName = genIMOSFileName(sample_data, '.png');
visible = 'on';
if saveToFile, visible = 'off'; end
hFigVarSection = figure(...
Expand Down
2 changes: 1 addition & 1 deletion Graph/pcolorMooring2DVar.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function pcolorMooring2DVar(sample_data, varName, isQC, saveToFile, exportDir)
size(sample_data{iSort(i)}.variables{iVar}.data, 2) > 1 && ...
size(sample_data{iSort(i)}.variables{iVar}.data, 3) == 1 % we're only plotting ADCP 2D variables
if initiateFigure
fileName = genIMOSFileName(sample_data{iSort(i)}, 'png');
fileName = genIMOSFileName(sample_data{iSort(i)}, '.png');
visible = 'on';
if saveToFile, visible = 'off'; end
hFigMooringVar = figure(...
Expand Down
2 changes: 1 addition & 1 deletion Graph/scatterMooring1DVarAgainstDepth.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function scatterMooring1DVarAgainstDepth(sample_data, varName, isQC, saveToFile,

if isPlottable(i)
if initiateFigure
fileName = genIMOSFileName(sample_data{iSort(i)}, 'png');
fileName = genIMOSFileName(sample_data{iSort(i)}, '.png');
visible = 'on';
if saveToFile, visible = 'off'; end
hFigMooringVar = figure(...
Expand Down
2 changes: 1 addition & 1 deletion Graph/scatterMooring2DVarAgainstDepth.m
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ function scatterMooring2DVarAgainstDepth(sample_data, varName, isQC, saveToFile,

if isPlottable(i)
if initiateFigure
fileName = genIMOSFileName(sample_data{iSort(i)}, 'png');
fileName = genIMOSFileName(sample_data{iSort(i)}, '.png');
visible = 'on';
if saveToFile, visible = 'off'; end
hFigMooringVar = figure(...
Expand Down
19 changes: 11 additions & 8 deletions IMOS/genIMOSFileName.m
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
function filename = genIMOSFileName( sample_data, suffix )
function filename = genIMOSFileName( sample_data, extension )
%GENIMOSFILENAME Generates an IMOS file name for the given data set.
%
% Generates a file name for the given data set. The file name is generated
% according to the IMOS NetCDF File Naming Convention, version 1.3. Values
% according to the IMOS NetCDF File Naming Convention, version 1.4. Values
% for each field are retrieved from the imosFileName.txt configuration
% file. Any fields which are not present, or not set in this file are given
% a default value.
%
% Inputs:
% sample_data - the data set to generate a file name for.
% suffix - file name suffix to use.
% extension - file extension to use.
%
% Outputs:
% filename - the generated file name.
Expand Down Expand Up @@ -39,7 +39,7 @@
narginchk(2,2);

if ~isstruct(sample_data), error('sample_data must be a struct'); end
if ~ischar(suffix), error('suffix must be a string'); end
if ~ischar(extension), error('extension must be a string'); end

%
% all dates should be in ISO 8601 format
Expand All @@ -56,7 +56,7 @@
switch mode
case 'profile'
% build the file name
if strcmpi(suffix, 'png')
if strcmpi(extension, '.png')
filename = [sample_data.naming_authority '_'];
filename = [filename getVal(fileCfg, defCfg, 'facility_code') '_'];
filename = [filename getVal(fileCfg, defCfg, 'site_code') '_'];
Expand All @@ -75,7 +75,7 @@
end
case 'timeSeries'
% build the file name
if strcmpi(suffix, 'png')
if strcmpi(extension, '.png')
filename = [sample_data.naming_authority '_'];
filename = [filename getVal(fileCfg, defCfg, 'facility_code') '_'];
filename = [filename getVal(fileCfg, defCfg, 'platform_code') '_'];
Expand Down Expand Up @@ -104,10 +104,13 @@
end

% it is assumed that the suffix is valid
filename = [filename '.' suffix];
if isempty(extension) % for export of raw datasets, we retain the original suffix
[~, ~, extension] = fileparts(sample_data.toolbox_input_file);
end
filename = [filename extension];

% we handle the case when the source file is a NetCDF file.
if isfield(sample_data.meta, 'file_name') && strcmpi(suffix, 'nc')
if isfield(sample_data.meta, 'file_name') && strcmpi(extension, '.nc')
filename = sample_data.meta.file_name;

% we need to update the creation_date
Expand Down
2 changes: 1 addition & 1 deletion NetCDF/exportNetCDF.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
end

% generate the filename
filename = genIMOSFileName(sample_data, 'nc');
filename = genIMOSFileName(sample_data, '.nc');
filename = [dest filesep filename];

compressionLevel = 1; % it seems the compression level 1 gives the best ration size/cpu
Expand Down
21 changes: 17 additions & 4 deletions Parser/aquadoppProfilerParse.m
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@
sample_data.dimensions{1}.seconds_to_middle_of_measurement = user.AvgInterval/2;

% add variables with their dimensions and data mapped.
% we assume no correction for magnetic declination has been applied
if velocityProcessed
% velocity has been processed
iDimVel = nDims-1;
Expand All @@ -302,14 +301,28 @@
iDimVel = nDims;
iDimDiag = nDims;
end
switch user.CoordSystem
case 0 % ENU
vel2Name = 'VCUR_MAG'; % we assume no correction for magnetic declination has been applied
vel1Name = 'UCUR_MAG';
vel3Name = 'WCUR';

case 2 % Beam
vel2Name = 'VEL2';
vel1Name = 'VEL1';
vel3Name = 'VEL3';

otherwise
error([mfilename ' only supports ENU and Beam coordinate systems']);
end
vars = {
'TIMESERIES', [], 1;...
'LATITUDE', [], NaN; ...
'LONGITUDE', [], NaN; ...
'NOMINAL_DEPTH', [], NaN; ...
'VCUR_MAG', [1 iDimVel], velocity2; ... % V
'UCUR_MAG', [1 iDimVel], velocity1; ... % U
'WCUR', [1 iDimVel], velocity3; ...
vel2Name, [1 iDimVel], velocity2; ...
vel1Name, [1 iDimVel], velocity1; ...
vel3Name, [1 iDimVel], velocity3; ...
'ABSIC1', [1 iDimDiag], backscatter1; ...
'ABSIC2', [1 iDimDiag], backscatter2; ...
'ABSIC3', [1 iDimDiag], backscatter3; ...
Expand Down
21 changes: 17 additions & 4 deletions Parser/aquadoppVelocityParse.m
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,28 @@
sample_data.dimensions{1}.seconds_to_middle_of_measurement = user.AvgInterval/2;

% add variables with their dimensions and data mapped.
% we assume no correction for magnetic declination has been applied
switch user.CoordSystem
case 0 % ENU
vel2Name = 'VCUR_MAG'; % we assume no correction for magnetic declination has been applied
vel1Name = 'UCUR_MAG';
vel3Name = 'WCUR';

case 2 % Beam
vel2Name = 'VEL2';
vel1Name = 'VEL1';
vel3Name = 'VEL3';

otherwise
error([mfilename ' only supports ENU and Beam coordinate systems']);
end
vars = {
'TIMESERIES', [], 1;...
'LATITUDE', [], NaN; ...
'LONGITUDE', [], NaN; ...
'NOMINAL_DEPTH', [], NaN; ...
'VCUR_MAG', 1, velocity2; ... % V
'UCUR_MAG', 1, velocity1; ... % U
'WCUR', 1, velocity3; ...
vel2Name, 1, velocity2; ...
vel1Name, 1, velocity1; ...
vel3Name, 1, velocity3; ...
'ABSIC1', 1, backscatter1; ...
'ABSIC2', 1, backscatter2; ...
'ABSIC3', 1, backscatter3; ...
Expand Down
21 changes: 17 additions & 4 deletions Parser/awacParse.m
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@
sample_data.dimensions{1}.seconds_to_middle_of_measurement = user.AvgInterval/2;

% add variables with their dimensions and data mapped.
% we assume no correction for magnetic declination has been applied
if velocityProcessed
% velocity has been processed
iDimVel = nDims-1;
Expand All @@ -270,14 +269,28 @@
iDimVel = nDims;
iDimDiag = nDims;
end
switch user.CoordSystem
case 0 % ENU
vel2Name = 'VCUR_MAG'; % we assume no correction for magnetic declination has been applied
vel1Name = 'UCUR_MAG';
vel3Name = 'WCUR';

case 2 % Beam
vel2Name = 'VEL2';
vel1Name = 'VEL1';
vel3Name = 'VEL3';

otherwise
error([mfilename ' only supports ENU and Beam coordinate systems']);
end
vars = {
'TIMESERIES', [], 1; ...
'LATITUDE', [], NaN; ...
'LONGITUDE', [], NaN; ...
'NOMINAL_DEPTH', [], NaN; ...
'VCUR_MAG', [1 iDimVel], velocity2; ... % V
'UCUR_MAG', [1 iDimVel], velocity1; ... % U
'WCUR', [1 iDimVel], velocity3; ...
vel2Name, [1 iDimVel], velocity2; ...
vel1Name, [1 iDimVel], velocity1; ...
vel3Name, [1 iDimVel], velocity3; ...
'ABSIC1', [1 iDimDiag], backscatter1; ...
'ABSIC2', [1 iDimDiag], backscatter2; ...
'ABSIC3', [1 iDimDiag], backscatter3; ...
Expand Down
Loading

0 comments on commit a324086

Please sign in to comment.