-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Parser): handle non binmapped oceancontour NetCDFs and add OceanC…
…ontour unittests
- Loading branch information
Showing
2 changed files
with
58 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
classdef testOceanContour < matlab.unittest.TestCase | ||
|
||
% Test Reading Nortek Signature files output by OceanContour software | ||
% with the OceanContour | ||
% function. | ||
% | ||
% author: [email protected] | ||
% | ||
% TODO: understand why fillValues for s500 and s1000 are different by a | ||
% factor 10 | ||
|
||
|
||
properties (TestParameter) | ||
mode = {'timeSeries'}; | ||
oceancontour_sig500_file = files2namestruct(rdir([toolboxRootPath 'data/testfiles/netcdf/Nortek/OceanContour/Signature/sig500'])); | ||
oceancontour_sig1000_file = files2namestruct(rdir([toolboxRootPath 'data/testfiles/netcdf/Nortek/OceanContour/Signature/sig1000'])); | ||
end | ||
|
||
methods (Test) | ||
|
||
function testOceanContourSig500(~, oceancontour_sig500_file) | ||
data = OceanContour.readOceanContourFile(oceancontour_sig500_file); | ||
assert(strcmp(data{1}.meta.instrument_model,'Signature500')); | ||
assert(strcmp(data{1}.meta.instrument_make,'Nortek')); | ||
assert(strcmp(data{1}.meta.coordinate_system,'ENU')); | ||
assert(data{1}.meta.beam_angle==25); | ||
assert(round(mean(data{1,1}.variables{1,5}.data)) == 19) % TEMP var check | ||
|
||
tolerance = 0.001; | ||
assert(abs(min(data{1,1}.variables{1,16}.data(:,1)) - -32.7680) < tolerance); % UCUR var check. fillvalue seems to be -32.7680 | ||
end | ||
|
||
function testOceanContourSig1000(~, oceancontour_sig1000_file) | ||
data = OceanContour.readOceanContourFile(oceancontour_sig1000_file); | ||
assert(strcmp(data{1}.meta.instrument_model,'Signature1000')); | ||
assert(strcmp(data{1}.meta.instrument_make,'Nortek')); | ||
assert(strcmp(data{1}.meta.coordinate_system,'ENU')); | ||
assert(data{1}.meta.beam_angle==25); | ||
assert(round(mean(data{1,1}.variables{1,5}.data)) == 20) % temperature var check | ||
|
||
tolerance = 0.001; | ||
assert(abs(min(data{1,1}.variables{1,16}.data(:,1)) - -3.27680) < tolerance); % UCUR var check. fillvalue seems to be -3.27680 | ||
end | ||
end | ||
|
||
end | ||
|