Skip to content

Commit

Permalink
Merge pull request #457 from aodn/2.5.29
Browse files Browse the repository at this point in the history
2.5.29
  • Loading branch information
ggalibert authored Jul 12, 2017
2 parents 4efea08 + 7fd08a6 commit 0db75fe
Show file tree
Hide file tree
Showing 23 changed files with 303 additions and 200 deletions.
2 changes: 1 addition & 1 deletion AutomaticQC/imosImpossibleDepthQC.m
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
% possibleMin shouldn't be above the surface (~global range value)
% possibleMax cannot be below the site depth
possibleMin = max(possibleMin, imosParameters('DEPTH', 'valid_min')); % value from global range
possibleMax = min(possibleMax, siteNominalDepth + 20*siteNominalDepth/100); % we allow +20% to the nominal site depth
possibleMax = min(possibleMax, siteNominalDepth + zNominalMargin); % we allow the same flexibility for nominal site depth as for instrument nominal_depth

if any(strcmpi(paramName, {'PRES', 'PRES_REL'}))
if ~isempty(sample_data.geospatial_lat_min) && ~isempty(sample_data.geospatial_lat_max)
Expand Down
7 changes: 4 additions & 3 deletions Graph/DepthProfile/graphDepthProfileGeneric.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [h labels] = graphDepthProfileGeneric( ax, sample_data, var )
function [h, labels] = graphDepthProfileGeneric( ax, sample_data, var )
%GRAPHDEPTHPROFILEGENERIC Plots the given variable (x axis) against depth
% (y axis).
%
Expand Down Expand Up @@ -92,9 +92,10 @@

% for global/regional range display
mWh = findobj('Tag', 'mainWindow');
sMh = findobj('Tag', 'samplePopUpMenu');
iSample = get(sMh, 'Value');
climatologyRange = get(mWh, 'UserData');

iSample = find(arrayfun(@(x) strcmp(x.dataSet, sample_data.toolbox_input_file), climatologyRange));

if ~isempty(climatologyRange)
if isfield(climatologyRange, ['rangeMin' var.name])
xLim = get(ax, 'XLim');
Expand Down
7 changes: 4 additions & 3 deletions Graph/TimeSeries/graphTimeSeriesGeneric.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [h labels] = graphTimeSeriesGeneric( ax, sample_data, var, color, xTickProp )
function [h, labels] = graphTimeSeriesGeneric( ax, sample_data, var, color, xTickProp )
%GRAPHTIMESERIESGENERIC Plots the given variable as normal, single dimensional,
% time series data. If the data are multi-dimensional, multiple lines will be
% plotted and returned.
Expand Down Expand Up @@ -66,9 +66,10 @@

% for global/regional range and in/out water display
mWh = findobj('Tag', 'mainWindow');
sMh = findobj('Tag', 'samplePopUpMenu');
iSample = get(sMh, 'Value');
qcParam = get(mWh, 'UserData');

iSample = find(arrayfun(@(x) strcmp(x.dataSet, sample_data.toolbox_input_file), qcParam));

if ~isempty(qcParam)
if isfield(qcParam, ['rangeMin' var.name])
hold(ax, 'on');
Expand Down
5 changes: 3 additions & 2 deletions Graph/XvY/graphXvYGeneric.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@

% for global/regional range display
mWh = findobj('Tag', 'mainWindow');
sMh = findobj('Tag', 'samplePopUpMenu');
iSample = get(sMh, 'Value');
climatologyRange = get(mWh, 'UserData');

iSample = find(arrayfun(@(x) strcmp(x.dataSet, sample_data.toolbox_input_file), climatologyRange));

if ~isempty(climatologyRange)
if isfield(climatologyRange, ['rangeMin' sample_data.variables{vars(1)}.name])
xLim = get(ax, 'XLim');
Expand Down
9 changes: 7 additions & 2 deletions Graph/graphDepthProfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
depth = sample_data.dimensions{depth};
end

yLimits = [NaN, NaN];
for k = 1:length(vars)

name = sample_data.variables{vars(k)}.name;
Expand Down Expand Up @@ -164,7 +165,11 @@
curData = sample_data.variables{vars(k)}.data;
curDepth = depth.data;
curFlag = sample_data.variables{vars(k)}.flags;
iGood = (curFlag == goodFlag) | (curFlag == pGoodFlag) | (curFlag == rawFlag);

