pyswapp package

Subpackages

Submodules

pyswapp.curve module

class pyswapp.curve.DispersionCurve(mode=0, wave='rayleigh')[source]

Bases: object

class to manipulate and save dispersion curve data

dropInvalid(inplace)[source]

drop invalid data points

estimate_error(**kwargs)[source]

estimate error

filter(pmin=None, pmax=None, param='frequency', inplace=False)[source]

remove points outside of [pmin,pmax]

get_data()[source]

store data in a data frame

init_data(freq, vel, err=None)[source]

initialize data

markInvalid(pmin=None, pmax=None, param='frequency', mask=None)[source]

mark invalid data points

markInvalid_by_poly(vertices)[source]

mark invalid rows based on points inside a polygon

plot(data=None, axes=None, outfile=None, fmt=None, show=True, show_orig=False, **kwargs)[source]

plot dispersion curve

plotColumn(data=None, axes=None, outfile=None, fmt=None, show=True, **kwargs)[source]

plot dispersion curve data as 1D column to construct pseudosection

read(fname)[source]

import data from file

resample(pmin, pmax, pn, pspace='log', param='frequency', kind='cubic', inplace=False, **kwargs)[source]

resample data

save(prjdir, pre, format, parkseis_params=None)[source]

save dispersion curve data to file

set(param, value, orig=True)[source]

set a parameter

smooth(kernel_size=5, inplace=False)[source]

smooth data

pyswapp.curves module

class pyswapp.curves.CombineCurves(data)[source]

Bases: object

combine dispersion curves and perform simple statistics

combination(combination_method='binning', axes=None, show=True, **kwargs)[source]

run combination of dispersion curves

pyswapp.manager module

class pyswapp.manager.BaseManager(prjdir, path2raw=None, path2geom=None, settings=None, database='swa.db', overwrite=False, **kwargs)[source]

Bases: object

apply_filter(ftype='FK', points_top=None, points_bot=None, procset=None, use_windows=True, **kwargs)[source]

Apply manual filter from database.

Parameters:
  • ftype (string, default 'FK', filter type)

  • points_top (list, top filter)

  • points_bot (list, bottom filter)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • use_windows (bool, default True, whether to apply the processing to windows)

  • kwargs

apply_filter_2D(procset=None, apply_to='all', use_windows=True, ftype='FK', uniq_per_rep=True, uniq_per_wid=True, **kwargs)[source]

Apply filter to current selection or all data sets

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

  • ftype (string, default 'FK', filter type)

  • uniq_per_rep (bool, default True, whether a unique filter exists for each rep)

  • uniq_per_wid (bool, default True, whether a unique filter exists for each wid)

data_preview(figures)[source]

data preview modus

delete(procset=None, table='amps', params=None)[source]
extract(procset=None, use_windows=True, method='max', **kwargs)[source]

apply dispersion curve extraction to a stream

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • use_windows (bool, default True, whether to apply the processing to windows)

  • method (str, default 'max', extraction method)

  • kwargs (arguments for the extraction)

get_figures(type='')[source]

return plot for each data set

gui_interact(type='pick', domain='FV', procset=None, use_windows=True, **kwargs)[source]

interactive figure switcher

Parameters:
  • type (str, plot type)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • use_windows (bool, default True, whether to apply the processing to windows)

gui_view(type='', procset=None, use_windows=True, **kwargs)[source]

figure switcher

Parameters:
  • type (str, plot type)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • use_windows (bool, default True, whether to apply the processing to windows)

import_filter(fname)[source]

Read filter from file in tabular format

Parameters:

fname (str, filename to import)

load_procset(procset=None, **kwargs)[source]

load processed data from database

plot(type='seismogram', procset=None, use_windows=True, **kwargs)[source]

plot portions of the stream data

Parameters:
  • type (str, plot type)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • use_windows (bool, default True, whether to apply the processing to windows)

plot_curve(procset=None, use_windows=True, method='phaseshift', **kwargs)[source]

plot a dispersion curve

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curve)

  • use_windows (bool, default True, whether to apply the processing to windows)

plot_pseudosection(procset=None, **kwargs)[source]

plot the Rayleigh wave phase velocity pseudosection

Parameters:

procset (str, identifier to set on which dataset the processing should be applied to)

preprocess(type, procset=None, use_windows=True, **kwargs)[source]

apply preprocessing steps to current selection or all data sets

Parameters:
  • type (str, which processing method to call)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • use_windows (bool, default True, whether to apply the processing to windows)

  • kwargs (arguments for the processing)

print_stats(which='stream')[source]

print stream information

process_curve(type, procset=None, method=None, dc_mode=0, use_windows=True, **kwargs)[source]

apply a process to a dispersion curve

Parameters:
  • type (str, which processing method to call)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curve)

  • dc_mode (int, default 0, mode of propagation)

  • use_windows (bool, default True, whether to apply the processing to windows)

  • kwargs (arguments for the processing)

process_curves(type, procset=None, method=None, dc_mode=0, use_windows=True, **kwargs)[source]
read_filter(ftype='FK', procset=None, use_windows=True, uniq_per_rep=True, uniq_per_wid=True)[source]

Read manual filter from database.

Parameters:
  • ftype (string, default 'FK', filter type)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • use_windows (bool, default True, whether to apply the processing to windows)

  • uniq_per_rep (bool, default True, whether a unique filter exists for each rep)

  • uniq_per_wid (bool, default True, whether a unique filter exists for each wid)

Return type:

points_top (list), points_bot (list)

save(procset=None, method=None, dc_mode=0, use_windows=True, **kwargs)[source]

save a dispersion curve for a defined source location, repetition and window id

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curve)

  • dc_mode (int, default 0, mode of propagation)

  • use_windows (bool, default True, whether to apply the processing to windows)

save_filter(fname='filter.csv', ftype='FK', procset=None)[source]

Save filter to file in tabular format

Parameters:
  • fname (str, filename to save data to disk)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • ftype (string, default 'FK', filter type)

save_stream(procset=None)[source]

save stream in .mseed file format

save_streams(procset=None, apply_to='all')[source]

save streams in .mseed file format

select_data(sin=1, rep=1, inplace=True, verbose=True)[source]

Select one stream object based on source location and shot repetition indices

Parameters:
  • sin (int, shot index number)

  • rep (int, repeated shot index number)

  • inplace (bool, default True, whether to modify the stream object rather than creating a new one)

  • verbose (print current selection to console)

Return type:

stream object

set_loadset(procset=None)[source]

set the loadset label, i.e. which dataset to load

set_new_procset(procset=None, verbose=True)[source]

set the new active processing name

set_procset_label(procset=None, verbose=True)[source]

set the new active processing name

transform(method='phaseshift', procset=None, use_windows=True, **kwargs)[source]

apply wavefield transformation to current selection or all data sets

Parameters:
  • method (str, default 'phaseshift', which transformation method to apply to the data)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • use_windows (bool, default True, whether to apply the processing to windows)

  • kwargs (arguments for the processing)

class pyswapp.manager.MASW2DManager(prjdir, path2raw=None, path2geom=None, settings=None, database='swa.db', **kwargs)[source]

Bases: BaseManager

apply_filter(procset=None, apply_to='all', use_windows=True, ftype='FK', uniq_per_rep=True, uniq_per_wid=True, **kwargs)[source]

Apply filter to current selection or all data sets

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

  • ftype (string, default 'FK', filter type)

  • uniq_per_rep (bool, default True, whether a unique filter exists for each rep)

  • uniq_per_wid (bool, default True, whether a unique filter exists for each wid)

combine(procset=None, method=None, filter=True, dc_mode=0, use_windows=True, **kwargs)[source]

Combine dispersion curves with same receiver spread location

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curves)

  • filter (, bool, manually filter curves if True)

  • dc_mode (int, default 0, mode of propagation)

  • use_windows (bool, default True, whether to apply the processing to windows)

extract(procset=None, method='max', apply_to='all', use_windows=True, **kwargs)[source]

Extract dispersion curves

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, default 'max', method for dispersion curve extraction)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

extract_curves(procset=None, method='max', apply_to='all', use_windows=True, **kwargs)[source]

Extract dispersion curves

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, default 'max', method for dispersion curve extraction)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

filter_CC()[source]

Manually filter multiple dispersion curves

moving_window(procset=None, apply_to='all', **kwargs)[source]

Apply windowing to current selection or all data sets

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • kwargs (window settings)

plot(type='seismogram', procset=None, apply_to='all', use_windows=True, **kwargs)[source]

Plot the stream data

Parameters:
  • type (str, plot type)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

plot_CC(procset=None, method=None, dc_mode=0, pseudosection=True, **kwargs)[source]

Plot the combined dispersion curves

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curve)

  • dc_mode (int, default 0, mode of propagation)

  • pseudosection (bool, plot as pseudosection)

  • kwargs (arguments for the processing)

plot_curves(procset=None, method=None, dc_mode=0, apply_to='all', use_windows=True, **kwargs)[source]

Plot a dispersion curve

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curve)

  • dc_mode (int, default 0, mode of propagation)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

plot_streams(type='seismogram', procset=None, apply_to='all', use_windows=True, **kwargs)[source]

Plot the stream data

Parameters:
  • type (str, plot type)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

preprocess(type='trim', procset=None, apply_to='all', use_windows=True, **kwargs)[source]

Apply preprocessing steps to current selection or all data sets

Parameters:
  • type (str, processing type)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

preprocess_streams(type='trim', procset=None, apply_to='all', use_windows=True, **kwargs)[source]

Apply preprocessing steps to current selection or all data sets

Parameters:
  • type (str, processing type)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

process_CC(type='smooth', procset=None, method=None, dc_mode=0, **kwargs)[source]

Process the combined dispersion curves

Parameters:
  • type (str, which processing method to call)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curve)

  • dc_mode (int, default 0, mode of propagation)

  • kwargs (arguments for the processing)

process_curves(type='smooth', procset=None, method=None, dc_mode=0, apply_to='all', use_windows=True, **kwargs)[source]

Apply a process to a dispersion curve

Parameters:
  • type (str, which processing method to call)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curve)

  • dc_mode (int, default 0, mode of propagation)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

  • kwargs (arguments for the processing)

save(procset=None, method=None, dc_mode=0, apply_to='all', use_windows=True, **kwargs)[source]

Save the dispersion curves based on receiver spread midpoint

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curve)

  • dc_mode (int, default 0, mode of propagation)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

save_CC(procset=None, method=None, dc_mode=0, format='csv', **kwargs)[source]

Save the dispersion curves based on receiver spread midpoint

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curve)

  • dc_mode (int, default 0, mode of propagation)

  • format (str, default 'csv', in which format the dispersion curve should be saved (dinver and ParkSeis support))

save_curves(procset=None, method=None, dc_mode=0, apply_to='all', use_windows=True, **kwargs)[source]

Save the dispersion curves based on receiver spread midpoint

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curve)

  • dc_mode (int, default 0, mode of propagation)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

transform(method='phaseshift', procset=None, apply_to='all', use_windows=True, **kwargs)[source]

Apply wavefield transformation to current selection or all data sets

Parameters:
  • type (str, transformation method)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

transform_streams(method='phaseshift', procset=None, apply_to='all', use_windows=True, **kwargs)[source]

Apply wavefield transformation to current selection or all data sets

Parameters:
  • method (str, transformation method)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

class pyswapp.manager.Tomo2DManager(prjdir, path2raw=None, path2geom=None, settings=None, database='swa.db', **kwargs)[source]

Bases: BaseManager

apply_filter(procset=None, apply_to='all', use_windows=True, ftype='FK', uniq_per_rep=True, uniq_per_wid=True, **kwargs)[source]

Apply filter to current selection or all data sets

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

  • ftype (string, default 'FK', filter type)

  • uniq_per_rep (bool, default True, whether a unique filter exists for each rep)

  • uniq_per_wid (bool, default True, whether a unique filter exists for each wid)

compute_phasediff(procset=None)[source]

Compute phase differences and store in database

Parameters:

procset (str, identifier to set on which dataset the processing should be applied to)

plot(type='seismogram', procset=None, apply_to='all', use_windows=True, **kwargs)[source]

Plot the stream data

Parameters:
  • type (str, plot type)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

plot_curves(procset=None, method='tomo2D', dc_mode=0, **kwargs)[source]

Plot dispersion curves

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curve)

  • dc_mode (int, default 0, mode of propagation)

plot_streams(type='seismogram', procset=None, apply_to='all', use_windows=True, **kwargs)[source]

Plot the stream data

Parameters:
  • type (str, plot type)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

prepare_streams(min_offset=-inf, max_offset=inf, min_rec=6, max_rec=None, procset=None)[source]

retrieve subsets of the data based on forward and reverse offset shots

Parameters:
  • min_offset (float, minimum offset (in m) to consider for trimming stream)

  • max_offset (float, maximum offset (in m) to consider for trimming stream)

  • min_rec (int, mininum number of receivers to keep for trimming down data)

  • max_rec (int, maximum number of receivers to keep for trimming down data)

  • procset (str, identifier to set on which dataset the processing should be applied to)

preprocess(type='trim', procset=None, apply_to='all', use_windows=True, **kwargs)[source]

Apply preprocessing steps to current selection or all data sets

Parameters:
  • type (str, processing type)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

preprocess_streams(type='trim', procset=None, apply_to='all', use_windows=True, **kwargs)[source]

Apply preprocessing steps to current selection or all data sets

