function dTable = calcMetrics(dTable, k2DataTable)
dTable.dateTime = datetime(dTable.lvDateTime, 'ConvertFrom', 'datenum');

%plot all data
maxTemp = 25;
colorBarMultiplier = 10;
colorMapSize = maxTemp * colorBarMultiplier;
colormap(jet(colorMapSize));
cmap = colormap;

x = dTable.dateTime';
y = dTable.Pressure_dBar' ;
z = k2DataTable.Vrs_Vc_k2T';

%colorIndex = cast((colorBarMultiplier * dTable.Thermistor_Temp), "uint64");
colorIndex = int32(colorBarMultiplier * dTable.Thermistor_Temp);

plot3(x, y, z, 'Color', [.75 .75 .71]);
hold on
scatter3(x, y, z, 5, cmap(colorIndex,:), 'filled');

zLimitIncr = 0.002;
set(gca, 'ydir', 'reverse');
zLimits = zlim;
set(gca, 'ztick', [zLimits(1):zLimitIncr:zLimits(2)]);
view(3);
datetick('x', 'mmmdd HH:MM');
grid on
tickLocations = [0, 0.2, 0.4, 0.6, 0.8, 1.0];
for i=1:length(tickLocations)
    tickLabels(i,:) = num2str((maxTemp * tickLocations(i)), '%2.0f')
end
%colorbar('Ticks', tickLocations, 'TickLabels', {'0 degC', num2str(maxTemp)});
colorbar('Ticks', tickLocations, 'TickLabels', tickLabels);
%title(" All Data From File " + i + ": " + csvFileName, 'Interpreter', 'none')
xlabel('Date Time')
ylabel('Pressure (dBar)')
zlabel('Vrs - Vc - k2T (volts)')
view(3)
