Esempio n. 1
0
    def __call__(self, siplesolver, it, x, Fx, y, d, r, *args):
        """Callback from `siple`.  Gathers together the long list of arguments
        into a dictionary and passes it along in a standard form to the python listener."""
        data = Bunch(zeta=x.core(), u=Fx.core(), zeta_step=d.core(), residual=r.core(), target_misfit=self.owner.target_misfit)

        if self.owner.method == 'ign':
            data.update(T_zeta_step=args[0].core())
        else:
            data.update(TStar_residual=args[0].core())
        try:
            self.listener(self.owner, it, data)
        except Exception:
            logError("\nERROR: Exception occured during an inverse solver listener callback:\n\n")
            traceback.print_exc(file=sys.stdout)
            raise
Esempio n. 2
0
 def __call__(self, siplesolver, it, zeta, u, u_obs, r):
     """Callback from `siple`.  Gathers together the long list of arguments
     into a dictionary and passes it along in a standard form to the python listener."""
     data = Bunch(zeta=zeta.core(), u=u.core(), r=r.core(), u_obs=u_obs.core())
     try:
         self.listener(self.owner, it, data)
     except Exception as e:
         logError("\nWARNING: Exception occured during an inverse solver DesignUpdate listener callback:\n%s\n\n" % str(e))
Esempio n. 3
0
    def __call__(self, siplesolver, it, x, y, d, r, Td, TStarR):
        """Callback from `siple`.  Gathers together the long list of arguments
        into a dictionary and passes it along in a standard form to the python listener."""

        data = Bunch(x=x.core(), y=y.core(), r=r.core(), d=d.core(), Td=Td.core(), TSTarR=TStarR.core())
        try:
            self.listener(self.owner, it, data)
        except Exception:
            logError("\nERROR: Exception occured during an inverse solver listener callback:\n\n")
            traceback.print_exc(file=sys.stdout)
            raise
Esempio n. 4
0
 def iteration(self, problem, eta, it, objVal, penaltyVal, d, diff_d, grad_d, u, diff_u, grad_u, grad):
     """Called during IP_SSATaucTaoTikhonovProblem iterations.  Gathers together the long list of arguments
     into a dictionary and passes it along in a standard form to the python listener."""
     data = Bunch(tikhonov_penalty=eta, JDesign=objVal, JState=penaltyVal,
                  zeta=d, zeta_step=diff_d, grad_JDesign=grad_d,
                  u=u, residual=diff_u, grad_JState=grad_u, grad_JTikhonov=grad)
     try:
         self.listener(self.owner, it, data)
     except Exception:
         logError("\nERROR: Exception occured during an inverse solver listener callback:\n\n")
         traceback.print_exc(file=sys.stdout)
         raise
Esempio n. 5
0
    def __call__(self, siplesolver, it, x, Fx, y, d, r, *args):
        """Callback from `siple`.  Gathers together the long list of arguments
        into a dictionary and passes it along in a standard form to the python listener."""
        data = Bunch(zeta=x.core(), u=Fx.core(), zeta_step=d.core(), residual=r.core(), target_misfit=self.owner.target_misfit)

        if self.owner.method == 'ign':
            data.update(T_zeta_step=args[0].core())
        else:
            data.update(TStar_residual=args[0].core())
        try:
            self.listener(self.owner, it, data)
        except Exception:
            logError("\nERROR: Exception occured during an inverse solver listener callback:\n\n")
            traceback.print_exc(file=sys.stdout)
            raise