aodn / imos-toolbox

Graphical tool for QC'ing and NetCDF'ing oceanographic datasets
GNU General Public License v3.0
45 stars 30 forks source link

OceanContour parser handling of instrument orientation #799

Open sspagnol opened 10 months ago

sspagnol commented 10 months ago

From what I can tell the OceanContour parser doesn't handle the orientation of the instrument (as in setting distance variable correctly). A quick hack to see if it could be done was by

In function get_varmap

varmap.('status') = 'Status';

And in function readOceanContourFile

status_data = get_var('status');
adcpOrientations = arrayfun(@(x) bin2dec(num2str(bitget(x, 28:-1:26, 'uint32'))), status_data);
adcpOrientation = mode(adcpOrientations); % hopefully the most frequent value reflects the orientation when deployed
% we assume adcpOrientation == 4 by default "ZUP"
meta.adcp_orientation = 'ZUP';
adcp_orientation_conversion = 1;
if adcpOrientation == 5
    meta.adcp_orientation = 'ZDOWN';
    adcp_orientation_conversion = -1;
end

dimensions{1}.data = time;
dimensions{1}.comment = 'time imported from matlabTimeStamp variable';
dimensions{2}.data = z * adcp_orientation_conversion ;
dimensions{2}.comment = 'height imported from VelocityENU_Range';

To note

Just wondering are we the only people deploying downward facing Nortek Signatures and no one else has this issue?