Ejemplo n.º 1
0
 def update_H_loc(self, new_H_loc):
     r"""Update current local models."""
     self.H_loc = new_H_loc
     dec_H_loc = np.array([nf * utils.degradation_op(H_i, shift_ker, self.D)
                           for nf, shift_ker, H_i in
                           zip(self.normfacs,
                               utils.reg_format(self.ker),
                               utils.reg_format(self.H_loc))])
     self.FdH_loc = utils.rca_format(dec_H_loc)
Ejemplo n.º 2
0
 def update_H_glob(self, new_H_glob):
     r"""Update current global model."""
     self.H_glob = new_H_glob
     dec_H_glob = np.array(
         [nf * utils.degradation_op(H_i, shift_ker, self.D)
          for nf, shift_ker, H_i in zip(self.normfacs,
                                        utils.reg_format(self.ker),
                                        utils.reg_format(self.H_glob))])
     self.FdH_glob = utils.rca_format(dec_H_glob)
Ejemplo n.º 3
0
 def update_S(self, new_S, update_spectral_radius=True):
     r"""Update current eigenPSFs."""
     self.S = new_S
     self.FdS = np.array([[nf * utils.degradation_op(S_j, shift_ker, self.D)
                           for nf, shift_ker in
                           zip(self.normfacs, utils.reg_format(self.ker))]
                          for S_j in utils.reg_format(self.S)])
     if update_spectral_radius:
         PowerMethod.get_spec_rad(self)
Ejemplo n.º 4
0
    def MX(self, transf_S):
        r"""Apply degradation operator and renormalize.

        Parameters
        ----------
        transf_S : numpy.ndarray
            Current eigenPSFs in Starlet space.

        Returns
        -------
        numpy.ndarray result

        """
        S = utils.rca_format(
            np.array([filter_convolve(transf_Sj, self.filters, filter_rot=True)
                      for transf_Sj in transf_S]))
        dec_rec = np.array(
            [nf * utils.degradation_op(S.dot(A_i), shift_ker, self.D)
             for nf, A_i, shift_ker in zip(self.normfacs,
                                           self.A.T,
                                           utils.reg_format(self.ker))])
        self._current_rec = utils.rca_format(dec_rec)
        return self._current_rec