Skip to content

Commit 4fc99b4

Browse files
committed
- installer now renames seizmo top level directory
to seizmo so that commands like 'help seizmo' work - updated README to reflect github changes - touches to ROADMAP compat & todo with progress - slowdecay* now allows directory input for ease of use - updated most mapping functions to make better use of the mmap image option - updated mmap to be more flexible with image inputs - fixed bugs in useralign & plot_taupcurve_dt as pointed out by Cheng (thanks!) - added gcdn for getting the greatest common denominator for 3+ numbers - slidingavg (and friends) now handles nans - getpeaks/correlate fixed to handle cases of no peaks (but actually now the edges are returned so that fixed the same problem) - added doc improvements to noise_setup with focus on the pzdb option - improved/bugfixed noise_rms_calc/process so that data rejection in step 7 is useful - added example buoy data for read_ndbc_swden - read_ndbc_swden reads in multiple files now - plotpsdgram can plot multiple psds - freqwindow_auto added so Ghassan could blast through data for an AGU abstract - fixed a bug in makekernels example (thanks Ghassan!) - fixed bug in ttsolve for negative correlation values to force weights to be positive
1 parent 6cf0e00 commit 4fc99b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2032
-1426
lines changed

Diff for: README

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ seismology research. See the project website for more details:
1010
2. Downloading
1111
--------------
1212
2a Get the latest version (as a compressed tarball or zipfile) here:
13-
https://github.com/g2e/seizmo/archives/master
14-
2b Or grab a tagged tarball: https://github.com/g2e/seizmo/downloads
13+
https://github.com/g2e/seizmo/archive/master.tar.gz
14+
https://github.com/g2e/seizmo/archive/master.zip
15+
2b Or grab an older tagged version: https://github.com/g2e/seizmo/tags
1516
2c Or if you have git installed (http://git-scm.com/), you may use it to
1617
retrieve the latest version:
1718
git clone git://github.com/g2e/seizmo.git

Diff for: cmb/slowdecaypairs.m

+11-1
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,25 @@
115115
% Mar. 5, 2012 - allow no written output
116116
% Oct. 10, 2012 - bugfix: azimuthal difference via azdiff
117117
% Oct. 11, 2012 - drop corrections field (huge)
118+
% July 25, 2013 - directory input (reads indir/*.mat)
118119
%
119120
% Written by Garrett Euler (ggeuler at wustl dot edu)
120-
% Last Updated Oct. 11, 2012 at 13:35 GMT
121+
% Last Updated July 25, 2013 at 13:35 GMT
121122

122123
% todo:
123124

124125
% check nargin
125126
error(nargchk(3,4,nargin));
126127

128+
% handle directory input
129+
if(ischar(results) && isdir(results))
130+
files=xdir([results filesep '*.mat']);
131+
clear results;
132+
for i=1:numel(files)
133+
results(i)=load([files(i).path files(i).name]);
134+
end
135+
end
136+
127137
% check results struct
128138
error(check_cmb_results(results));
129139

Diff for: cmb/slowdecayprofiles.m

+11-1
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,25 @@
110110
% Mar. 5, 2012 - allow no written output
111111
% Mar. 6, 2012 - basic .weights field support
112112
% Oct. 11, 2012 - drop corrections field (huge)
113+
% July 25, 2013 - directory input (reads indir/*.mat)
113114
%
114115
% Written by Garrett Euler (ggeuler at wustl dot edu)
115-
% Last Updated Oct. 11, 2012 at 13:35 GMT
116+
% Last Updated July 25, 2013 at 13:35 GMT
116117

117118
% todo:
118119

119120
% check nargin
120121
error(nargchk(1,4,nargin));
121122

123+
% handle directory input
124+
if(ischar(results) && isdir(results))
125+
files=xdir([results filesep '*.mat']);
126+
clear results;
127+
for i=1:numel(files)
128+
results(i)=load([files(i).path files(i).name]);
129+
end
130+
end
131+
122132
% check results struct
123133
error(check_cmb_results(results));
124134

Diff for: docs/ROADMAP

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
210-219 -- Kangchenjunga
1515
220-229 -- Lhotse
1616
230-239 -- Makalu
17-
240-249 -- Noshaq
18-
250-259 -- Öræfajökull/Otgontenger/Ostspitze
19-
260-269 -- Pumori/PassuSar/PizPalü
20-
270-279 -- Rheinwaldhorn/Rakaposhi/Rakhiot
21-
280-289 -- Shishapangma/Shivling/Saraghrar
22-
290-299 -- TirichMir/Tsambagarav/Tambora
17+
240-259 -- Noshaq
18+
260-269 -- Otgontenger
19+
270-279 -- Pumori/PassuSar/PizPalü
20+
280-289 -- Rheinwaldhorn/Rakaposhi/Rakhiot
21+
290-299 -- Shishapangma/Shivling/Saraghrar
22+
300-??? -- TirichMir/Tsambagarav/Tambora
2323

2424
0.7.0
2525
------------

Diff for: docs/sac-seizmo.compat

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ report N/A ('global SEIZMO; SEIZMO' for the hardcore)
150150
reverse reverse
151151
rglitches N/A
152152
rmean removemean (rmean)
153-
rms getvaluefun(data,@(x)sqrt(mean(x.^2)))
153+
rms getvaluefun(data,@(x)sqrt(mean((x-mean(x)).^2)))
154154
rollback unnecessary!
155155
rotate rotate
156156
rq N/A

Diff for: docs/seizmo_to_do.txt

+25-4
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
11
my todo list
22
%%%%%%%%%%%%
33

4+
4 rotate correlations & noise codes handle autoxc
5+
5 noise array phase and attenuation like in prieto 2009
6+
6 test & tutorials
7+
7 fss codes
8+
8 geofss codes (use mmap image option)
9+
9 test & tutorials
10+
10 data grabbing codes
11+
grab_events
12+
grab_stations
13+
grab_channels
14+
grab_responses
15+
grab_seismograms
16+
11 tpw
17+
12 2d inversion on a sphere
18+
13 reflectivity
19+
420
way to make movies while you do other things on the screen:
521
## hf = figure(‘visible’, ‘off’)
622
## addframe(aviobj, hf)
723

824
cmt
9-
- neu 2 enu (is this worthwhile)
25+
- neu 2 enu (is this worthwhile?)
1026
- plotmt: tpb, nodal line plotting
1127
- plotmt3: coloring per mt
1228
- isc database
1329
- usgs database
1430
- mt_nodallines
1531

1632
noise
17-
- rms based deletion
18-
- HARD: overlap option for stack
19-
- HARD: better rotate_correlations
33+
- HARD: overlap option for stack stuff
34+
- HARD: better rotate_correlations for processing
35+
- check horizontals code
2036

2137
fss
2238
- compute spectra not centered on 0,0?
@@ -32,11 +48,16 @@ fss
3248
- power spectral density is scaled by 2*delta/npts (td measures)
3349
- half+auto => full for xc when desired
3450
- this should just be a function
51+
- averaging across frequency (mainly for capon method)
52+
- test again!
3553
geofss
3654
- rewrites
3755
- geo(fssxc,tdssxc)
56+
- antipodal issue?
3857
- write
3958
- geo(fsshorz,fsshorzxc,tdsshorzxc,arfhorz)
59+
- much of this should come from non-geo versions
60+
- test!
4061

4162
rotate_correlations
4263
- not ready

Diff for: fk/plotbathyexcite.m

+34-138
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,27 @@
1-
function [varargout]=plotbathyexcite(c,la,lo,crng,popt,fgcolor,bgcolor,ax)
1+
function [varargout]=plotbathyexcite(c,la,lo,crng,varargin)
22
%PLOTBATHYEXCITE Plots 2ndary microseism bathymetric excitation coeff
33
%
44
% Usage: plotbathyexcite(c,lat,lon)
55
% plotbathyexcite(c,lat,lon,clim)
6-
% plotbathyexcite(c,lat,lon,clim,projopt)
7-
% plotbathyexcite(c,lat,lon,clim,projopt,fgcolor,bgcolor)
8-
% plotbathyexcite(c,lat,lon,clim,projopt,fgcolor,bgcolor,ax)
6+
% plotbathyexcite(c,lat,lon,clim,'mmap_opt1',mmap_val1,...)
97
% ax=plotbathyexcite(...)
108
%
119
% Description:
12-
% PLOTBATHYEXCITE(C,LAT,LON) plots bathymetric coefficient data given
10+
% PLOTBATHYEXCITE(C,LAT,LON) maps bathymetric coefficient data given
1311
% in the 2D array C. The data should be regularly sampled in latitude
14-
% and longitude (given by vectors LAT & LON). The data is plotted on a
15-
% map with a Robinson projection and the map limits are scaled to
16-
% fit the latitude and longitude limits. This plots GSHHS coastlines
17-
% in a crude-resolution. Dimensions of C should be NLATxNLON.
12+
% and longitude (given by vectors LAT & LON). Dimensions of C should
13+
% be NLATxNLON.
1814
%
19-
% PLOTBATHYEXCITE(C,LAT,LON,CLIM) sets the coloring limits of the
20-
% coefficients limits for coloring. The default is [0 1]. CLIM must
21-
% be a real-valued 2-element vector.
15+
% PLOTBATHYEXCITE(C,LAT,LON,CLIM) sets the colormap limits of the
16+
% coefficients. The default is [0 1]. CLIM must be a real-valued
17+
% 2-element vector.
18+
%
19+
% PLOTBATHYEXCITE(C,LAT,LON,CLIM,'MMAP_OPT1',MMAP_VAL1,...) passes
20+
% additional options on to MMAP to alter the map.
2221
%
23-
% PLOTBATHYEXCITE(C,LAT,LON,CLIM,PROJOPT) allows passing options to
24-
% M_PROJ. See M_PROJ('SET') for possible projections and see
25-
% M_PROJ('GET',PROJ) for a list of possible additional options specific
26-
% to that projection.
27-
%
28-
% PLOTBATHYEXCITE(C,LAT,LON,CLIM,PROJOPT,FGCOLOR,BGCOLOR) specifies
29-
% foreground and background colors of the plot. The default is 'w' for
30-
% FGCOLOR & 'k' for BGCOLOR. Note that if one is specified and the
31-
% other is not, an opposing color is found using INVERTCOLOR. The
32-
% color scale is also changed so the lower color clip is at BGCOLOR.
33-
%
34-
% PLOTBATHYEXCITE(C,LAT,LON,CLIM,PROJOPT,FGCOLOR,BGCOLOR,AX) sets the
35-
% axes to draw in. This is useful for subplots, guis, etc.
36-
%
37-
% AX=PLOTBATHYEXCITE(...)
22+
% AX=PLOTBATHYEXCITE(...) returns the axes drawn in.
3823
%
3924
% Notes:
40-
% - This function can be easily altered to work for any image data.
4125
%
4226
% Examples:
4327
% % Get bathymetric excitation coefficients for Crust2.0 and plot:
@@ -61,14 +45,15 @@
6145
% Feb. 15, 2011 - initial version
6246
% May 5, 2012 - minor doc update
6347
% May 18, 2012 - improved label of the colorbar, use gray colormap
48+
% Aug. 27, 2013 - use mmap image option
6449
%
6550
% Written by Garrett Euler (ggeuler at wustl dot edu)
66-
% Last Updated May 18, 2012 at 15:05 GMT
51+
% Last Updated Aug. 27, 2013 at 15:05 GMT
6752

6853
% todo:
6954

7055
% check nargin
71-
error(nargchk(1,8,nargin));
56+
error(nargchk(3,inf,nargin));
7257

7358
% check coefficient array
7459
if(~isreal(c) || any(c(:)<0) || ndims(c)~=2)
@@ -96,127 +81,38 @@
9681
end
9782
crng=sort([crng(1) crng(2)]);
9883

99-
% check colors
100-
if(nargin<6);
101-
fgcolor='w'; bgcolor='k';
102-
elseif(nargin<7)
103-
if(isempty(fgcolor))
104-
fgcolor='w'; bgcolor='k';
105-
else
106-
bgcolor=invertcolor(fgcolor,true);
107-
end
108-
else
109-
if(isempty(fgcolor))
110-
if(isempty(bgcolor))
111-
fgcolor='w'; bgcolor='k';
112-
else
113-
fgcolor=invertcolor(bgcolor,true);
114-
end
115-
elseif(isempty(bgcolor))
116-
bgcolor=invertcolor(fgcolor,true);
117-
end
118-
end
119-
120-
% change char to something rgb
121-
if(ischar(fgcolor)); fgcolor=name2rgb(fgcolor); end
122-
if(ischar(bgcolor)); bgcolor=name2rgb(bgcolor); end
84+
% a couple mmap default changes
85+
% - use min/max of lat/lon as the map boundary
86+
% - do not show land/ocean
87+
varargin=[{'po' {'lat' [min(la) max(la)] ...
88+
'lon' [min(lo) max(lo)]} 'l' false 'o' false} varargin];
12389

124-
% check handle
125-
if(nargin<8 || isempty(ax) || ~isscalar(ax) || ~isreal(ax) ...
126-
|| ~ishandle(ax) || ~strcmp('axes',get(ax,'type')))
127-
figure('color',bgcolor);
128-
ax=gca;
129-
else
130-
axes(ax);
131-
h=get(ax,'children'); delete(h);
132-
h=findobj(get(get(ax,'parent'),'children'),'peer',ax); delete(h);
133-
end
134-
135-
% map colors & coast/border res
136-
%gshhs='c';
137-
ocean=bgcolor;
138-
%land=fgcolor;
139-
land=[0.4 0.6 0.2];
140-
%border=fgcolor;
90+
% draw map
91+
ax=mmap('image',{la lo c.'},varargin{:});
14192

142-
% access to m_map globals for map boundaries
143-
global MAP_VAR_LIST
93+
% extract color
94+
bg=get(get(ax,'parent'),'color');
95+
fg=get(findobj(ax,'tag','m_grid_box'),'color');
14496

145-
% reshape beam & account for pcolor
146-
latstep=la(2)-la(1);
147-
lonstep=lo(2)-lo(1);
148-
la=[la(:)-latstep/2; la(end)+latstep/2];
149-
lo=[lo(:)'-lonstep/2 lo(end)+lonstep/2];
150-
c=c([1:end end],[1:end end]);
151-
152-
% get max/min lat/lon of map & stations
153-
minlat=min(la); maxlat=max(la);
154-
minlon=min(lo); maxlon=max(lo);
155-
156-
% default/check projopt
157-
if(nargin<5 || isempty(popt))
158-
popt={'robinson','lat',[minlat maxlat],'lon',[minlon maxlon]};
159-
end
160-
if(ischar(popt)); popt=cellstr(popt); end
161-
if(~iscell(popt))
162-
error('seizmo:plotbathyexcite:badInput',...
163-
'PROJOPT must be a cell array of args for M_PROJ!');
164-
end
165-
166-
% setup projection
167-
m_proj(popt{:});
168-
set(ax,'color',ocean);
169-
170-
% plot image data
171-
hold(ax,'on');
172-
if(any(lo>MAP_VAR_LIST.longs(1) & lo<MAP_VAR_LIST.longs(2)))
173-
m_pcolor(lo,la,c,'parent',ax);
174-
end
175-
if(any(lo-360>MAP_VAR_LIST.longs(1) & lo-360<MAP_VAR_LIST.longs(2)))
176-
m_pcolor(lo-360,la,c,'parent',ax);
177-
end
178-
if(any(lo+360>MAP_VAR_LIST.longs(1) & lo+360<MAP_VAR_LIST.longs(2)))
179-
m_pcolor(lo+360,la,c,'parent',ax);
180-
end
181-
182-
% modify
183-
shading(ax,'flat');
184-
if(strcmp(bgcolor,'w') || isequal(bgcolor,[1 1 1]))
97+
% set colormap
98+
if(strcmp(bg,'w') || isequal(bg,[1 1 1]))
18599
colormap(ax,flipud(gray));
186-
elseif(strcmp(bgcolor,'k') || isequal(bgcolor,[0 0 0]))
100+
elseif(strcmp(bg,'k') || isequal(bg,[0 0 0]))
187101
colormap(ax,gray);
188102
else
189-
if(ischar(bgcolor))
190-
bgcolor=name2rgb(bgcolor);
191-
end
192-
hsv=rgb2hsv(bgcolor);
103+
if(ischar(bg)); bg=name2rgb(bg); end
104+
hsv=rgb2hsv(bg);
193105
colormap(ax,hsvcustom(hsv));
194106
end
195107
set(ax,'clim',crng);
196-
hold(ax,'off');
197-
198-
% now add coastlines and political boundaries
199-
axes(ax);
200-
%m_gshhs([gshhs 'c'],'color',land);
201-
%m_gshhs([gshhs 'b'],'color',border);
202-
m_coast('line','color',fgcolor);
203-
%m_coast('patch',land);
204-
m_grid('color',fgcolor,'xtick',[],'ytick',[]);
205-
206-
% hackery to color oceans at large when the above fails
207-
set(findobj(ax,'tag','m_grid_color'),'facecolor',ocean);
208108

209109
% colorbar & title
210-
c=colorbar('eastoutside','peer',ax,'xcolor',fgcolor,'ycolor',fgcolor);
211-
xlabel(c,'$$\sum {c_{m}^2}$$','color',fgcolor,...
212-
'interpreter','latex');
213-
title(ax,{[] 'Bathymetric Excitation Coefficient Map' []},...
214-
'color',fgcolor);
215-
216-
% tag plot
217-
set(ax,'tag','bathyexcite');
110+
c=colorbar('eastoutside','peer',ax,'xcolor',fg,'ycolor',fg);
111+
xlabel(c,'$$\sum {c_{m}^2}$$','color',fg,'interpreter','latex');
112+
title(ax,{[] 'Bathymetric Excitation Coefficient Map' []},'color',fg);
218113

219114
% return figure handle
115+
set(ax,'tag','bathyexcitemap');
220116
if(nargout); varargout{1}=ax; end
221117

222118
end

0 commit comments

Comments
 (0)