xarray.Dataset.dts.calibrate_single_ended

Dataset.dts.calibrate_single_ended(sections, st_var, ast_var, method='wls', solver='sparse', p_val=None, p_var=None, p_cov=None, matching_sections=None, trans_att=[], fix_gamma=None, fix_dalpha=None, fix_alpha=None)

Calibrate the measured data of a single ended setup to temperature.

Calibrate the Stokes (ds.st) and anti-Stokes (ds.ast) data to temperature using fiber sections with a known temperature (ds.sections) for single-ended setups.

The calibrated temperature is stored under ds.tmpf and its variance under ds.tmpf_var.

In single-ended setups, Stokes and anti-Stokes intensity is measured from a single end of the fiber. The differential attenuation is assumed constant along the fiber so that the integrated differential attenuation may be written as (Hausner et al, 2011):

\[\int_0^x{\Delta\alpha(x')\,\mathrm{d}x'} \approx \Delta \alpha x\]

The temperature can now be written from Equation 10 [1] as:

\[T(x,t) \approx \frac{\gamma}{I(x,t) + C(t) + \Delta\alpha x}\]

where

\[I(x,t) = \ln{\left(\frac{P_+(x,t)}{P_-(x,t)}\right)}\]
\[C(t) = \ln{\left(\frac{\eta_-(t)K_-/\lambda_-^4}{\eta_+(t)K_+/\lambda_+^4}\right)}\]

where \(C\) is the lumped effect of the difference in gain at \(x=0\) between Stokes and anti-Stokes intensity measurements and the dependence of the scattering intensity on the wavelength. The parameters \(P_+\) and \(P_-\) are the Stokes and anti-Stokes intensity measurements, respectively. The parameters \(\gamma\), \(C(t)\), and \(\Delta\alpha\) must be estimated from calibration to reference sections, as discussed in Section 5 [1]. The parameter \(C\) must be estimated for each time and is constant along the fiber. \(T\) in the listed equations is in Kelvin, but is converted to Celsius after calibration.

p_valarray-like, optional

Define p_val, p_var, p_cov if you used an external function for calibration. Has size 2 + nt. First value is \(\gamma\), second is \(\Delta \alpha\), others are \(C\) for each timestep.

p_vararray-like, optional

Define p_val, p_var, p_cov if you used an external function for calibration. Has size 2 + nt. First value is \(\gamma\), second is \(\Delta \alpha\), others are \(C\) for each timestep.

p_covarray-like, optional

The covariances of p_val. If set to False, no uncertainty in the parameters is propagated into the confidence intervals. Similar to the spec sheets of the DTS manufacturers. And similar to passing an array filled with zeros.

sectionsDict[str, List[slice]]

Each section requires a reference temperature time series, such as the temperature measured by an external temperature sensor. They should already be part of the DataStore object. sections is defined with a dictionary with its keywords of the names of the reference temperature time series. Its values are lists of slice objects, where each slice object is a fiber stretch that has the reference temperature. Afterwards, sections is stored under ds.sections.

st_var, ast_varfloat, callable, array-like, optional

The variance of the measurement noise of the Stokes signals in the forward direction. If float the variance of the noise from the Stokes detector is described with a single value. If callable the variance of the noise from the Stokes detector is a function of the intensity, as defined in the callable function. Or manually define a variance with a DataArray of the shape ds.st.shape, where the variance can be a function of time and/or x. Required if method is wls.

method{‘wls’,}

Use ‘wls’ for weighted least squares.

solver{‘sparse’, ‘stats’}

Either use the homemade weighted sparse solver or the weighted dense matrix solver of statsmodels. The sparse solver uses much less memory, is faster, and gives the same result as the statsmodels solver. The statsmodels solver is mostly used to check the sparse solver. ‘stats’ is the default.

matching_sectionsList[Tuple[slice, slice, bool]], optional

Provide a list of tuples. A tuple per matching section. Each tuple has three items. The first two items are the slices of the sections that are matched. The third item is a boolean and is True if the two sections have a reverse direction (“J-configuration”).

trans_attiterable, optional

Splices can cause jumps in differential attenuation. Normal single ended calibration assumes these are not present. An additional loss term is added in the ‘shadow’ of the splice. Each location introduces an additional nt parameters to solve for. Requiring either an additional calibration section or matching sections. If multiple locations are defined, the losses are added.

fix_gammaTuple[float, float], optional

A tuple containing two floats. The first float is the value of gamma, and the second item is the variance of the estimate of gamma. Covariances between gamma and other parameters are not accounted for.

fix_dalphaTuple[float, float], optional

A tuple containing two floats. The first float is the value of dalpha (\(\Delta \alpha\) in [1]), and the second item is the variance of the estimate of dalpha. Covariances between alpha and other parameters are not accounted for.

fix_alphaTuple[array-like, array-like], optional

A tuple containing two array-likes. The first array-like is the integrated differential attenuation of length x, and the second item is its variance.

outxarray.Dataset

A Dataset with the calibrated temperature under tmpf and its variance under tmpf_var. The Dataset also contains the calibration parameters under gamma, dalpha, and c. The covariance matrix of the calibration parameters is stored.

dtscalibration/python-dts-calibration/blob/main/examples/notebooks/07Calibrate_single_wls.ipynb>`_