seismic class

class csi.seismic(name, dtype='seismic', utmzone=None, ellps='WGS84', lon0=None, lat0=None)

A class that handles optical correlation results

Args:
  • name : Name of the dataset.

Kwargs:
  • dtype : Specifies a data type

  • utmzone : UTM zone (optional, default=None)

  • lon0 : Longitude of the center of the UTM zone

  • lat0 : Latitude of the center of the UTM zone

  • ellps : ellipsoid (optional, default=’WGS84’)

buildCdFromRes(fault, model, n_ramp_param=None, eik_solver=None, npt=4, nmesh=None, relative_error=0.2, add_to_previous_Cd=False, average_correlation=False, exp_cor=False, exp_cor_len=10.0)

Build Cd from residuals

Args:
  • fault: An instance of a fault class

  • model: Can be a AlTar kinematic model file (posterior mean model in a txt file) or a bigM vector

Kwargs:
  • n_ramp_param: number of nuisance parameters (e.g., InSAR orbits, used with a model file)

  • eik_solver: eikonal solver (to be used with an AlTar kinematic model file)

  • npt**2: numper of point sources per patch (to be used with an AlTar kinematic model file)

  • relative_error: standard deviation = relative_error * max(data). It can be a dictionnary

  • add_to_previous_Cd: if True, will add Cd to previous Cd

  • average_correlation: Compute average correlation for the entire set of stations

  • exp_corr: Use an exponential correlation function

  • exp_corr_len: Correlation length

Returns:
  • None

buildDiagCd(std)

Build a diagonal Cd from standard deviations

Args:
  • std: array of standard deviations

Returns:
  • None

calcSynthetics(dir_name, strike, dip, rake, M0, rise_time, stf_type='triangle', rfile_name=None, out_type='D', src_loc=None, cleanup=True, ofd=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, efd=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>)

Build Green’s functions for a particular source location

Args:
  • dir_name: Name of the directory where synthetics will be created

  • strike: Fault strike (in deg)

  • dip: Fault dip (in deg)

  • rake: Fault rake (in deg)

  • M0: Seismic moment

  • rise_time: Rise time (in sec)

Kwargs:
  • stf_type: Type of source time function (default is ‘triangle’)

  • src_loc: Point source coordinates (ndarray)

  • rfile_name: pulse file name if stf_type=’rfile’

  • ofd: stream for standard output (default=sys.stdout)

  • efd: stream for standard error (default=sys.stdout)

Returns:
  • None

initWave(waveform_engine)

Initialize Green’s function database engine

Args:
  • waveform_engine: Green’s function database engine

Returns:
  • None

initWaveInt(waveform_engine)

Initialize Bob Hermann’s wavenumber integration engine

Args:
  • waveform_engine : Bob Hermann’s wavenumber intergration engine

Returns:
  • None

initWaveKK(waveform_engine)

Initialize Kikuchi Kanamori waveform engine

Args:
  • waveform_engine: Kikuchi-Kanamori waveform engine

Returns:
  • None

plot(synth_vector=None, nc=3, nl=5, title='Seismic data', sta_lst=None, basename=None, figsize=[11.69, 8.27], xlims=None, ylims=[-20.0, 20.0], bottom=0.06, top=0.87, left=0.06, right=0.95, wspace=0.25, hspace=0.35, grid=True, axis_visible=True, inc=False, Y_max=False, Y_units='mm', fault=None, basemap=True, globalbasemap=False, basemap_dlon=2.5, basemap_dlat=2.5, endclose=True, sort=None, alignENZ=False, stationYlims=False)

Plot seismic traces

Note:

Please complement explanations

Kwargs:
  • synth_vector: concatenated synthetic waveforms

  • nc: number of collumns per page

  • nl: number of rows per page

  • title: figure title

  • sta_lst: station list

  • basename: used as prefix for figure name

  • fault: fault object used for epicenter loc

  • basemap: plot basemap with epicenter and stations location

  • basemap_dlon: Longitude steps for map

  • basemap_dlat: Latitude steps for map

  • globalbasemap: plot whole globe for teleseismic loc

  • endclose: if True, close figure

  • sort: [‘distance’ or ‘azimuth’] you can choose to sort the stations by distance to hypocenter or by azimuth

  • alignENZ: if True, 3 columns are plotted (ENU) and missing traces are left blank

  • stationYlims if True, every channels of each stations will have the same ylim

Returns:
  • None

readCdFromBinaryFile(infile='kinematicG.Cd', dtype='np.float64')

Read kinematic Cd from a input file

Kwargs:
  • infile: Name of the input file

  • dtype: type of data to read

Returns:
  • None

readSac(sacfiles)

Read sac data files

Args:
  • sacfiles : A list of input file names

Returns:
  • None

readStat(station_file, loc_format='LL')

Read station file and populate the Xr attribute (station coordinates)

If loc_format is ‘XY’:

STNAME

X_COORD

Y_COORD

If loc_format is ‘LL’:

STNAME

LON

LAT

Args:
  • station_file: station filename including station coordinates

Kwargs:
  • loc_format: station file format (default= ‘LL’)

Returns:
  • None

setStat(sta_name, x, y, loc_format='LL')

Set station names and locations attributes

Args:
  • sta_name: station names

  • x: x coordinate (longitude or UTM)

  • y: y coordinate (latitude or UTM)

Kwargs:
  • loc_format: location format (‘LL’ for lon/lat or ‘XY’ for UTM)

Returns:
  • None

writeCd2BinaryFile(outfile='kinematicG.Cd', dtype='np.float64')

Write Kinematic Cd to an output file

Kwargs:
  • outfile: Name of the output file

  • dtype: Type of data to write.

Returns:
  • None