# Path: emva1288/process/routines.py
# SIGNIFICANT_DIGITS = 7
#     L = len(imgs)
#     X = np.asfarray(Xi)
#     Y = np.asfarray(Yi)
#     X = np.asfarray(Xi)
#     Y = np.asfarray(Yi)
#     W = 1
#     Q = q + 1
#         W = int(np.ceil(1. * q / (Qmax - 1)))
#         Q = int(np.floor(1. * q / W)) + 1
#     B = [ymin + (i * W) for i in range(Q + 1)]
#     N = np.ma.count(y)
# def load_image(fname):
# def get_int_imgs(imgs):
# def LinearB0(Xi, Yi):
#     def fp(v, x):
#     def e(v, x, y):
# def LinearB(Xi, Yi):
#     def fp(v, x):
#     def e(v, x, y):
# def GetImgShape(img):
# def FFT1288(img_, rotate=False, n=1):
# def GetFrecs(fft):
# def Histogram1288(img, Qmax):
# def cls_1288_info(cls):
# def _sections_first(dct):
# def obj_to_dict(obj):
# def dict_to_xml(d, root='results', filename=None):
#     def key_to_xml(d, r):
# def xml_to_dict(xml):
#     def element_to_dict(r):
# def round_significant(v, sig=SIGNIFICANT_DIGITS):
# def compare_xml(x1, x2, filename=None):
# def high_pass_filter(img, dim):


import logging
import numpy as np
from emva1288.process import routines
from scipy.ndimage import convolve
    def index_sensitivity_min(self):
        """Sensitivity minimum index.

        Index for linear fits in sensitivity part of the standard
        (70% of saturation)

        .. emva1288::
            :Section: sensitivity
            :Short: Sensitivity fit minimum index
        """
        return self._index_sensitivity_min

    @property
    def R(self):
        """Responsivity.

        Slope of the (u_y - u_y_dark) Vs u_p. Fit with offset = 0
        Uses the :func:`~emva1288.process.routines.LinearB0` function
        to make the fit.

        .. emva1288::
            :Section: sensitivity
            :Short: Responsivity
            :Symbol: R
            :Unit: DN/p
        """

        Y = self.temporal['u_y'] - self.temporal['u_ydark']
        X = self.temporal['u_p']


# Path: emva1288/process/routines.py
# SIGNIFICANT_DIGITS = 7
#     L = len(imgs)
#     X = np.asfarray(Xi)
#     Y = np.asfarray(Yi)
#     X = np.asfarray(Xi)
#     Y = np.asfarray(Yi)
#     W = 1
#     Q = q + 1
#         W = int(np.ceil(1. * q / (Qmax - 1)))
#         Q = int(np.floor(1. * q / W)) + 1
#     B = [ymin + (i * W) for i in range(Q + 1)]
#     N = np.ma.count(y)
# def load_image(fname):
# def get_int_imgs(imgs):
# def LinearB0(Xi, Yi):
#     def fp(v, x):
#     def e(v, x, y):
# def LinearB(Xi, Yi):
#     def fp(v, x):
#     def e(v, x, y):
# def GetImgShape(img):
# def FFT1288(img_, rotate=False, n=1):
# def GetFrecs(fft):
# def Histogram1288(img, Qmax):
# def cls_1288_info(cls):
# def _sections_first(dct):
# def obj_to_dict(obj):
# def dict_to_xml(d, root='results', filename=None):
#     def key_to_xml(d, r):
# def xml_to_dict(xml):
#     def element_to_dict(r):
# def round_significant(v, sig=SIGNIFICANT_DIGITS):
# def compare_xml(x1, x2, filename=None):
# def high_pass_filter(img, dim):


# Path: emva1288/process/results.py
import logging
import numpy as np
from emva1288.process import routines
from scipy.ndimage import convolve

    def index_sensitivity_min(self):
        """Sensitivity minimum index.

        Index for linear fits in sensitivity part of the standard
        (70% of saturation)

        .. emva1288::
            :Section: sensitivity
            :Short: Sensitivity fit minimum index
        """
        return self._index_sensitivity_min

    @property
    def R(self):
        """Responsivity.

        Slope of the (u_y - u_y_dark) Vs u_p. Fit with offset = 0
        Uses the :func:`~emva1288.process.routines.LinearB0` function
        to make the fit.

        .. emva1288::
            :Section: sensitivity
            :Short: Responsivity
            :Symbol: R
            :Unit: DN/p
        """

        Y = self.temporal['u_y'] - self.temporal['u_ydark']
        X = self.temporal['u_p']


        val, _error = routines.LinearB0(X[self.index_sensitivity_min: