예제 #1
0
    def __call__(self, data):

        if data.X.shape[1] > 0:
            # --- compute K
            energies = np.sort(getx(data))  # input data can be in any order
            start_idx, end_idx = extra_exafs.get_idx_bounds(
                energies, self.edge, self.extra_from, self.extra_to)
            k_interp, k_points = extra_exafs.get_K_points(
                energies, self.edge, start_idx, end_idx)
            # ----------

            common = _ExtractEXAFSCommon(self.edge, self.extra_from,
                                         self.extra_to, self.poly_deg,
                                         self.kweight, self.m, k_interp,
                                         data.domain)

            newattrs = [
                ContinuousVariable(name=str(var),
                                   compute_value=ExtractEXAFSFeature(
                                       i, common))
                for i, var in enumerate(k_interp)
            ]
        else:
            newattrs = []

        domain = Orange.data.Domain(newattrs, data.domain.class_vars,
                                    data.domain.metas)
        return data.transform(domain)
예제 #2
0
    def __call__(self, data):

        if data.X.shape[1] > 0:
            # --- compute K
            energies = np.sort(getx(data))  # input data can be in any order
            start_idx, end_idx = extra_exafs.get_idx_bounds(energies, self.edge,
                                                            self.extra_from, self.extra_to)
            k_interp, k_points = extra_exafs.get_K_points(energies, self.edge,
                                                          start_idx, end_idx)
            # ----------

            common = _ExtractEXAFSCommon(self.edge, self.extra_from, self.extra_to,
                                         self.poly_deg, self.kweight, self.m, k_interp,
                                         data.domain)

            newattrs = [ContinuousVariable(name=str(var),
                                           compute_value=ExtractEXAFSFeature(i, common))
                        for i, var in enumerate(k_interp)]
        else:
            newattrs = []

        domain = Orange.data.Domain(newattrs, data.domain.class_vars, data.domain.metas)
        return data.transform(domain)