iGood = curDepth >= 0;
if strcmpi(mode, 'timeSeries')
iGood = (curFlag == goodFlag) | (curFlag == pGoodFlag) | (curFlag == rawFlag);
end

[nSamples, nBins] = size(curData);
if strcmpi(mode, 'timeSeries') && nBins > 1
Expand All @@ -173,7 +178,7 @@
curDepth = repmat(curDepth, 1, nBins) - repmat(sample_data.dimensions{iVertDim}.data', nSamples, 1);
end

yLimits = [floor(min(curDepth(iGood))*10)/10, ceil(max(curDepth(iGood))*10)/10];
yLimits = [min(floor(min(curDepth(iGood))*10)/10, yLimits(1)), max(ceil(max(curDepth(iGood))*10)/10, yLimits(2))];
xLimits = [floor(min(curData(iGood))*10)/10, ceil(max(curData(iGood))*10)/10];

%check for my surface soak flags - and set xLimits to flag range
Expand Down
64 changes: 32 additions & 32 deletions IMOS/imosParameters.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion NetCDF/template/global_attributes_profile.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% what
S, project = Integrated Marine Observing System (IMOS)
S, Conventions = CF-1.6,IMOS-1.4
S, standard_name_vocabulary = NetCDF Climate and Forecast (CF) Metadata Convention Standard Name Table 27
S, standard_name_vocabulary = NetCDF Climate and Forecast (CF) Metadata Convention Standard Name Table 45
S, title =
S, institution =
D, date_created = [mat now_utc]
Expand Down
2 changes: 1 addition & 1 deletion NetCDF/template/global_attributes_timeSeries.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% what
S, project = Integrated Marine Observing System (IMOS)
S, Conventions = CF-1.6,IMOS-1.4
S, standard_name_vocabulary = NetCDF Climate and Forecast (CF) Metadata Convention Standard Name Table 27
S, standard_name_vocabulary = NetCDF Climate and Forecast (CF) Metadata Convention Standard Name Table 45
S, title =
S, institution =
D, date_created = [mat now_utc]
Expand Down
2 changes: 1 addition & 1 deletion NetCDF/template/spct_attributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ N, accuracy =
N, precision =
N, resolution =
S, cell_methods =
S, flag_values = 0 1 3 9
S, flag_values = [mat char(uint8([0 1 3 9]))]
S, flag_meanings = Pressure Velocity Acoustic_Surface_Tracking Unknown
2 changes: 1 addition & 1 deletion Parser/awacParse.m
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
'HEADING_MAG', 1, waveData.Heading; ...
'PITCH', 1, waveData.Pitch; ...
'ROLL', 1, waveData.Roll; ...
'SSWV_MAG', [1 3 4], waveData.fullSpectrum; ... % sea_surface_wave_magnetic_directional_variance_spectral_density
'SSWV_MAG', [1 3 4], waveData.fullSpectrum; ... % sea_surface_wave_directional_variance_spectral_density
'SPCT', 1, waveData.SpectraType % awac_spectra_calculation_method
};
clear waveData;
Expand Down
1 change: 1 addition & 0 deletions Parser/convertECOrawVar.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@

case 'CDOM' %ppb
name = 'CDOM';
comment = 'Expressed as equivalent mass fraction (ppb) of quinine sulfate dihydrate.';
data = (sample - columnsInfo.offset)*columnsInfo.scale;
calibration(1).formula = 'value_engineering_units = (counts - calibration_dark_count) x calibration_scale_factor';
calibration(1).dark_count = columnsInfo.offset;
Expand Down
2 changes: 1 addition & 1 deletion Parser/readWQMdat.m
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ case upper('DO(mg/l)') % DOX1_3
cndc = sample_data.variables{cndc};
% conductivity is in S/m and gsw_C3515 in mS/cm
crat = 10*cndc.data ./ gsw_C3515;

psal = struct;
psal.data = gsw_SP_from_R(crat, temp.data, pres.data);
end

