Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pgmatlab/loadPamguardBinaryFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@
case 'GPL Detections'
fileInfo.readModuleData = @readGPLDetections;
fileInfo.readBackgroundData = @readSpectralBackground;
case 'GPL State'
fileInfo.readModuleData = @readGPLStateData;
end
% Right Whale Edge Detector Module
case 'RW Edge Detector'
Expand Down
27 changes: 27 additions & 0 deletions pgmatlab/readGPLStateData.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
function [data, error] = readGPLStateData(fid, fileInfo, data)
% reads trigger level binary data stored by the Click Detector.
%
% Inputs:
% fid = file identifier
% fileInfo = structure holding the file header, module header, a handle
% data = a structure containing the standard data
%
% Output:
% data = structure containing data from a single object
%

% initialize variables
error=false;
nChan = countChannels(data.channelMap);
try
dataLength = fread(fid, 1, 'int32');
data.baseline = fread(fid, 1, 'float32');
data.ceilNoise = fread(fid,1, 'float32');
data.threshFloor = fread(fid,1, 'float32');
data.peakState = fread(fid,1,'int16');
catch mError
disp(['Error reading ' fileInfo.fileHeader.moduleType ' data object. Data read:']);
disp(data);
disp(getReport(mError));
error=true;
end