Skip to content

Commit

Permalink
Trivial PEP8 formatting fixes. Adding requirements.txt for xcorqc whi…
Browse files Browse the repository at this point in the history
…ch I figured out in order to get code working.
  • Loading branch information
Andrew Medlin authored and Andrew Medlin committed Feb 13, 2019
1 parent 0fa5d01 commit 7868efe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
11 changes: 6 additions & 5 deletions seismic/xcorqc/correlator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,21 @@

import click

from scripts.ASDFdatabase import SeisDB
from seismic.ASDFdatabase import SeisDB
from xcorqc import IntervalStackXCorr


# define utility functions
def rtp2xyz(r, theta, phi):
xout = np.zeros((r.shape[0], 3))
rst = r * np.sin(theta);
rst = r * np.sin(theta)
xout[:, 0] = rst * np.cos(phi)
xout[:, 1] = rst * np.sin(phi)
xout[:, 2] = r * np.cos(theta)
return xout
# end func


def xyz2rtp(x, y, z):
rout = np.zeros((x.shape[0], 3))
tmp1 = x * x + y * y
Expand All @@ -50,18 +51,18 @@ def xyz2rtp(x, y, z):
# end func

class Dataset:
def __init__(self, asdf_file_name, station_names = '*', ignore_json_db=False, zchan=None, nchan=None, echan=None):
def __init__(self, asdf_file_name, station_names='*', ignore_json_db=False, zchan=None, nchan=None, echan=None):

self._data_path = asdf_file_name
self.ds = None
self.has_jason_db = False
self.ds_jason_db = None
self._earth_radius = 6371 #km
self._earth_radius = 6371 # km

try:
self.ds = pyasdf.ASDFDataSet(self._data_path, mode='r')
except:
raise NameError('Error reading file : %s'%(self._data_path))
raise NameError('Error reading file : %s' % (self._data_path))
# end try

if(not ignore_json_db):
Expand Down
8 changes: 8 additions & 0 deletions seismic/xcorqc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
numpy
mpi4py
scipy
obspy
pyasdf
click
git+https://github.com/matplotlib/basemap.git
netcdf4

0 comments on commit 7868efe

Please sign in to comment.