예제 #1
0
파일: phase.py 프로젝트: woxin5295/kiwi
 def __init__(self,name,filename=None):
 
     self.name = name
     self.filename = filename
     if filename is None:
         if os.path.isfile(name+'.phase'):
             filename = name+'.phase'
         else:
             filename = os.path.join(util.kiwi_aux_dir(), 'phases', name)
         
     
     f = open(filename,'r')
     self.ref_points = []
     dists = {}
     distances, depths, times = [], [], []
     have_seen = {}
     have_depth = False
     for line in f:
         toks = line.split()
         dist = float(toks[0])
         if len(toks) == 3:
             depth = float(toks[1])
             have_depth = True
         else:
             depth = 10000.
         
         if (dist,depth) not in have_seen:
             times.append(float(toks[-1]))
             distances.append(dist)
             depths.append(depth)
         
         have_seen[(dist,depth)] = True
         
     f.close()
     if have_depth:
         dists = {}
         for di, de, ti in zip(distances, depths, times):
             if not di in dists:
                 dists[di] = ([], [])
             dists[di][0].append(de)
             dists[di][1].append(ti)
         distances1 = []
         depth_plfs = []
         for (di, (des,tis)) in sorted(dists.items()):
             distances1.append(di)
             depth_plfs.append( PLF(des,tis) )
         self.lookup = PLF(distances1, depth_plfs)
     else:
         self.lookup = PLF(distances, times)
         
     self.have_depth = have_depth
예제 #2
0
파일: config.py 프로젝트: alirezaniki/kiwi
from util import kiwi_aux_file, kiwi_aux_dir

earthradius = 6371.*1000.

show_progress = True
default_loglevel = logging.INFO

exit_on_fatal = True

source_info_prog = 'source_info'
gfdb_info_prog = 'gfdb_info'
gfdb_extract_prog = 'gfdb_extract'
gfdb_build_prog = 'gfdb_build'
seismosizer_prog = 'minimizer'

topo_dir = pjoin(kiwi_aux_dir(),'topo')
topo_img_file_1m = pjoin(topo_dir,'topo_11.1.img')
topo_grd_file_5m = pjoin(topo_dir,'ETOPO1_Ice_g_gmt4_downsampled_5m_polefix.grd')
topocpt_sealand = pjoin(topo_dir, 'light_topo_continuous.cpt')
topocpt_sea = pjoin(topo_dir, 'light_topo_continuous_sea_only.cpt')
topocpt_land = pjoin(topo_dir, 'light_topo_continuous_land_only.cpt')


component_names = {     'a':'R@-+@-',
                        'c':'R@--@-',
                        'r':'T@-+@-',
                        'l':'T@--@-',
                        'd':'Z@-+@-',
                        'u':'Z@--@-',
                        'n':'N',
                        'e':'E',
예제 #3
0
from util import kiwi_aux_file, kiwi_aux_dir

earthradius = 6371. * 1000.

show_progress = True
default_loglevel = logging.INFO

exit_on_fatal = True

source_info_prog = 'source_info'
gfdb_info_prog = 'gfdb_info'
gfdb_extract_prog = 'gfdb_extract'
gfdb_build_prog = 'gfdb_build'
seismosizer_prog = 'minimizer'

topo_dir = pjoin(kiwi_aux_dir(), 'topo')
topo_img_file_1m = pjoin(topo_dir, 'topo_11.1.img')
topo_grd_file_5m = pjoin(topo_dir,
                         'ETOPO1_Ice_g_gmt4_downsampled_5m_polefix.grd')
topocpt_sealand = pjoin(topo_dir, 'light_topo_continuous.cpt')
topocpt_sea = pjoin(topo_dir, 'light_topo_continuous_sea_only.cpt')
topocpt_land = pjoin(topo_dir, 'light_topo_continuous_land_only.cpt')

component_names = {
    'a': 'R@-+@-',
    'c': 'R@--@-',
    'r': 'T@-+@-',
    'l': 'T@--@-',
    'd': 'Z@-+@-',
    'u': 'Z@--@-',
    'n': 'N',