util¶
Utility functions for the OwlPy library.
- arange2(start, stop, step, dtype=<class 'float'>, epsilon=1e-06, error='raise')[source]¶
Return evenly spaced numbers over a specified interval.
Like
numpy.arange()but returning floating point numbers by default and with defined behaviour when stepsize is inconsistent with interval bounds. It is considered inconsistent if the difference between the closest multiple ofstepandstopis larger thanepsilon * step. Inconsistencies are handled according to theerrorparameter. If it is set to'raise'an exception of typeArangeErroris raised. If it is set to'round','floor', or'ceil',stopis silently changed to the closest, the next smaller, or next larger multiple ofstep, respectively.This function has been adapted from Pyrocko (pyrocko.util.arange2).
- get_traces_data_as_array(traces)[source]¶
Merge data samples from multiple traces into a 2D array.
- Parameters
traces (list of
obspy.Traceorpyrocko.Traceobjects) – Input waveforms.- Raises
OwlPyErrorif traces have different time span, sample rate or data type, or if traces is an empty list.- Returns
2D array as
data[itrace, isample].- Return type