avni.data.SW module#

avni.data.SW.get_travel_times1D(table, distance_in_degree, period, output='pvel', overtone=0, phase=None)[source]#

Return the arrival time in seconds of a surface-wave phase or mode type/overtone. When phase is queries, mode_type/overtone/arc are ignored

table <str>: path to hdf5 format modes table distance_in_degree <float>: great circle distance, can be minor or major arc period <float>: period in second mode_type <str>: either “spheroidal”, “toroidal”, or “radial” overtone <int>: overtone number (defaults to 0, ie. fundamental mode)

avni.data.SW.get_velocity(table, period, overtone, mode_type, output='pvel')[source]#

Return the arrival time in seconds of a surface-wave phase or mode type/overtone. When phase is queries, mode_type/overtone/arc are ignored

table <str>: path to hdf5 format modes table distance_in_degree <float>: great circle distance, can be minor or major arc period <float>: period in second mode_type <str>: either “spheroidal”, “toroidal”, or “radial” overtone <int>: overtone number (defaults to 0, ie. fundamental mode)

avni.data.SW.get_dispersion_curve(table, mode_type, output='pvel', overtone=0, freq_units='mhz')[source]#

return a dispersion curve for

params: table <str>: path to hdf5 format modes table mode_type <str>: either “spheroidal”, “toroidal”, or “radial” output <str>: either “gvel” or “pvel” for group or phase velocity overtone <int>: overtone number (defaults to 0, ie. fundamental mode) freq_units <str>: units of frequency axis. either “rad/s”,”hz”,or “mhz”

returns: freq,vel: frequency (in freq_units) and (group or phase) velocity in km/s

avni.data.SW.readSWascii(file, delim='-', required=None, warning=False)[source]#

Reads the AVNI format for analysis and plotting.

file : input file in default AVNI format

delimdelimiter that combines fields into a joint field e.g. network-station

seperate out during I/O.

requiredfields needed as comments (e.g. #CITE: Author et al., YEAR) in the file
defaults: ‘CITE’, ‘SHORTCITE’, ‘REFERENCE MODEL’, ‘PVEL’, ‘CRUST’,

‘MODEL3D’, ‘SIGMATYPE’, ‘WEITYPE’,’EQTYPE’, ‘STATTYPE’, ‘FORMAT’, ‘WRITE’, ‘FIELDS’

SWdata : dictionary with fields data, metadata and comments

avni.data.SW.writeSWascii(SWdata, filename, iflagthreshold=None, delim='-', writeheader=True, writedata=True, verbose=True)[source]#

Writes the AVNI format for analysis and plotting

SWdata : dictionary of SW data with metadata and data fields

filename : output file name

delimdelimiter that combines fields into a joint field e.g. network-station

seperate out during I/O.

iflagthresholdthreshold for iflag which corresponds to the processing level

that was cleared

avni.data.SW.SWasciitohdf5(files, hdffile='Summary.SW.data.h5', datatype='summary', delim='-')[source]#

Read a list of files to hdf5 container format.

files: a panda list of ascii files to append

hdffile: output hdf5 file to append fields to

datatype: type of data to group the data with

delimdelimiter that combines fields into a joint field e.g. network-station

seperate out during I/O.

avni.data.SW.SWhdf5toascii(query='0/25.0/L1/REM3D', hdffile='Summary.SW.data.h5', iflag=0, datatype='summary', delim='-', outfile=None, model3d=None, refmodel=None, crust=None, weitype=None, sigmatype=None, stattype=None, eqtype=None)[source]#

write hdf field to a file. None is the default i.e. the values in metadata

query: key query to the hdf5 file till the group level e.g. 0/25.0/L1/GDM52

hdffile: output hdf5 file to append fields to

datatype: type of data to group the data with e.g. raw, processed, summary

delimdelimiter that combines fields into a joint field e.g. network-station

seperate out during I/O.

iflag : select the flag to sub-select data

outfile : output ascii file. If None, decided based on query

model3d, refmodel,crust,weitype : Fields used to query various groups and attributes sigmatype,stattype ,eqtype : If None, use the values in the hdffile metadata

ASCII file with the values selected

avni.data.SW.readSWhdf5(query='0/25.0/L1/REM3D', hdffile='Summary.SW.data.h5', iflag=0, datatype='summary', delim='-', model3d=None, refmodel=None, crust=None, weitype=None, sigmatype=None, stattype=None, eqtype=None)[source]#

Read a list of files to hdf5 container format.

query: key query to the hdf5 file till the group level e.g. 0/25.0/L1/GDM52

hdffile: output hdf5 file to append fields to

datatype: type of data to group the data with e.g. raw, processed, summary

delimdelimiter that combines fields into a joint field e.g. network-station

seperate out during I/O.

iflag : select the flag to sub-select data

model3d, refmodel,crust,weitype : Fields used to query various groups and attributes sigmatype,stattype ,eqtype : If None, use the values in the hdffile metadata

SWdatadictionary of SW data with metadata and data fields consistent with

readSWascii and writeSWascii