function [radiation, fluorescence] = digitiser(file)
% function [radiation, fluorescence] = digitiser(file)
% digitiser returns the radiation and fluorescence vectors from a
% CSIRO Franklin group netcdf file.
%      INPUT
% file: a string giving the name of the netcdf file but without the
%       extent, e.g., 's95019075'
%      OUTPUT
% radiation: a vector of radiation observations with missing values
%            replaced by NaNs
% fluorescence: a vector of fluorescence observations with missing
%               values replaced by NaNs

%     Copyright J. V. Mansbridge, CSIRO, Fri Aug 11 13:07:11 EST 1995

[cdfid, rcode] = mexcdf('OPEN', [file '.cdf'], 'NC_NOWRITE');
[rcode] = mexcdf('setopts', 0);
[values, rcode] = mexcdf('ncvarget', cdfid, 'digitiser_channels', ...
    [0 0], [-1 -1]);
ff = find(values < -905);
values(ff) = NaN*ones(size(ff));
radiation = values(:, 1);
fluorescence = values(:, 2);
