array1d
Array1D class definition.
- class Array1D(sensors, source)
Bases:
objectA class to organize the information for a 1D (linear) array.
- Variables:
- __init__(sensors, source)
Initialize from an iterable of Sensor1C`s and a `Source.
- Parameters:
sensors (iterable of Sensor1c) – Iterable of initialized Sensor1C objects.
source (Source) – Initialized Source object.
- Returns:
Array1D – Initialized Array1D object.
- property array_center_distance
- auto_pick_first_arrivals(algorithm='threshold', **algorithm_kwargs)
- classmethod from_array1d(array1d)
Create a deep copy of an existing Array1D object.
- classmethod from_files(fnames, map_x=<function Array1D.<lambda>>, map_y=<function Array1D.<lambda>>, obspy_read_kwargs=None)
Initialize an Array1D object from one or more data files.
This classmethod creates an Array1D object by reading the header information in the provided file(s). Each file should contain multiple traces where each trace corresponds to a single receiver. Currently supported file types are SEG2 and SU.
- Parameters:
fnames (str or iterable) – File name or iterable of file names. If multiple files are provided the traces are stacked.
map_x, map_y (function, optional) – Convert x and y coordinates using some function, default is not transformation. Can be useful for converting between coordinate systems.
obspy_read_kwargs (dict, optional) – Keyword arguments to be passed to the obspy.read().
- Returns:
Array1D – Initialized Array1d object.
- Raises:
TypeError – If fnames is not of type str or iterable.
- interactive_mute(mute_location='both', window_kwargs=None, waterfall_kwargs=None)
Interactively select source window boundary.
- Parameters:
mute_location ({“before”, “after”, “both”}, optional) – Select which part of the record to mute, default is “both” indicating two lines defining the source window boundary will be required.
window_kwargs (dict, optional) – Dictionary of keyword arguments defining the signal window, see scipy.singal.windows.tukey for available options.
waterfall_kwargs (dict, optional) – Dictionary of keyword arguments defining how the waterfall should be created, see :meth Array1D.waterfall for the available options.
- Returns:
tuple – Of the form (signal_start, signal_end).
- is_similar(other)
Check if other is similar to self.
- property kres
The array’s resolution wavenumber.
- manual_pick_first_arrivals(waterfall_kwargs=None)
Allow for interactive picking of first arrivals.
- Parameters:
waterfall_kwargs (dict, optional) – Dictionary of keyword arguments for meth: <Array1D.waterfall>, default is None indicating default keyword arguments.
- Returns:
Tuple – Of the form (distance, picked_time)
- mute(signal_start=None, signal_end=None, window_kwargs=None)
Mute traces outside of a narrow signal window.
- Parameters:
signal_start, signal_end (iterable of floats, optional) – Two points to define start and stop of the narrow signal window of the form ((pt1_dist, pt1_time), (pt2_dist, pt2_time)), default is None .
window_kwargs (dict, optional) – Dictionary of keyword arguments defining the signal window, see scipy.singal.windows.tukey for available options.
- Returns:
None – Modifies the object internal state.
- property nchannels
Number of Sensors in the array.
- property offsets
Receiver offsets relative to source position as list.
- plot(ax=None, sensor_kwargs=None, source_kwargs=None)
Plot a schematic of the Array1D object.
The schematic shows the position of the receivers and source and lists the total number of receivers and their spacing.
- Parameters:
ax (Axis, optional) – Axes on which to plot, default is None indicating a Figure and Axis will be generated on-the-fly.
sensor_kwargs, source_kwargs (None, dict, optional) – Kwargs for matplotlib.pyplot.plot to control the plotting of the sensors and source, respectively. Default is None, indicating the predefined default values will be used.
- Returns:
Tuple – Of the form (fig, ax) where fig is the figure object and ax the axes object on which the schematic is plotted, if ax=None.
- position(normalize=False)
Array’s sensor positions as list.
- Parameters:
normalize (bool, optional) – Determines whether the array positions are shifted such that the first sensor is located at x=0.
- property spacing
- timeseriesmatrix(detrend=False, normalize='none')
Sensor amplitudes as 2D ndarray.
- Parameters:
detrend (bool, optional) – Boolean to control whether a linear detrending operation is performed, default is False so no detrending is performed.
normalize ({“none”, “each”, “all”}, optional) – Enable different normalizations to be performed. “each” normalizes each traces by its maximum. “all” normalizes all traces by the same maximum. Default is “none” so no normalization is performed.
- Returns:
ndarray – Of shape (nchannels, nsamples) where each row is the amplitude of a given sensor.
- to_file(fname, ftype='su')
- trim(start_time, end_time)
Trim time series belonging to each Sensor1C.
- Parameters:
start_time, end_time (float) – Desired start time and end time in seconds measured from the point the acquisition system was triggered.
- Returns:
None – Updates internal attributes.
- trim_offsets(min_offset, max_offset)
Remove sensors outside of the offsets specified.
- Parameters:
min_offset, max_offset (float) – Specify the minimum and maximum allowable offset in meters.
- Returns:
None – Updates internal attributes.
- waterfall(ax=None, time_ax='y', amplitude_detrend=True, amplitude_normalization='each', amplitude_scale=None, position_normalization=False, plot_kwargs=None)
Create waterfall plot for this array setup.
- Parameters:
ax (Axes, optional) – Axes on which to plot, default is None indicating a Figure and Axes will be generated on-the-fly.
time_ax ({‘x’, ‘y’}, optional) – Denotes the time axis, ‘y’ is the default.
amplitude_detrend (bool, optional) – Boolean to control whether a linear detrending operation is performed, default is False so no detrending is performed.
amplitude_normalization ({“none”, “each”, “all”}, optional) – Enable different normalizations including: “each” which normalizes each traces by its maximum, “all” which normalizes all traces by the same maximum, and “none” which perform no normalization, default is “each”.
amplitude_scale (float, optional) – Factor by which each trace is multiplied, default is None which uses a factor equal to half the average receiver receiver spacing.
position_normalization (bool, optional) – Determines whether the array positions are shifted such that the first sensor is located at x=0.
plot_kwargs (None, dict, optional) – Kwargs for matplotlib.pyplot.plot to control the style of each trace, default is None.
- Returns:
Tuple – Of the form (fig, ax) where fig is the figure object and ax the axes object on which the schematic is plotted, if ax=None.
- zero_pad(df)
Append zero to sensors to achieve a desired frequency step.
- Parameters:
df (float) – Desired linear frequency step in Hertz.
- Returns:
None – Instead modifies sensors.
- class Array1DwSource(sensors, source)
Bases:
Array1D- classmethod from_files(fnames_rec, fnames_src, src_channel, map_x=<function Array1DwSource.<lambda>>, map_y=<function Array1DwSource.<lambda>>)
Initialize an Array1D object from one or more data files.
This classmethod creates an Array1D object by reading the header information in the provided file(s). Each file should contain multiple traces where each trace corresponds to a single receiver. Currently supported file types are SEG2 and SU.
- Parameters:
fnames (str or iterable) – File name or iterable of file names. If multiple files are provided the traces are stacked.
map_x, map_y (function, optional) – Convert x and y coordinates using some function, default is not transformation. Can be useful for converting between coordinate systems.
obspy_read_kwargs (dict, optional) – Keyword arguments to be passed to the obspy.read().
- Returns:
Array1D – Initialized Array1d object.
- Raises:
TypeError – If fnames is not of type str or iterable.
- xcorrelate(vmin=None, vmax=None)