Expand Down
36 changes: 18 additions & 18 deletions Parser/workhorseParse.m
Original file line number Diff line number Diff line change
Expand Up @@ -501,26 +501,26 @@
'LATITUDE', [], NaN; ...
'LONGITUDE', [], NaN; ...
'NOMINAL_DEPTH', [], NaN; ...
'WSSH', 1, waveData.param.Hs; ... % sea_surface_wave_spectral_significant_height
'WPPE', 1, waveData.param.Tp; ... % sea_surface_wave_period_at_variance_spectral_density_maximum
['WPDI' magExt], 1, waveData.param.Dp; ... % sea_surface_wave_from_direction_at_variance_spectral_density_maximum
'WWSH', 1, waveData.param.Hs_W; ... % sea_surface_wind_wave_significant_height
'WWPP', 1, waveData.param.Tp_W; ... % sea_surface_peak_wind_sea_wave_period
['WWPD' magExt], 1, waveData.param.Dp_W; ... % sea_surface_peak_wind_sea_wave_from_direction
'SWSH', 1, waveData.param.Hs_S; ... % sea_surface_swell_wave_significant_height
'SWPP', 1, waveData.param.Tp_S; ... % sea_surface_peak_swell_wave_period
['SWPD' magExt], 1, waveData.param.Dp_S; ... % sea_surface_peak_swell_wave_from_direction
'WSSH', 1, waveData.param.Hs; ... % Significant Wave Height Hs = 4 sqrt(M0)
'WPPE', 1, waveData.param.Tp; ... % Peak Wave Period (seconds) - period associated with the largest peak in the power spectrum
['WPDI' magExt], 1, waveData.param.Dp; ... % Peak Wave Direction (degrees) - peak direction at the peak period
'WWSH', 1, waveData.param.Hs_W; ... % Significant Wave Height in the sea region of the power spectrum
'WWPP', 1, waveData.param.Tp_W; ... % Peak Sea Wave Period (seconds) - period associated with the largest peak in the sea region of the power spectrum
['WWPD' magExt], 1, waveData.param.Dp_W; ... % Peak Sea Wave Direction (degrees) - peak sea direction at the peak period in the sea region
'SWSH', 1, waveData.param.Hs_S; ... % Significant Wave Height in the swell region of the power spectrum
'SWPP', 1, waveData.param.Tp_S; ... % Peak Swell Wave Period (seconds) - period associated with the largest peak in the swell region of the power spectrum
['SWPD' magExt], 1, waveData.param.Dp_S; ... % Peak Swell Wave Direction (degrees) - peak swell direction at the peak period in the swell region
% ht is in mm
'DEPTH', 1, waveData.param.ht/1000; ...
'WMXH', 1, waveData.param.Hmax; ... % sea_surface_wave_maximum_height
'WMPP', 1, waveData.param.Tmax; ... % sea_surface_wave_maximum_zero_crossing_period
'WHTH', 1, waveData.param.Hth; ... % sea_surface_wave_significant_height_of_highest_one_third
'WPTH', 1, waveData.param.Tth; ... % sea_surface_wave_period_of_highest_one_third
'WMSH', 1, waveData.param.Hmn; ... % sea_surface_wave_zero_crossing_mean_height
'WPMH', 1, waveData.param.Tmn; ... % sea_surface_wave_zero_crossing_period
'WHTE', 1, waveData.param.Hte; ... % sea_surface_wave_significant_height_of_highest_one_tenth
'WPTE', 1, waveData.param.Tte; ... % sea_surface_wave_period_of_highest_one_tenth
['VDIR' magExt], 1, waveData.param.Dmn; ... % sea_surface_wave_from_direction
'WMXH', 1, waveData.param.Hmax; ... % Maximum wave height (meters) as determined by Zero-Crossing analysis of the surface track time series
'WMPP', 1, waveData.param.Tmax; ... % Maximum Peak Wave Period (seconds) as determined by Zero-Crossing analysis of the surface track time series
'WHTH', 1, waveData.param.Hth; ... % Significant wave height of the largest 1/3 of the waves in the field as determined by Zero-Crossing analysis of the surface track time series
'WPTH', 1, waveData.param.Tth; ... % The period associated with the peak wave height of the largest 1/3 of the waves in the field as determined by Zero-Crossing analysis of the surface track time series
'WMSH', 1, waveData.param.Hmn; ... % The mean significant wave height of the waves in the field as determined by Zero-Crossing analysis of the surface track time series
'WPMH', 1, waveData.param.Tmn; ... % The period associated with the mean significant wave height of the waves in the field as determined by Zero-Crossing analysis of the surface track time series
'WHTE', 1, waveData.param.Hte; ... % Significant wave height of the largest 1/10 of the waves in the field as determined by Zero-Crossing analysis of the surface track time series
'WPTE', 1, waveData.param.Tte; ... % The period associated with the peak wave height of the largest 1/10 of the waves in the field as determined by Zero-Crossing analysis of the surface track time series
['VDIR' magExt], 1, waveData.param.Dmn; ... % Mean Peak Wave Direction
% Vspec is in mm/sqrt(Hz)
'VDEV', [1 2], (waveData.Vspec.data/1000).^2; ... % sea_surface_wave_variance_spectral_density_from_velocity
'VDEP', [1 2], (waveData.Pspec.data/1000).^2; ... % sea_surface_wave_variance_spectral_density_from_pressure
Expand Down
20 changes: 17 additions & 3 deletions Preprocessing/depthPP.m
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@
'NumberTitle', 'off');

