dtscalibration.variance_stokes.variance_stokes_exponential

dtscalibration.variance_stokes.variance_stokes_exponential(st, sections, acquisitiontime, use_statsmodels=False, suppress_info=True, reshape_residuals=True)[source]

Approximate the variance of the noise in Stokes intensity measurements with one value, suitable for small setups with measurements from only a few times.

  • variance_stokes_constant() for small setups with small variations in intensity. Variance of the Stokes measurements is assumed to be the same along the entire fiber.

  • variance_stokes_exponential() for small setups with very few time steps. Too many degrees of freedom results in an under estimation of the noise variance. Almost never the case, but use when calibrating pre time step.

  • variance_stokes_linear() for larger setups with more time steps. Assumes Poisson distributed noise with the following model:

        st_var = a * ds.st + b
    
    
    where `a` and `b` are constants. Requires reference sections at
    beginning and end of the fiber, to have residuals at high and low
    intensity measurements.
    

The Stokes and anti-Stokes intensities are measured with detectors, which inherently introduce noise to the measurements. Knowledge of the distribution of the measurement noise is needed for a calibration with weighted observations (Sections 5 and 6 of [1]_) and to project the associated uncertainty to the temperature confidence intervals (Section 7 of [1]_). Two sources dominate the noise in the Stokes and anti-Stokes intensity measurements (Hartog, 2017, p.125). Close to the laser, noise from the conversion of backscatter to electricity dominates the measurement noise. The detecting component, an avalanche photodiode, produces Poisson- distributed noise with a variance that increases linearly with the intensity. The Stokes and anti-Stokes intensities are commonly much larger than the standard deviation of the noise, so that the Poisson distribution can be approximated with a Normal distribution with a mean of zero and a variance that increases linearly with the intensity. At the far-end of the fiber, noise from the electrical circuit dominates the measurement noise. It produces Normal-distributed noise with a mean of zero and a variance that is independent of the intensity.

Calculates the variance between the measurements and a best fit at each reference section. This fits a function to the nt * nx measurements with ns * nt + nx parameters, where nx are the total number of reference locations along all sections. The temperature is constant along the reference sections. This fits a two-parameter exponential to the stokes measurements. The temperature is constant and there are no splices/sharp bends in each reference section. Therefore all signal decrease is due to differential attenuation, which is the same for each reference section. The scale of the exponential does differ per reference section.

Assumptions: 1) the temperature is the same along a reference section. 2) no sharp bends and splices in the reference sections. 3) Same type of optical cable in each reference section.

Idea from discussion at page 127 in Richter, P. H. (1995). Estimating errors in least-squares fitting. For weights used error propagation: w^2 = 1/sigma(lny)^2 = y^2/sigma(y)^2 = y^2

The timeseries and the constant are, of course, highly correlated (Equations 20 and 21 in [1]_), but that is not relevant here as only the product is of interest. The residuals between the fitted product and the Stokes intensity measurements are attributed to the noise from the detector. The variance of the residuals is used as a proxy for the variance of the noise in the Stokes and anti-Stokes intensity measurements. A non-uniform temperature of the reference sections results in an over estimation of the noise variance estimate because all temperature variation is attributed to the noise.

Parameters:
  • suppress_info (bool, optional) – Suppress print statements.

  • use_statsmodels (bool, optional) – Use statsmodels to fit the exponential. If False, use scipy.

  • reshape_residuals (bool, optional) – Reshape the residuals to the shape of the Stokes intensity

  • st_label (str) – label of the Stokes, anti-Stokes measurement. E.g., st, ast, rst, rast

  • sections (Dict[str, List[slice]], optional) – If None is supplied, ds.sections is used. Define calibration sections. 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.

  • Returns

  • ——–

  • I_var (float) – Variance of the residuals between measured and best fit

  • resid (array_like) – Residuals between measured and best fit

  • Notes

  • ——

  • * Because there are a large number of unknowns, spend time on calculating an initial estimate. Can be turned off by setting to False.

  • * It is often not needed to use measurements from all time steps. If your variance estimate does not change when including measurements from more time steps, you have included enough measurements.

  • References

  • ———–

  • .. [1] des Tombe, B., Schilperoort, B., & Bakker, M. (2020). Estimation – of Temperature and Associated Uncertainty from Fiber-Optic Raman- Spectrum Distributed Temperature Sensing. Sensors, 20(8), 2235. https://doi.org/10.3390/s20082235

  • Examples

  • ———

  • - `Example notebook 4: Calculate variance Stokes intensity measurements <https://github.com/ dtscalibration/python-dts-calibration/blob/main/examples/notebooks/ 04Calculate_variance_Stokes.ipynb>`_