function [ahrs] = load_radar_ahrs(hdf_file)
%LOAD_RADAR_AHRS load data from a WEC radar HDF5 format datafile.
%   Call this function with a path to an HDF5 file for import.

altitude = h5read(hdf_file, '/ahrs/altitude' );
ahrs = table(altitude);

ahrs.dVelocity = h5read(hdf_file, '/ahrs/dVelocity' );
ahrs.eVelocity = h5read(hdf_file, '/ahrs/eVelocity' );
ahrs.latitude = h5read(hdf_file, '/ahrs/latitude' );
ahrs.longitude = h5read(hdf_file, '/ahrs/longitude' );
ahrs.nVelocity = h5read(hdf_file, '/ahrs/nVelocity' );
ahrs.packet_time = h5read(hdf_file, '/ahrs/packet_time' );
ahrs.pitchAngle = h5read(hdf_file, '/ahrs/pitchAngle' );
ahrs.rollAngle = h5read(hdf_file, '/ahrs/rollAngle' );
ahrs.timestamp = h5read(hdf_file, '/ahrs/timestamp' );
ahrs.xAccel = h5read(hdf_file, '/ahrs/xAccel' );
ahrs.xRateCorrected = h5read(hdf_file, '/ahrs/xRateCorrected' );
ahrs.xRateTemp = h5read(hdf_file, '/ahrs/xRateTemp' );
ahrs.yAccel = h5read(hdf_file, '/ahrs/yAccel' );
ahrs.yRateCorrected = h5read(hdf_file, '/ahrs/yRateCorrected' );
ahrs.yawAngleTrue = h5read(hdf_file, '/ahrs/yawAngleTrue' );
ahrs.zAccel = h5read(hdf_file, '/ahrs/zAccel' );
ahrs.zRateCorrected = h5read(hdf_file, '/ahrs/zRateCorrected' );
% Let's convert the timestamp into something more plottable.
ahrs.dt = datetime(ahrs.timestamp, 'ConvertFrom','epochtime');

end