Parameters:
  • type (str, processing type)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • apply_to (str, default 'all', whether to apply function to all streams or just the current selection)

  • use_windows (bool, default True, whether to apply the processing to windows)

process_curves(type='smooth', procset=None, method='tomo2D', dc_mode=0, **kwargs)[source]

Apply a process to a dispersion curve

Parameters:
  • type (str, which processing method to call)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curve)

  • dc_mode (int, default 0, mode of propagation)

  • kwargs (arguments for the processing)

run(min_offset=3, max_offset=1000000.0, lam=1, abs_err=None, rel_err=None, procset=None, opt_lam=False, scale=0.6, lam_max=200, **kwargs)[source]

Run the tomographic like approach

Parameters:
  • min_offset (float, minimum offset to consider for trimming stream)

  • max_offset (float, maximum offset to consider for trimming stream)

  • lam (int, regularization strength)

  • rel_err (float or None, default None, error to consider in the error-weighted least-squares approach)

  • procset (str, identifier to set on which dataset the processing should be applied to)

  • opt_lam (bool, use constant lambda or find optimum lambda per iteration)

  • scale (float, percentage value to decrease lambda)

  • lam_max (int, maximum value of lambda)

save(procset=None, method='tomo2D', dc_mode=0, format='csv', **kwargs)[source]

Save the dispersion curves based on receiver spread midpoint

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curve)

  • dc_mode (int, default 0, mode of propagation)

  • format (str, default 'csv', in which format the dispersion curve should be saved (dinver and ParkSeis support))

save_curves(procset=None, method='tomo2D', dc_mode=0, format='csv', **kwargs)[source]

Save the dispersion curves based on receiver spread midpoint

Parameters:
  • procset (str, identifier to set on which dataset the processing should be applied to)

  • method (str, method used to obtain dispersion curve)

  • dc_mode (int, default 0, mode of propagation)

  • format (str, default 'csv', in which format the dispersion curve should be saved (dinver and ParkSeis support))

pyswapp.qtapps module

class pyswapp.qtapps.CurveFilter(data)[source]

Bases: QWidget

User interface to manually remove points from multiple curves

closeEvent(self, a0: QCloseEvent | None)[source]
current_mask()[source]

Get the most recent mask for the active curve.

init_ui()[source]

interface design

onselect(verts)[source]

Handle polygon selection and update mask.

remove_points()[source]

Remove masked points

show_next_data()[source]
show_popup()[source]
show_prev_data()[source]
undo_filter()[source]

Undo last filtering operation for current curve.

update_display()[source]

Refresh the plot with current curve and mask.

class pyswapp.qtapps.DataSwitcherBase(data, sql, plot='TX', use_windows=False, interaction_class=None, procset=None, procsets=None, btn_label='Click me', window_label='SHOTFILES', window_title='SWA Viewer', select_plot=True, **kwargs)[source]

Bases: QWidget

Base user interface to manipulate seismic dataset

add_combobox(sets, set, label=None, size=90)[source]

Add a combo box

clean()[source]
closeEvent(self, a0: QCloseEvent | None)[source]
create_figure(plot=None, procset=None, **kwargs)[source]

Safely create the requested figure.

create_placeholder(canvas)[source]

create canvas placeholder

index_changed
index_pair_changed
init_ui()[source]

interface design

interact()[source]
plot_changed
procset_changed
replace_widget(canvas, figure)[source]

remove widget

select_data(sin=1, rep=1)[source]

Select one stream object based on source location and shot repetition indices

set_group(group_index)[source]
set_index(current_index)[source]
set_plot(plot)[source]
set_procset(procset)[source]
show_next_figure()[source]
show_previous_figure()[source]
update_display()[source]

update the display

class pyswapp.qtapps.DataSwitcherFilter(data, sql, plot='FK', use_windows=False, procset=None, procsets=None, select_plot=True, interaction_class=None, **kwargs)[source]

Bases: DataSwitcherBase

Manual filter interface.

add_button(label, width=100)[source]
apply_filter(stream, sin, rep, wid)[source]
create_figure(plot=None, **kwargs)[source]

Safely create the requested figure.

current_data()[source]
interact_delete()[source]

Delete data from database.

interact_filter()[source]

Apply filter based on interaction points.

interact_save()[source]

Save filtered data to database.

setup_interaction(figure)[source]
show_popup()[source]

Information

write_current_filtered_data(stream, flag, sin, rep, wid)[source]
write_filtered_data()[source]
class pyswapp.qtapps.DataSwitcherFilterFK(data, sql, plot='FK', use_windows=False, procset=None, procsets=None, select_plot=True, **kwargs)[source]

