Esempio n. 1
0
def process_energyratio (windowsize = 0.1):
  writenow('PROCESS: Computing STA/LTA for traces.')
  writenow('         \twindowsize = %f s'%windowsize)
  params = dbase['params']
  data = dbase['data_current'].reshape(params['flatdatadims'])
  dt = params['dt']

  windowsamps = int(windowsize/dt)
  erdata = analysis.energyratio(data, windowsamps).reshape(params['datadims'])

  if (keepdata):
    dbase['data_energyratio'] = erdata
  dbase['data_current'] = erdata
Esempio n. 2
0
def process_energyratio(windowsize=0.1):
    writenow('PROCESS: Computing STA/LTA for traces.')
    writenow('         \twindowsize = %f s' % windowsize)
    params = dbase['params']
    data = dbase['data_current'].reshape(params['flatdatadims'])
    dt = params['dt']

    windowsamps = int(windowsize / dt)
    erdata = analysis.energyratio(data,
                                  windowsamps).reshape(params['datadims'])

    if (keepdata):
        dbase['data_energyratio'] = erdata
    dbase['data_current'] = erdata
Esempio n. 3
0
wlen = DEFAULT_WLEN

if len(sys.argv) >= 3:
    wlen = int(sys.argv[2])

shift = -wlen

if len(sys.argv) >= 4:
    shift = -int(sys.argv[3])

inifile = glob.glob('*.ini')[0]
projnm = inifile.split('.')[0]

ini = readini(inifile)

ns = ini['ns']
nr = ini['nr']

sf = SEGYFile(infile)
dt = sf.bhead['hdt'] * TUNIT
picks = (np.argmax(energyratio(sf[:], wlen), axis=1) + shift)
picks.shape = (ns, nr)

picks = picks * dt

with open('%s.picks'%(projnm,), 'w') as fp:
    fp.writelines(['%d %d %f\n'%(isrc+1, irec+1, picks[isrc, irec]) for isrc in xrange(ns) for irec in xrange(nr)])