Skip to content

The SeismicTrace Toolkit

Glenn Thompson edited this page Mar 4, 2021 · 6 revisions

This is under development by Celso Reyes and is currently only available under GISMO/classes/dev. The SeismicTrace toolkit is intended to become the successor to The Waveform Suite

Classes adopted so far:

Classes still under development:

Note: These names might change.

Motivation

Waveform is being replaced by Trace which provides similar functionality, but has been rewritten to take advantage of MATLAB's newer features

When the core waveform suite was created, MATLAB had just started to change the way it handled object-oriented programming. Now, the core suite has been reworked to take advantage of the new features in MATLAB which can make programming even easier. The core component classes: waveform, scnlobject, datasource all remain and now have updated functionality. However, they are being replaced with new classes as we move forward. These new class names allow me to improve core functionality that might break backwards compatibility, without compromising the functionality of the entire GISMO (Geophysical Institute Matlab Objects) suite.

* spoiler alert *

Using the newer classes can make your code easier to read, and require fewer lines of code.

% GOAL: change particular values within an individual waveform's data
% which data is used is decided by meetsCriteria, which needs access to metadata within the waveform
% then, modify these specific values using calculate() and put back into the waveform

Using the Waveform Suite, one might have had to write something like:

% w = some individual waveform
idx = meetsCriteria(w);
D = get(w,'data');     %we have to grab the data because we can't index it otherwise
D(idx) = calculate(D);
w = set(w,'data',D));  %"set" is the only way to directly change the data

Note: if the data was huge, memory might have been a consideration because we had 2 copies. The data existed inside the waveform w as well as in the array D.

The equivalent code can be written much more legibly using Trace:

% T = some individual Trace
idx = meetsCriteria(T);
T.data(idx) = calculate(T.data(idx));  %data is still controlled *BEHIND THE SCENES* by a "set"

Note: The entire data timeseries never needed to be copied.

Related notes:

For an overview of the way that classes in MATLAB have changed, see: MATLAB classes: old vs new

Clone this wiki locally