Write a function that opens the given spreadsheet of time drift (provided by Sintela) and returns just the pairs of true and warped times for use by other functions.

(* initTime must be run once before trueTime or warpTime are called *)
initTime[timeFile_String]:=Module[{timeDat},
timeDat=Import[timeFile];
timeDat=Drop[timeDat[[1,All,All]],1];
Return[{UnixTime[#[[3]]]+3600 #[[4]]+60 #[[5]]+#[[6]],UnixTime[#[[9]]]+3600 #[[10]]+60 #[[11]]+#[[12]]}&/@timeDat
]; (* end Return *)
] (* end Module *)

The results of initTime must be assigned to a list called dT so it can be used by trueTime and warpTime.

dT=initTime["/Users/mcgill/Documents/My\ Projects/Geo-Sense/Jan\ 2025\ Deployment/MBARI\ Geo-sense\ 1_0\ time\ correction\ Rev0.03.xlsx"];

(* trueTime converts a warped time in UnixTime seconds to a true time *)
trueTime[warpTime_Real]:=Module[{i},
i=Select[dT,#[[2]]>warpTime&->"Index",1]//First;
((warpTime-dT[[i-1,2]])/(dT[[i,2]]-dT[[i-1,2]]))*(dT[[i,1]]-dT[[i-1,1]])+dT[[i-1,1]]
] (* end Module *)

DecimalForm[trueTime[1738048302.5],13]

(* warpTime converts a true time in UnixTime seconds to a warped time *)
warpTime[trueTime_Real]:=Module[{i},
i=Select[dT,#[[1]]>trueTime&->"Index",1]//First;
((trueTime-dT[[i-1,1]])/(dT[[i,1]]-dT[[i-1,1]]))*(dT[[i,2]]-dT[[i-1,2]])+dT[[i-1,2]]
] (* end Module *)

DecimalForm[warpTime["1738048228.882"],13]