cancelButton = uicontrol('Style', 'pushbutton', 'String', 'Cancel');
resetParamsButton = uicontrol('Style', 'pushbutton', 'String', 'Reset parameters, restart from depthPP.txt');
resetMappingButton = uicontrol('Style', 'pushbutton', 'String', 'Reset to current default mapping');
resetParamsButton = uicontrol('Style', 'pushbutton', 'String', 'Reset to default mapping (delete last saved)');
resetMappingButton = uicontrol('Style', 'pushbutton', 'String', 'Reset to last performed mapping (saved) if any');
confirmButton = uicontrol('Style', 'pushbutton', 'String', 'Ok');

descSamUic = nan(nDatasets, 1);
Expand Down Expand Up @@ -907,10 +907,24 @@ function resetParamsCallback(source,ev)
%RESETPARAMSCALLBACK Reset dataset specific parameters re-start
%from depthPP.txt parameters
%
fieldsToBeDeleted = {'same_family', 'include', 'exclude', ...
'useItsOwnDepth', 'useItsOwnPres', 'useItsOwnPresRel', ...
'firstNearestInst', 'secondNearestInst'};
for j = 1:nDatasets
ppp = struct([]);
pppFile = [sample_data{j}.toolbox_input_file '.ppp'];
if exist(pppFile, 'file')
delete(pppFile);
load(pppFile, '-mat', 'ppp')
end
if ~isempty(ppp)
if isfield(ppp, currentPProutine)
for l = 1:length(fieldsToBeDeleted)
if isfield(ppp.(currentPProutine), fieldsToBeDeleted{l})
ppp.(currentPProutine) = rmfield(ppp.(currentPProutine), fieldsToBeDeleted{l});
end
end
end
save(pppFile, 'ppp');
end
end
reset = true;
Expand Down
6 changes: 3 additions & 3 deletions Preprocessing/magneticDeclinationPP.m
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@
% we make sure values fall within [0; 360[
data = make0To360(data);

case 'VCUR_MAG' % magnetic_northward_sea_water_velocity (m s-1)
case 'VCUR_MAG' % northward_sea_water_velocity (m s-1) referenced to magnetic north
data = vcur_mag*cos(geomagDeclin(i) * pi/180) - ucur_mag*sin(geomagDeclin(i) * pi/180);

case 'UCUR_MAG' % magnetic_eastward_sea_water_velocity (m s-1)
case 'UCUR_MAG' % eastward_sea_water_velocity (m s-1) referenced to magnetic north
data = vcur_mag*sin(geomagDeclin(i) * pi/180) + ucur_mag*cos(geomagDeclin(i) * pi/180);

case 'SSWV_MAG' % sea_surface_wave_magnetic_directional_variance_spectral_density (m2 s deg-1)
case 'SSWV_MAG' % sea_surface_wave_directional_variance_spectral_density (m2 s deg-1) referenced to magnetic north
% data stays "the same" but we modify the dimension
% from DIR_MAG to DIR
iDim = sample_data{iMagDataSet(i)}.variables{j}.dimensions(end);
Expand Down
Loading

0 comments on commit 0db75fe

Please sign in to comment.