Bases: DataSwitcherFilter

Manual FK filter interface.

init_ui()[source]

Build the FK filter interface.

update_display()[source]

Update all canvases, toolbars, labels, and interactor.

class pyswapp.qtapps.DataSwitcherFilterTX(data, sql, plot='TX', use_windows=False, procset=None, procsets=None, select_plot=True, **kwargs)[source]

Bases: DataSwitcherFilter

Manual FK filter interface.

init_ui()[source]

Build the FK filter interface.

update_display()[source]

Update all canvases, toolbars, labels, and interactor.

class pyswapp.qtapps.DataSwitcherPick(data, sql, plot='FV', use_windows=False, procset=None, procsets=None, select_plot=True, **kwargs)[source]

Bases: DataSwitcherBase

Manual dispersion curve picking interface

get_picks()[source]

Load picks from SQL and return them as a dict.

init_ui()[source]

Builds the UI. Mostly identical to original, but safer & cleaner.

interact()[source]

Called when user performs picking interaction.

set_method(method)[source]

Change FV/dc processing method and refresh display.

show_popup()[source]

Help popup with keyboard shortcuts.

write_data_to_sql()[source]

Writes edited picks to SQL.

class pyswapp.qtapps.DualDataSwitcher(data, sql, plot='geom', DataSwitcher=None, procset=None, procsets=None, window_title='SWA Viewer', select_plot=True, **kwargs)[source]

Bases: QMainWindow

User interface to display raw data and select subset of data (e.g., based on windowing) side by side

clean()[source]
closeEvent(self, a0: QCloseEvent | None)[source]
class pyswapp.qtapps.FigureSwitcher(figures)[source]

Bases: QMainWindow

User interface to view the seismic data

init_ui()[source]

interface design

show_next_figure()[source]

Switch to next figure

show_previous_figure()[source]

Switch to previous figure

update_figure()[source]

Update figure

pyswapp.stream module

python class for manipulating an Obspy stream

class pyswapp.stream.SeismicStream(fname, settings=None, channel_nr=1001, pre_trigger=0)[source]

Bases: object

class to manipulate a seismic record for the analysis of surface waves

amps2st(amps, st=None)[source]

store amplitudes (nchannels,nsamples) as obspy stream data

apply_fk_filter(points_list, key_list, **kwargs)[source]

apply fk filter from picking boundaries

apply_geometry(source_coordinates, receiver_coordinates)[source]

Apply the survey geometry to the seismic data

apply_linear_mute(points_list, key_list, **kwargs)[source]
argfreq()[source]

return the frequency ids of the selection

check_traces(st=None)[source]

check whether a trace only contains zeros and remove it

compute_phasediffs()[source]

compute phase differences between adjacent receivers for one shot file

dcpicking(pck_mode='auto', auto_method='max', **kwargs)[source]

automatic or interactive dispersion curve picking

filter(by, **kwargs)[source]

non-interactive FD based filtering of the trace data

linear_mute(points, key='t', **kwargs)[source]
moving_window(**kwargs)[source]

Move a window along the trace data to select a subset and store it in a dictionary

property offset
plot(type='', **kwargs)[source]

Create static plots

preprocess_windows(windows, type='filter', **kwargs)[source]

run a preprocessing step on all windows

print_stats(which='stream')[source]

print stream information

read_data(fname, channel_nr=1001, pre_trigger=0, extract_geometry=False)[source]

read a shotfile and extract relevant information

Parameters:
  • fname (str, file name)

  • channel_nr (int, optional)

  • pre_trigger (float, optional)

  • extract_geometry (bool, True if geometry should be extracted, False otherwise)

resample(sampling_rate, window='hann', no_filter=True, strict_length=False)[source]

resample data in all traces using the method from obspy method

reset_FK()[source]

Reset FK filter

reset_pst()[source]
save_stream(fot, pre)[source]

save stream in .mseed file format

set_shot_params()[source]

set shot parameters

st2amps(st=None)[source]

store amplitudes in ndarray (nchannels,nsamples)

transform(method='phaseshift', **kwargs)[source]

Apply the wave field transformation

transform_windows(windows, trafo_type='phaseshift')[source]

apply wavefield transformation to data stored in all windows

trim(by, **kwargs)[source]

non interactive time or offset based trimming of the trace data

trim_by_offset(min_offset, max_offset, nrec=None)[source]

cut traces outside of the offsets limits

update_FV(method, vel, kw, freq, FV)[source]

update FV data

update_pst(amps, sht, recs, par)[source]

update stream data

Module contents