コード例 #1
0
 def getxz(self):
     model_path = PATH.OUTPUT + '/' + 'model_init'
     try:
         m = solver.load(model_path)
         x = m['x'][0]
         z = m['z'][0]
     except:
         from seisflows.seistools.io import loadbin
         x = loadbin(model_path, 0, 'x')
         z = loadbin(model_path, 0, 'z')
     return x, z
コード例 #2
0
ファイル: regularize.py プロジェクト: HongjianFang/seisflows
 def getxz(self):
     model_path = PATH.OUTPUT +'/'+ 'model_init'
     try:
         m = solver.load(model_path)
         x = m['x'][0]
         z = m['z'][0]
     except:
         from seisflows.seistools.io import loadbin
         x = loadbin(model_path, 0, 'x')
         z = loadbin(model_path, 0, 'z')
     return x,z
コード例 #3
0
    def check_mesh_properties(self, path=None, parameters=None):
        if not hasattr(self, '_mesh_properties'):
            if not path:
                path = PATH.MODEL_INIT

            if not parameters:
                parameters = self.parameters

            nproc = 0
            ngll = []
            while True:
                dummy = loadbin(path, nproc, parameters[0])
                ngll += [len(dummy)]
                nproc += 1
                if not exists('%s/proc%06d_%s.bin' %
                              (path, nproc, parameters[0])):
                    break

            self._mesh_properties = Struct([['nproc', nproc], ['ngll', ngll]])

        return self._mesh_properties
コード例 #4
0
ファイル: specfem3d_globe.py プロジェクト: yanhuay/seisflows
    def check_mesh_properties(self, path=None, parameters=None):
        if not hasattr(self, '_mesh_properties'):
            if not path:
                path = PATH.MODEL_INIT

            if not parameters:
                parameters = self.parameters

            nproc = 0
            ngll = []
            while True:
                dummy = loadbin(path, nproc, 'reg1_'+parameters[0])
                ngll += [len(dummy)]
                nproc += 1
                if not exists('%s/proc%06d_reg1_%s.bin' % (path, nproc, parameters[0])):
                    break

            self._mesh_properties = Struct([
                ['nproc', nproc],
                ['ngll', ngll]])

        return self._mesh_properties