xarray.Dataset.dts.average_monte_carlo_double_ended

Dataset.dts.average_monte_carlo_double_ended(result, st_var, ast_var, rst_var, rast_var, conf_ints=None, mc_sample_size=100, ci_avg_time_flag1=False, ci_avg_time_flag2=False, ci_avg_time_sel=None, ci_avg_time_isel=None, ci_avg_x_flag1=False, ci_avg_x_flag2=False, ci_avg_x_sel=None, ci_avg_x_isel=None, da_random_state=None, mc_remove_set_flag=True, reduce_memory_usage=False, **kwargs)

Average temperatures from double-ended setups.

Four types of averaging are implemented. Please see Example Notebook 16.

Parameters:
  • result (xr.Dataset) – The result from the calibrate_double_ended() method.

  • st_var, ast_var, rst_var, rast_var (float, callable, array-like) – 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.

  • conf_ints (iterable object of float) – A list with the confidence boundaries that are calculated. Valid values are between [0, 1].

  • mc_sample_size (int) – Size of the monte carlo parameter set used to calculate the confidence interval

  • ci_avg_time_flag1 (bool) – The confidence intervals differ each time step. Assumes the temperature varies during the measurement period. Computes the arithmic temporal mean. If you would like to know the confidence interfal of: (1) a single additional measurement. So you can state “if another measurement were to be taken, it would have this ci” (2) all measurements. So you can state “The temperature remained during the entire measurement period between these ci bounds”. Adds “tmpw” + ‘_avg1’ and “tmpw” + ‘_mc_avg1_var’ to the DataStore. If conf_ints are set, also the confidence intervals _mc_avg1 are added to the DataStore. Works independently of the ci_avg_time_flag2 and ci_avg_x_flag.

  • ci_avg_time_flag2 (bool) – The confidence intervals differ each time step. Assumes the temperature remains constant during the measurement period. Computes the inverse-variance-weighted-temporal-mean temperature and its uncertainty. If you would like to know the confidence interfal of: (1) I want to estimate a background temperature with confidence intervals. I hereby assume the temperature does not change over time and average all measurements to get a better estimate of the background temperature. Adds “tmpw” + ‘_avg2’ and “tmpw” + ‘_mc_avg2_var’ to the DataStore. If conf_ints are set, also the confidence intervals _mc_avg2 are added to the DataStore. Works independently of the ci_avg_time_flag1 and ci_avg_x_flag.

  • ci_avg_time_sel (slice) – Compute ci_avg_time_flag1 and ci_avg_time_flag2 using only a selection of the data

  • ci_avg_time_isel (iterable of int) – Compute ci_avg_time_flag1 and ci_avg_time_flag2 using only a selection of the data

  • ci_avg_x_flag1 (bool) – The confidence intervals differ at each location. Assumes the temperature varies over x and over time. Computes the arithmic spatial mean. If you would like to know the confidence interfal of: (1) a single additional measurement location. So you can state “if another measurement location were to be taken, it would have this ci” (2) all measurement locations. So you can state “The temperature along the fiber remained between these ci bounds”. Adds “tmpw” + ‘_avgx1’ and “tmpw” + ‘_mc_avgx1_var’ to the DataStore. If conf_ints are set, also the confidence intervals _mc_avgx1 are added to the DataStore. Works independently of the ci_avg_time_flag1, ci_avg_time_flag2 and ci_avg_x2_flag.

  • ci_avg_x_flag2 (bool) – The confidence intervals differ at each location. Assumes the temperature is the same at each location but varies over time. Computes the inverse-variance-weighted-spatial-mean temperature and its uncertainty. If you would like to know the confidence interfal of: (1) I have put a lot of fiber in water, and I know that the temperature variation in the water is much smaller than along other parts of the fiber. And I would like to average the measurements from multiple locations to improve the estimated temperature. Adds “tmpw” + ‘_avg2’ and “tmpw” + ‘_mc_avg2_var’ to the DataStore. If conf_ints are set, also the confidence intervals _mc_avg2 are added to the DataStore. Works independently of the ci_avg_time_flag1 and ci_avg_x_flag.

  • ci_avg_x_sel (slice) – Compute ci_avg_time_flag1 and ci_avg_time_flag2 using only a selection of the data

  • ci_avg_x_isel (iterable of int) – Compute ci_avg_time_flag1 and ci_avg_time_flag2 using only a selection of the data

  • da_random_state – For testing purposes. Similar to random seed. The seed for dask. Makes random not so random. To produce reproducable results for testing environments.

  • mc_remove_set_flag (bool) – Remove the monte carlo data set, from which the CI and the variance are calculated.

  • reduce_memory_usage (bool) – Use less memory but at the expense of longer computation time

  • Returns

  • ——–

  • dict