Example #1
0
wo.opdict['syn_addnoise']=False

# get filenames for time-grids and search grids 
out_dir=os.path.join(base_path,'out',wo.opdict['outdir'])
grid_filename_base=os.path.join(base_path,'lib',wo.opdict['time_grid'])
search_grid_filename=os.path.join(base_path,'lib',wo.opdict['search_grid'])
stations_filename=os.path.join(base_path,'lib',wo.opdict['stations'])

# read the time-grid
sta=StationList()
sta.read_from_file(stations_filename)

cha=ChannelList()
cha.populate_from_station_list(sta,comp_string=["HHZ"])

time_grid=QDTimeGrid()
time_grid.read_NLL_hdr_file(search_grid_filename)
load_ttimes_buf=wo.opdict['load_ttimes_buf']
if recalc_grids : time_grid.populate_from_time_grids(grid_filename_base,cha,out_dir,load_ttimes_buf)


# set up basic grid information for test
grid_filename=os.path.join(base_path,'lib',wo.opdict['search_grid'])
dummy_grid=QDGrid()
dummy_grid.read_NLL_hdr_file(grid_filename)
# set up projection information for test
f=open(grid_filename)
lines=f.readlines()
f.close()
proj_line=lines[1]
proj_info={}
Example #2
0
wo.opdict['syn_addnoise'] = False

# get filenames for time-grids and search grids
out_dir = os.path.join(base_path, 'out', wo.opdict['outdir'])
grid_filename_base = os.path.join(base_path, 'lib', wo.opdict['time_grid'])
search_grid_filename = os.path.join(base_path, 'lib', wo.opdict['search_grid'])
stations_filename = os.path.join(base_path, 'lib', wo.opdict['stations'])

# read the time-grid
sta = StationList()
sta.read_from_file(stations_filename)

cha = ChannelList()
cha.populate_from_station_list(sta, comp_string=["HHZ"])

time_grid = QDTimeGrid()
time_grid.read_NLL_hdr_file(search_grid_filename)
load_ttimes_buf = wo.opdict['load_ttimes_buf']
if recalc_grids:
    time_grid.populate_from_time_grids(grid_filename_base, cha, out_dir,
                                       load_ttimes_buf)

# set up basic grid information for test
grid_filename = os.path.join(base_path, 'lib', wo.opdict['search_grid'])
dummy_grid = QDGrid()
dummy_grid.read_NLL_hdr_file(grid_filename)
# set up projection information for test
f = open(grid_filename)
lines = f.readlines()
f.close()
proj_line = lines[1]
Example #3
0
#  ***** reading station file ******

sta=StationList()
sta.read_from_file(stations_filename)


cha=ChannelList()
cha.populate_from_station_list_and_data_files(sta,data_files)

######### INTERPOLATE TRAVEL TIMES #############

# The time grid will contain as array values just the travel-times needed 
# (interpolated from the full NLL files) so we can free up the memory as soon as possible

time_grid=QDTimeGrid()
time_grid.read_NLL_hdr_file(hdr_file)
if options.twoD:
  time_grid.populate_from_2D_time_grids(grid_filename_base,cha)
else:
  time_grid.populate_from_time_grids(grid_filename_base,cha,out_path,load_buf=True)


print "Getting Grid geometry"
dummy_grid=QDGrid()
dummy_grid.read_NLL_hdr_file(hdr_file)
(nx,ny,nz)=(dummy_grid.nx, dummy_grid.ny, dummy_grid.nz)

if do_hyp:
  logging.info("Reading hyp parameters")
  hyp_parameters=[]