original_docstring: 
          Compute auxiliary functions and output multi-frame absortion and phase results.
          
docstring: Compute auxiliary functions and output multi-frame absortion and phase results.
docstring_tokens: Compute auxiliary functions and output multi - frame absortion and phase results .
code: def solve(self, method="Tikhonov", tv_order=1, tv_max_iter=20):
          '''
          Compute auxiliary functions and output multi-frame absortion and phase results.
          '''
          dpc_result  = []
          AHA         = [(self.Hu.conj()*self.Hu).sum(axis=0)+self.reg_u,            (self.Hu.conj()*self.Hp).sum(axis=0),\
                         (self.Hp.conj()*self.Hu).sum(axis=0)           , (self.Hp.conj()*self.Hp).sum(axis=0)+self.reg_p]
          if method == "Tikhonov":
              determinant = AHA[0]*AHA[3]-AHA[1]*AHA[2]
              for frame_index in range(self.dpc_imgs.shape[0]//self.dpc_num):
                  fIntensity = np.asarray([F(self.dpc_imgs[frame_index*self.dpc_num+image_index]) for image_index in range(self.dpc_num)])
                  dpc_result.append(self.deconvTikhonov(AHA, determinant, fIntensity))
          elif method == "TV":
              fDx = np.zeros(self.dpc_imgs.shape[1:], dtype='complex64')
              fDy = np.zeros(self.dpc_imgs.shape[1:], dtype='complex64')
              if tv_order==1:
                  fDx[0,0] = 1.0; fDx[0,-1] = -1.0; fDx = F(fDx);
                  fDy[0,0] = 1.0; fDy[-1,0] = -1.0; fDy = F(fDy);
              elif tv_order==2:
                  fDx[0,0] = 2.0; fDx[0,-1] = -1.0; fDx[0,1] = -1.0; fDx = F(fDx);
                  fDy[0,0] = 2.0; fDy[-1,0] = -1.0; fDy[1,0] = -1.0; fDy = F(fDy);
              elif tv_order==3:
                  fDx[0,0] = 3.0; fDx[0,-1] = -1.0; fDx[0,1] = -3.0; fDx[0,2] = 1.0; fDx = F(fDx);
                  fDy[0,0] = 3.0; fDy[-1,0] = -1.0; fDy[1,0] = -3.0; fDy[2,0] = 1.0; fDy = F(fDy);
              else:
                  print('TVDeconv does not support order higher than 3!')
                  raise
  
              dpc_result  = []
              regTerm     = self.rho*(fDx*fDx.conj()+fDy*fDy.conj())
              AHA[0]     += regTerm
              AHA[3]     += regTerm
              determinant = AHA[0]*AHA[3]-AHA[1]*AHA[2]
              for frame_index in range(self.dpc_imgs.shape[0]//self.dpc_num):
                  fIntensity = np.asarray([F(self.dpc_imgs[frame_index*self.dpc_num+image_index]) for image_index in range(self.dpc_num)])
                  dpc_result.append(self.deconvTV(AHA,determinant,fIntensity,fDx,fDy,tv_order,tv_max_iter))
              
          return np.asarray(dpc_result)
code_tokens: def solve ( self , method = "Tikhonov" , tv_order = 1 , tv_max_iter = 20 ) : dpc_result = [ ] AHA = [ ( self . Hu . conj ( ) * self . Hu ) . sum ( axis = 0 ) + self . reg_u , ( self . Hu . conj ( ) * self . Hp ) . sum ( axis = 0 ) , ( self . Hp . conj ( ) * self . Hu ) . sum ( axis = 0 ) , ( self . Hp . conj ( ) * self . Hp ) . sum ( axis = 0 ) + self . reg_p ] if method == "Tikhonov" : determinant = AHA [ 0 ] * AHA [ 3 ] - AHA [ 1 ] * AHA [ 2 ] for frame_index in range ( self . dpc_imgs . shape [ 0 ] // self . dpc_num ) : fIntensity = np . asarray ( [ F ( self . dpc_imgs [ frame_index * self . dpc_num + image_index ] ) for image_index in range ( self . dpc_num ) ] ) dpc_result . append ( self . deconvTikhonov ( AHA , determinant , fIntensity ) ) elif method == "TV" : fDx = np . zeros ( self . dpc_imgs . shape [ 1 : ] , dtype = 'complex64' ) fDy = np . zeros ( self . dpc_imgs . shape [ 1 : ] , dtype = 'complex64' ) if tv_order == 1 : fDx [ 0 , 0 ] = 1.0 ; fDx [ 0 , - 1 ] = - 1.0 ; fDx = F ( fDx ) ; fDy [ 0 , 0 ] = 1.0 ; fDy [ - 1 , 0 ] = - 1.0 ; fDy = F ( fDy ) ; elif tv_order == 2 : fDx [ 0 , 0 ] = 2.0 ; fDx [ 0 , - 1 ] = - 1.0 ; fDx [ 0 , 1 ] = - 1.0 ; fDx = F ( fDx ) ; fDy [ 0 , 0 ] = 2.0 ; fDy [ - 1 , 0 ] = - 1.0 ; fDy [ 1 , 0 ] = - 1.0 ; fDy = F ( fDy ) ; elif tv_order == 3 : fDx [ 0 , 0 ] = 3.0 ; fDx [ 0 , - 1 ] = - 1.0 ; fDx [ 0 , 1 ] = - 3.0 ; fDx [ 0 , 2 ] = 1.0 ; fDx = F ( fDx ) ; fDy [ 0 , 0 ] = 3.0 ; fDy [ - 1 , 0 ] = - 1.0 ; fDy [ 1 , 0 ] = - 3.0 ; fDy [ 2 , 0 ] = 1.0 ; fDy = F ( fDy ) ; else : print ( 'TVDeconv does not support order higher than 3!' ) raise dpc_result = [ ] regTerm = self . rho * ( fDx * fDx . conj ( ) + fDy * fDy . conj ( ) ) AHA [ 0 ] += regTerm AHA [ 3 ] += regTerm determinant = AHA [ 0 ] * AHA [ 3 ] - AHA [ 1 ] * AHA [ 2 ] for frame_index in range ( self . dpc_imgs . shape [ 0 ] // self . dpc_num ) : fIntensity = np . asarray ( [ F ( self . dpc_imgs [ frame_index * self . dpc_num + image_index ] ) for image_index in range ( self . dpc_num ) ] ) dpc_result . append ( self . deconvTV ( AHA , determinant , fIntensity , fDx , fDy , tv_order , tv_max_iter ) ) return np . asarray ( dpc_result )
short_docstring: Compute auxiliary functions and output multi-frame absortion and phase results.
short_docstring_tokens: Compute auxiliary functions and output multi - frame absortion and phase results .
comment: '''
          Compute auxiliary functions and output multi-frame absortion and phase results.
          '''