def getRepresentedSource(sandbox): src = PyrockoMomentTensor( easting=num.mean(sandbox.frame.E), northing=num.mean(sandbox.frame.N), depth=4000., store_dir=getConfig().default_gf_dir or '', ) return src
def testPyrockoMomentTensor(self): nsources = 5 def r(lo, hi): return num.random.randint(lo, high=hi, size=1).astype(num.float) for s in xrange(nsources): self.ms.addSource( PyrockoMomentTensor( easting=r(0., self.ms.frame.E.max()), # ok northing=r(0., self.ms.frame.N.max()), # ok depth=r(0, 8000), # ok store_dir=gf_store)) self.plotDisplacement(self.ms)
def getRepresentedSource(sandbox): if not config.default_gf_dir: folder = QtGui.QFileDialog.getExistingDirectory( None, 'Open Pyrocko GF Store', os.getcwd()) else: folder = config.default_gf_dir if not folder: return False src = PyrockoMomentTensor( easting=num.mean(sandbox.frame.E), northing=num.mean(sandbox.frame.N), depth=4000., store_dir=folder, ) return src
def getRepresentedSource(sandbox): return PyrockoMomentTensor(store_dir=getConfig().default_gf_dir or '')