ctdproc.proc.phase_correct
- ctdproc.proc.phase_correct(ds)[source]
Bring temperature and conductivity into phase via FFT-based fit.
Estimates the thermistor time constant
tauand the t/c sensor lagLfor each (temperature, conductivity) pair by fitting an arctan model to the cross-spectral phase, then applies the correction in the frequency domain. Operates over the pressure range stored inds.attrs["tcfit"](seeadd_tcfit_default()). This is the most expensive step inrun_all()and is critical for accurate salinity.- Parameters:
ds (xarray.Dataset) – CTD time series for a single cast (down or up). Required attrs:
tcfit; optionalplot_spectraandplot_pathfor diagnostic output.- Returns:
ds – Time series with
t1,t2,c1,c2replaced by their phase-corrected, low-pass-filtered counterparts.- Return type: