-
Notifications
You must be signed in to change notification settings - Fork 47
object oriented
GISMO is an object-oriented toolbox for Seismology. What does that mean?
Programming languages like MATLAB, C, Fortran, Python etc. include built-in data types, e.g.
Simple data types:
- boolean variables (true or false)
- integers (1,2,3,...)
- floating-point numbers (e.g. 3.141592653589793, 2.718281828459046, ...)
- strings ('hello world')
Compound data types (MATLAB):
- numeric arrays, e.g. a = [1 2 3 4 5], s = [0.1 0.2 0.3]
- cell arrays, e.g. names = {'armando'; 'wilfried'; 'virginia'}
- structures, e.g.
- s = struct()
- s.a = [1 2 3 4 5]
- s.names = {'armando'; 'wilfried'; 'virginia'}
Classes are user-defined data types. But in seismology the data types we want to define are to describe:
- waveform data
- earthquake catalogs
- networks (where stations are, deployment dates, instrument responses, etc.)
In a programming language when you say:
a = 5;
that's like saying
a = Integer(5)
Integer would be a class. a is the object - a variable of class (or data type) Integer.
With GISMO a statement like:
w = waveform()
means "let variable w (an object) be of data type (class) waveform".
Integers and floating point numbers have certain allowed operations, e.g:
a = 5;
b = 1.5;
c = a + b
d = a - b
e = a * b
f = a / b
Similarly, you can give user-defined data types (classes) certain allowed operations, e.g.
w = waveform(...)
detrend(w) - detrend a waveform object
plot(w) - plot a waveform object
These allowed operations are called methods in object-oriented terminology.
Code | Wiki | Tutorials | Website | Mailing list | Getting started | Reporting problems
- What is GISMO?
- Who uses it?
- Historical Development
- Getting started
- Getting and using the develop branch
- GISMO data types
- * Tutorials *
- * Workflow examples *
- * Applications *
- The GISMO Users Group
- Reporting errors, bugs, issues
- Contributing to GISMO
- * SUGGESTED CITATION *
- News
- Future Development
- Links