diff --git a/Parser/NXICBinaryParse.m b/Parser/NXICBinaryParse.m index 510d5cd42..05de01fc2 100644 --- a/Parser/NXICBinaryParse.m +++ b/Parser/NXICBinaryParse.m @@ -104,12 +104,30 @@ sample_data.meta.instrument_model = header.instrument_model; sample_data.meta.instrument_serial_no = header.instrument_serial_no; sample_data.meta.featureType = mode; - if header.sampleRate > 0 - sample_data.meta.instrument_sample_interval = 1/header.sampleRate; - else - sample_data.meta.instrument_sample_interval = median(diff(samples.time*24*3600)); + + % Let's find each start of bursts + dt = [0; diff(samples.time)]; + iBurst = [1; find(dt>(1/24/60)); length(samples.time)+1]; + + % let's read data burst by burst + nBurst = length(iBurst)-1; + firstTimeBurst = zeros(nBurst, 1); + sampleIntervalInBurst = zeros(nBurst, 1); + durationBurst = zeros(nBurst, 1); + for i=1:nBurst + timeBurst = samples.time(iBurst(i):iBurst(i+1)-1); + if numel(timeBurst)>1 % deals with the case of a file with a single sample in a single burst + sampleIntervalInBurst(i) = median(diff(timeBurst*24*3600)); + firstTimeBurst(i) = timeBurst(1); + durationBurst(i) = (timeBurst(end) - timeBurst(1))*24*3600 + sampleIntervalInBurst(i); + end end + sample_data.meta.instrument_sample_interval = round(median(sampleIntervalInBurst)); + sample_data.meta.instrument_burst_interval = round(median(diff(firstTimeBurst*24*3600))); + sample_data.meta.instrument_burst_duration = round(median(durationBurst)); + + sample_data.dimensions = {}; sample_data.variables = {}; diff --git a/Parser/readWQMdat.m b/Parser/readWQMdat.m index 532042a6e..d61614bea 100644 --- a/Parser/readWQMdat.m +++ b/Parser/readWQMdat.m @@ -249,7 +249,7 @@ if numel(timeBurst)>1 % deals with the case of a file with a single sample in a single burst sampleIntervalInBurst(i) = median(diff(timeBurst*24*3600)); firstTimeBurst(i) = timeBurst(1); - durationBurst(i) = (timeBurst(end) - timeBurst(1))*24*3600; + durationBurst(i) = (timeBurst(end) - timeBurst(1))*24*3600 + sampleIntervalInBurst(i); end end diff --git a/Parser/readWQMraw.m b/Parser/readWQMraw.m index 0641f6571..b3f93025b 100644 --- a/Parser/readWQMraw.m +++ b/Parser/readWQMraw.m @@ -159,7 +159,7 @@ timeBurst = time(iBurst(i):iBurst(i+1)-1); sampleIntervalInBurst(i) = median(diff(timeBurst*24*3600)); firstTimeBurst(i) = timeBurst(1); - durationBurst(i) = (timeBurst(end) - timeBurst(1))*24*3600; + durationBurst(i) = (timeBurst(end) - timeBurst(1))*24*3600 + sampleIntervalInBurst(i); end sample_data.meta.instrument_sample_interval = round(median(sampleIntervalInBurst)); diff --git a/imosToolbox.m b/imosToolbox.m index 87e129c98..47b747a8e 100644 --- a/imosToolbox.m +++ b/imosToolbox.m @@ -73,7 +73,7 @@ function imosToolbox(auto, varargin) end % Set current toolbox version -toolboxVersion = ['2.5.15 - ' computer]; +toolboxVersion = ['2.5.16 - ' computer]; switch auto case 'auto', autoIMOSToolbox(toolboxVersion, varargin{:}); diff --git a/imosToolbox_Linux64.bin b/imosToolbox_Linux64.bin index 943b6248e..70a242210 100755 Binary files a/imosToolbox_Linux64.bin and b/imosToolbox_Linux64.bin differ diff --git a/imosToolbox_Win32.exe b/imosToolbox_Win32.exe index 96fe9fab4..71ba6e7ee 100644 Binary files a/imosToolbox_Win32.exe and b/imosToolbox_Win32.exe differ diff --git a/imosToolbox_Win64.exe b/imosToolbox_Win64.exe index 4ac2536ee..07b3ef46d 100644 Binary files a/imosToolbox_Win64.exe and b/imosToolbox_Win64.exe differ