-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathstartup_seizmo.m
133 lines (125 loc) · 4 KB
/
startup_seizmo.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
function []=startup_seizmo()
%STARTUP_SEIZMO Adds SEIZMO to dynamic path & javaclasspath
%
% If you can't edit your paths or don't want seizmo on your default
% path then run this script (or add it to your own startup file)
% to get seizmo working. Note you may need to edit the value of the
% variable "path" below to match the directory seizmo is installed
% in -- I have seizmo as directory "/opt/seizmo/seizmo" on my system.
% The current setting is only valid when this file is in the seizmo
% directory. If you run this script from anywhere else you need the
% variable "path" to be the absolute path to your seizmo directory.
% !!! MODIFY & UNCOMMENT PATH TO MATCH YOUR SEIZMO INSTALL DIRECTORY !!!
%path='/opt/seizmo/seizmo'; % Valid anywhere on my system.
path=fileparts(mfilename('fullpath')); % Valid only in seizmo directory.
% path separator
fs=filesep;
% adding seizmo folders to the top of the path
addpath(path,...
[path fs 'lowlevel'],...
[path fs 'uninstall'],...
[path fs 'behavior'],...
[path fs 'toc'],...
[path fs 'rw'],...
[path fs 'hdr'],...
[path fs 'sz'],... % from here up is the "core" of seizmo
[path fs 'misc'],...
[path fs 'time'],...
[path fs 'position'],...
[path fs 'audio'],...
[path fs 'cmap'],...
[path fs 'cmb'],...
[path fs 'cmt'],...
[path fs 'decon'],...
[path fs 'event'],...
[path fs 'filtering'],...
[path fs 'fixes'],...
[path fs 'fk'],...
[path fs 'ftran'],...
[path fs 'gui'],...
[path fs 'invert'],...
[path fs 'mapping'],...
[path fs 'models'],...
[path fs 'multi'],...
[path fs 'noise'],...
[path fs 'ocean'],...
[path fs 'pick'],...
[path fs 'plotting'],...
[path fs 'resampling'],...
[path fs 'response'],...
[path fs 'shortnames'],...
[path fs 'solo'],...
[path fs 'sphpoly'],...
[path fs 'synth'],...
[path fs 'tomo'],...
[path fs 'topo'],...
[path fs 'tpw'],...
[path fs 'ttcorrect'],...
[path fs 'win'],...
[path fs 'ww3'],...
[path fs 'ws'],...
[path fs 'xc'],...
[path fs 'xcalign'],...
[path fs 'mattaup']);
% check that java pkg is installed
java_in_octave=true;
if(exist('OCTAVE_VERSION','builtin')==5 && isempty(ver('java')))
java_in_octave=false;
end
% adding irisws jar
jars{1}='IRIS-WS-2.0.6.jar';
pjars=strcat(path,fs,'ws',fs,jars);
for i=1:numel(jars)
if(java_in_octave && ...
all(cellfun('isempty',strfind(javaclasspath('-all'),jars{i}))))
javaaddpath(pjars{i});
end
end
clear jars;
% adding the jars for mattaup is not necessary for
% taup*.m but you might want to do this now if you
% directly use the jars or objects for some reason
jars{1}='TauP-2.1.1.jar';
jars{2}='seisFile-1.5.1.jar';
jars{3}='MatTauP-2.1.1.jar';
pjars=strcat(path,fs,'mattaup',fs,'lib',fs,jars);
for i=1:numel(jars)
if(java_in_octave && ...
all(cellfun('isempty',strfind(javaclasspath('-all'),jars{i}))))
javaaddpath(pjars{i});
end
end
clear jars;
% these are the additional folders for external programs
% - skip attempt at adding them to the path if they don't exist
if(isdir([path fs 'export_fig']))
addpath([path fs 'export_fig']);
end
if(isdir([path fs 'gshhg']))
addpath([path fs 'gshhg']);
end
if(isdir([path fs 'm_map']))
addpath([path fs 'm_map_fixes'],...
[path fs 'm_map']);
end
njtbx_path=[path fs 'njtbx' fs 'njToolbox-2.0'];
if(isdir(njtbx_path))
addpath(njtbx_path,...
[njtbx_path fs 'examples'],...
[njtbx_path fs 'njFunc'],...
[njtbx_path fs 'njTBX-2.0'],...
[njtbx_path fs 'njTBX-2.0' fs 'Utilities']);
end
% jars (2 of them) for external program njtbx
% - used by WW3 functions (analyze ocean waves & seismic noise)
jars{1}='njTools-2.0.12_jre1.5.jar';
jars{2}='toolsUI-4.0.49.jar';
pjars=strcat(path,fs,'njtbx',fs,jars);
for i=1:numel(jars)
if(java_in_octave && ...
all(cellfun('isempty',strfind(javaclasspath('-all'),jars{i}))))
javaaddpath(pjars{i});
end
end
clear jars;
end