wo.opdict['syn_samplefreq']=100.0 wo.opdict['syn_kwidth']=0.1 wo.opdict['syn_otime']=5.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()
wo.opdict['syn_samplefreq'] = 100.0 wo.opdict['syn_kwidth'] = 0.1 wo.opdict['syn_otime'] = 5.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)
data_files=glob.glob(os.path.join(data_path,options.data_glob)) kurt_files=glob.glob(os.path.join(data_path,options.kurt_glob)) grad_files=glob.glob(os.path.join(data_path,options.grad_glob)) data_files.sort() kurt_files.sort() grad_files.sort() if do_hyp: hyp_files=glob.glob(os.path.join(hyp_path,options.hyp_glob)) # ***** 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)