├── .gitignore ├── LICENSE.txt ├── NOTICE ├── README.md ├── eqclustering.py ├── setup.py └── tests ├── clustering_test.py └── data └── NSL_catalog_col.txt /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | __pycache__ 3 | *.egg-info 4 | build 5 | dist 6 | .cache 7 | 8 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | CITATION INFORMATION 2 | 3 | Zaliapin et al. (2008) "Clustering Analysis of Seismicity and Aftershock Identification" Phys. Rev. Lett. 101, 018501 4 | doi:10.1103/PhysRevLett.101.018501 5 | 6 | University of Nevada, Reno (1971): Nevada Seismic Network. International Federation of Digital Seismograph Networks. Other/Seismic Network. 7 | doi:10.7914/SN/NN 8 | 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | eqclustering 2 | ============ 3 | Python module of earthquake clustering algorithm of Zaliapin et al. 4 | 5 | This is a implementation of the clustering algorithm, based on the original MATLAB implementation, of Zaliapin. The only hard python lib dependency is numpy. It is recommended to use a numpy compiled against ATLAS, BLAS, LAPACK, etc. for best performance. 6 | 7 | WORK IN PROGRESS!! 8 | ------------------ 9 | This software is in flux. It currently produces the same results as the MATLAB code used for the original publication... 10 | 11 | ...But the I/O methods, tests and test data, and other features may change rapidly until a 1.0 release. 12 | 13 | * Documentation - here and improved docstrings 14 | * I/O - make more agnostic 15 | * numpy - better integration, allow for using numpy.load, use 2D array with attr, etc 16 | 17 | ```python 18 | from eqclustering import BPTree 19 | # Basic use 20 | t = BPTree.from_file("my_input.txt") # Load event data from a file 21 | t.grow() # Populate B-P tree with events 22 | t.prune(c=None) # Prune tree using cutoff distance (calculate if None) 23 | t.output2file("my_results.txt") # Output to file 24 | ``` 25 | Installation 26 | ------------ 27 | Recommended install is via pip 28 | 29 | ```shell 30 | % pip install https://github.com/NVSeismoLab/eqclustering/archive/v0.1.0.tar.gz 31 | ``` 32 | 33 | Dependencies 34 | ------------ 35 | numpy - Use a numpy built against ATLAS, BLAS, LAPACK for optimal performance 36 | 37 | Citation 38 | -------- 39 | Citation information can be found in the `NOTICE` file which must accompany redistributions of the software. The authors request any scientific literature, especially published results using this software, include the author and publication of the original algorithm (Zaliapin): 40 | 41 | > Zaliapin et al. (2008) "Clustering Analysis of Seismicity and Aftershock Identification" Phys. Rev. Lett. 101, 018501 42 | > doi:10.1103/PhysRevLett.101.018501 43 | > 44 | > University of Nevada, Reno (1971): Nevada Seismic Network. International Federation of Digital Seismograph Networks. Other/Seismic Network. 45 | > doi:10.7914/SN/NN 46 | 47 | Authors 48 | ------- 49 | Mark Williams (Nevada Seismological Laboratory) 50 | 51 | Copyright 52 | --------- 53 | Copyright 2016 University of Nevada, Reno 54 | 55 | Licensed under the Apache License, Version 2.0 (the "License"); 56 | you may not use this file except in compliance with the License. 57 | You may obtain a copy of the License at 58 | 59 | http://www.apache.org/licenses/LICENSE-2.0 60 | 61 | Unless required by applicable law or agreed to in writing, software 62 | distributed under the License is distributed on an "AS IS" BASIS, 63 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 64 | See the License for the specific language governing permissions and 65 | limitations under the License. 66 | 67 | -------------------------------------------------------------------------------- /eqclustering.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright 2016 University of Nevada, Reno 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Author: Mark Williams, Nevada Seismological Laboratory, UNR 18 | # 19 | """ 20 | eqclustering 21 | 22 | Python translation of MATLAB scripts/functions 23 | 24 | - Mark C. Williams (2016) Nevada Seismological Lab 25 | 26 | Port of a bunch of MATLAB code -- requires numpy 27 | 28 | Defines one class -- BPTree, all functionality can be accessed via methods on 29 | this instance. 30 | """ 31 | import os 32 | import datetime 33 | import numpy as np 34 | 35 | def _ts(dt): 36 | """Float timestamp from python datetime""" 37 | return (dt-datetime.datetime(1970, 01, 01, 00, 00, 00)).total_seconds() 38 | 39 | # I/O --- remove or do something --------------------------------------------- 40 | def _input_line(line): 41 | """ 42 | Return map from line 43 | """ 44 | l = line.split() 45 | r = { 46 | "year": int(l[0]), 47 | "month": int(l[1]), 48 | "day": int(l[2]), 49 | "hour": int(l[3]), 50 | "minute": int(l[4]), 51 | "second": float(l[5]), 52 | "mag": float(l[9]), 53 | "lat": float(l[6]), 54 | "lon": float(l[7]), 55 | "dep": float(l[8]), 56 | #"evid": int(l[10]), 57 | } 58 | r['timestamp'] = _ts(datetime.datetime(r['year'], r['month'], r['day'], 59 | r['hour'], r['minute'], 0)) + r['second'] 60 | return r 61 | 62 | 63 | def read_input_file(f): 64 | return [_input_line(l) for l in f if l] 65 | #------------------------------------------------------------------------------ 66 | 67 | def normalmix_1D(x, mu1i, mu2i, sigma1i, sigma2i): 68 | """ 69 | Estimates parameters of a 2-component 1-D Gaussian mixture model 70 | (uses the EM algorithm) 71 | 72 | Inputs 73 | ------ 74 | x : the data sample to be analysed 75 | mu#i,sigma#i : initial parameters of components 76 | 77 | Outputs 78 | ------- 79 | c, mu1, mu2, sigma1, sigma2 80 | c : the maximum likelihood boundary between the hats 81 | mu#, sigma# : are the estimated paraeters of components 82 | 83 | """ 84 | Ai = 0.5 85 | A2i = 0.5 86 | epsilon = 1 87 | p1a = np.zeros(x.size) 88 | p2a = np.zeros(x.size) 89 | p1 = np.zeros(x.size) 90 | p2 = np.zeros(x.size) 91 | epsilon0 = 0.001 92 | 93 | while epsilon > epsilon0: 94 | p1a = Ai * (1/(np.sqrt(2*np.pi*sigma1i**2))*np.exp(-(((x-mu1i)/sigma1i)**2)/2)) 95 | p2a = A2i * (1/(np.sqrt(2*np.pi*sigma2i**2))*np.exp(-(((x-mu2i)/sigma2i)**2)/2)) 96 | 97 | p1 = p1a / (p1a+p2a) 98 | p2 = p2a / (p1a+p2a) 99 | 100 | A = np.sum(p1)/len(x) 101 | A2 = np.sum(p2)/len(x) 102 | 103 | mu1 = np.sum(p1*x)/np.sum(p1) 104 | mu2 = np.sum(p2*x)/np.sum(p2) 105 | 106 | sigma1 = np.sqrt(np.sum(p1*(x-mu1)**2)/np.sum(p1)) 107 | sigma2 = np.sqrt(np.sum(p2*(x-mu2)**2)/np.sum(p2)) 108 | 109 | epsilon1 = np.abs(Ai-A) 110 | epsilon2 = np.abs(mu1i-mu1) 111 | epsilon3 = np.abs(mu2i-mu2) 112 | epsilon4 = np.abs(sigma1i-sigma1) 113 | epsilon5 = np.abs(sigma2i-sigma2) 114 | epis = [epsilon1, epsilon2, epsilon3, epsilon4, epsilon5] 115 | epsilon = np.amax(epis) 116 | 117 | Ai = A 118 | A2i = A2 119 | mu1i = mu1 120 | mu2i = mu2 121 | sigma1i = sigma1 122 | sigma2i = sigma2 123 | 124 | aa = -2*sigma1**2 + 2*sigma2**2 125 | bb = (2*mu2 * 2*sigma1**2) + (-2*mu1 * 2*sigma2**2) 126 | cc = (-mu2**2 * 2*sigma1**2) + (mu1**2* 2*sigma2**2) - (np.log(sigma2/sigma1) * 2*sigma1**2 * 2*sigma2**2) 127 | c1 = (-bb + np.sqrt(bb**2 - 4*aa*cc)) / (2*aa) 128 | c2 = (-bb - np.sqrt(bb**2 - 4*aa*cc)) / (2*aa) 129 | 130 | if mu1 < c1 < mu2: 131 | c = c1 132 | else: 133 | c = c2 134 | return c, mu1, mu2, sigma1, sigma2, A, A2, p1, p2 135 | 136 | 137 | def descend_all(parent, i): 138 | """ 139 | Return all children from parent of index i 140 | """ 141 | d = [i] 142 | for child in np.arange(parent.size)[parent==i]: 143 | d += descend_all(parent, child) 144 | return d 145 | 146 | 147 | class BPFunction(object): 148 | """ 149 | Baiesi-Paczuski metric function 150 | 151 | Inputs 152 | ------ 153 | time : the ocurrence time of events in years 154 | mag : event magnitude 155 | lon : event longitudes 156 | lat : event latitudes 157 | depth : event depths 158 | b : GR slope 159 | df : fractal dimension of epicenters 160 | 161 | Outputs (all are the same size as the EQ catalog): 162 | ------- 163 | P : resulting tree (parent-pointer format) 164 | n : nearest-neighbor BP-distance 165 | D : nearest-neighbor spatial distance 166 | T : nearest-neighbor temporal distance 167 | M : magniude of the parent event 168 | 169 | Notes 170 | ----- 171 | Reference: PHYSICAL REVIEW E 69, 066106 (2004) 172 | 173 | """ 174 | # Currently not used 175 | tmin = 0 # seconds 176 | dmin = 0 # meters 177 | 178 | @staticmethod 179 | def dist(pnt, lats, lons, deps=None): 180 | """ 181 | Surface distance (in km) between points given as [lat,lon,depth] 182 | If depth is not specified, the surface distance is computed 183 | """ 184 | R0 = 6.3673e6 185 | 186 | lat1, lon1 = pnt[:2] 187 | lat2 = lats 188 | lon2 = lons 189 | 190 | D = R0 * np.arccos( 191 | np.sin(np.radians(lat1)) * np.sin(np.radians(lat2)) + 192 | np.cos(np.radians(lat1)) * np.cos(np.radians(lat2)) * np.cos(np.radians(lon1-lon2)) 193 | ) 194 | 195 | if len(pnt) == 3 and deps: 196 | dep1 = pnt[2] * 1000 197 | dep2 = deps * 1000 198 | D = np.sqrt(D**2 + (dep1-dep2)**2) 199 | 200 | return D/1000.0 201 | 202 | def __init__(self, tmin=0, dmin=0): 203 | self.tmin = tmin 204 | self.dmin = dmin 205 | 206 | def __call__(self, time, mag, lon, lat, depth, b, df, lag=None, iswaitbar=False): 207 | """ 208 | Run fxn 209 | """ 210 | _n = len(time) 211 | 212 | P = np.empty(_n) * np.NaN # tree 213 | n = np.empty(_n) * np.Inf # eta* 214 | T = np.empty(_n) * np.NaN # T used in eta* 215 | D = np.empty(_n) * np.NaN # R used in eta* 216 | M = np.empty(_n) * np.NaN # Mag of parent event in tree 217 | 218 | if lag is None: 219 | lag = np.Inf 220 | 221 | # Function to calulate "Eta(i,j)" distance 222 | def eta(t, d, m): 223 | return t * d**df * 10**(-b*m) 224 | 225 | for i in np.arange(time.size): 226 | # TODO: put in logger or toggle verbose info 227 | #print "{0}".format(i), 228 | 229 | # This mask only calulates distances for previous events. This is 230 | # needed for the implementation of the tree which is strictly 231 | # time-ordered, events are only associated with previous events. 232 | I = (time < time[i]) & (time >= time[i]-lag) 233 | 234 | if np.any(I): 235 | d = 1000 * self.dist([lat[i], lon[i]], lat[I], lon[I]) # TODO: compare to dmin? 236 | t = time[i] - time[I] # TODO: compare to tmin? 237 | nc = eta(t, d, mag[I]) 238 | 239 | imin = nc.argmin() 240 | n[i] = nc[imin] 241 | P[i] = np.arange(len(I))[imin] 242 | D[i] = d[imin] 243 | T[i] = t[imin] 244 | M[i] = mag[I][imin] 245 | 246 | T = T/365.35/24/60/60 247 | D /= 1000 248 | return P, n, D, T, M 249 | 250 | 251 | class BPTree(object): 252 | """ 253 | Class to create/store/analyze B-P tree structure 254 | """ 255 | df = 1.6 # Fractal dimension of epicenters 256 | b = 1.0 # GR slope 257 | p = 0.5 # Weight parameter to define Tn and Rn 258 | 259 | bp = BPFunction() # setup bp function 260 | 261 | @classmethod 262 | def from_file(cls, fname): 263 | # Load the catalog 264 | with open(fname) as f: 265 | clg = read_input_file(f) 266 | # Init arrays 267 | tm, lat, lon, mag, dep = zip(*[(c['timestamp'], c['lat'], c['lon'], 268 | c['mag'], c['dep']) for c in clg]) 269 | return cls(times=tm, mags=mag, lons=lon, lats=lat, depths=dep) 270 | 271 | def __init__(self, times=[], mags=[], lons=[], lats=[], depths=[]): 272 | self._time = np.array(times) 273 | self._mag = np.array(mags) 274 | self._lon = np.array(lons) 275 | self._lat = np.array(lats) 276 | self._dep = np.array(depths) 277 | 278 | def grow(self): 279 | """ 280 | Call bp function to construct the tree from event distances 281 | 282 | TODO: enable appending to an existing tree? 283 | """ 284 | tr = self.bp(self._time, self._mag, self._lon, self._lat, [], self.b, 285 | self.df, None, False) 286 | self.P = tr[0] 287 | self.n = tr[1] 288 | self.D = tr[2] 289 | self.T = tr[3] 290 | self.M = tr[4] 291 | 292 | def normalized_time(self): 293 | return self.T * 10**(-self.p*self.b*self.M) # Normalized time 294 | 295 | def normalized_distance(self): 296 | return self.D**self.df * 10**(-(1-self.p)*self.b*self.M) # Normalized distance 297 | 298 | def prune(self, c=None): 299 | """ 300 | Prune a B-P tree to find clusters for a given cutoff eta value 301 | 302 | If no c is given, calulate one. 303 | """ 304 | TN = self.normalized_time() 305 | RN = self.normalized_distance() 306 | 307 | if c is None: 308 | I = (np.isfinite(np.log10(TN*RN))) & (TN > 0) & (RN > 0) 309 | c, mu1, mu2, sigma1, sigma2, A, A2, p1, p2 = normalmix_1D(np.log10(TN[I]*RN[I]), -6, -3, 1, 1) 310 | #print "Calculated c:{0}".format(c) # TODO: log debug 311 | 312 | P1 = self.P.copy() # maybe not needed 313 | K = (np.log10(TN) + np.log10(RN) > c) # Mainshock condition 314 | P1[K] = np.nan 315 | 316 | # TODO: fixed in bp function, can remove... 317 | #P1[0] = np.nan # first event won't pass cut, but is always a root 318 | 319 | self.Ifor = np.array([]) 320 | self.Iaft = np.array([]) 321 | self.Imain = np.array([]) 322 | self.Pfin = np.zeros(P1.size) 323 | 324 | K = np.isnan(P1) # weird, K should already be this... 325 | Ki = np.arange(K.size)[K] 326 | 327 | for i in np.arange(Ki.size): 328 | I0 = descend_all(P1, Ki[i]) 329 | I = np.array(I0) 330 | # TODO: if not mag: imax = I[0] 331 | imax = self._mag[I].argmax() 332 | IM = I[imax] 333 | IF0 = I[self._time[I] < self._time[IM]] 334 | IA0 = I[self._time[I] > self._time[IM]] 335 | #print "Subtree: event:{0}, main:{2}, cluster:{1}".format(Ki[i], I0, IM) 336 | 337 | # Keep track of fore/after shocks 338 | self.Ifor = np.append(self.Ifor, IF0) 339 | self.Iaft = np.append(self.Iaft, IA0) 340 | self.Imain = np.append(self.Imain, IM) 341 | 342 | # Change parent of all cluster members to main shock ID 343 | self.Pfin[IF0] = IM 344 | self.Pfin[IA0] = IM 345 | self.Pfin[IM] = IM 346 | 347 | self.TN = TN 348 | self.RN = RN 349 | 350 | def output2file(self, fname): 351 | with open(fname, 'w') as f: 352 | for n in np.arange(self.P.size): 353 | f.write("{0} {1} {2} {3} {4} {5} {6} {7}\n".format( 354 | n, 355 | self._time[n], 356 | self._lat[n], 357 | self._lon[n], 358 | self._dep[n], 359 | self._mag[n], 360 | self.P[n], 361 | self.Pfin[n], 362 | ) 363 | ) 364 | 365 | 366 | def main(): 367 | """ 368 | Command line version 369 | """ 370 | pass # TODO: parse args and use default CSV style file format??? 371 | 372 | 373 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | s_args = { 4 | 'name': 'eqclustering', 5 | 'version': '0.1.0', 6 | 'description': 'Statistical earthquake clustering algorithm', 7 | 'author': 'Mark Williams', 8 | 'maintainer': 'Nevada Seismological Laboratory', 9 | 'maintainer_email': 'nvseismolab@gmail.com', 10 | 'url': 'https//github.com/NVSeismoLab/eqclustering', 11 | 'py_modules': ['eqclustering'], 12 | 'install_requires': [ 13 | 'numpy', 14 | ], 15 | } 16 | 17 | # Go 18 | setup(**s_args) 19 | 20 | -------------------------------------------------------------------------------- /tests/clustering_test.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright 2016 University of Nevada, Reno 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Author: Mark Williams, Nevada Seismological Laboratory, UNR 18 | # 19 | """ 20 | Tests for eqclustering module 21 | 22 | - Mark C. Williams (2016) Nevada Seismological Lab 23 | 24 | """ 25 | import os 26 | import logging 27 | from eqclustering import BPTree 28 | 29 | PWD = os.path.dirname(__file__) 30 | 31 | 32 | def test_bptree(): 33 | """Test creating and pruning tree from input data""" 34 | logging.captureWarnings(True) 35 | 36 | FINPUT = os.path.join(PWD, 'data', 'NSL_catalog_col.txt') 37 | 38 | t = BPTree.from_file(FINPUT) 39 | t.grow() 40 | assert len(t.P) == 283 # check number of events in file 41 | 42 | t.prune() 43 | assert len(t.Pfin) == 283 44 | 45 | 46 | def test_benchmark(): 47 | """Benchmark reading/writing a file and output the time""" 48 | logging.captureWarnings(True) 49 | 50 | FINPUT = os.path.join(PWD, 'data', 'NSL_catalog_col.txt') 51 | FOUTPUT = "/tmp/eqclusterng-test-output.txt" 52 | 53 | import time 54 | t0 = time.time() 55 | 56 | t = BPTree.from_file(FINPUT) # Init tree with events from a file 57 | t.grow() # Populate B-P tree with events 58 | t.prune() # Prune given cutoff (calculate n if none) 59 | t.output2file(FOUTPUT) # Output to file to match MATLAB perf 60 | 61 | t1 = time.time() 62 | print " bench: {0}eq/{1:.6f}s ".format(len(t.P), t1-t0), 63 | 64 | 65 | -------------------------------------------------------------------------------- /tests/data/NSL_catalog_col.txt: -------------------------------------------------------------------------------- 1 | 2000 1 17 8 19 48.885 37.5696 -118.8514 0 3.88 2 | 2000 1 17 18 31 20.488 37.7948 -115.996 11.7792 3.5 3 | 2000 1 18 2 56 48.661 37.1232 -118.8782 0 3.99 4 | 2000 1 20 10 4 56.107 38.0494 -118.7298 9.1728 4.21 5 | 2000 1 21 4 39 50.24 37.5613 -118.8595 6.1987 4.82 6 | 2000 1 21 5 40 56.222 37.5541 -118.8721 3.2199 4.16 7 | 2000 2 1 12 8 50.949 35.5817 -120.027 10 4.37 8 | 2000 2 3 8 0 4.792 38.487 -118.8928 0 3.96 9 | 2000 2 3 15 13 34.299 37.4367 -117.0933 0 3.5 10 | 2000 2 6 6 49 46.711 35.4599 -114.2015 10 3.76 11 | 2000 2 7 5 3 27.703 37.5639 -118.7979 5 3.68 12 | 2000 2 7 22 52 6.304 40.839 -116.4962 10 3.51 13 | 2000 2 15 10 51 23.835 37.9068 -117.3106 0 3.57 14 | 2000 3 4 16 13 23.562 37.8311 -118.2155 7.1727 4.86 15 | 2000 3 23 1 55 48.965 37.3948 -118.5144 11.5901 3.6 16 | 2000 3 28 3 18 52.896 37.8351 -118.2178 6.3379 3.76 17 | 2000 4 7 6 22 7.299 37.4308 -118.6196 3.7068 3.67 18 | 2000 4 8 13 1 47.275 37.9102 -118.5827 6.3243 3.83 19 | 2000 4 12 10 58 12.454 40.7917 -119.7436 10 3.75 20 | 2000 4 12 16 10 55.607 36.3138 -116.6169 5 4.44 21 | 2000 4 20 18 41 25.05 38.7797 -117.8447 0 3.65 22 | 2000 4 20 18 41 31.227 38.836 -117.2041 0 3.55 23 | 2000 5 15 3 8 0.549 35.8132 -116.8001 0 3.58 24 | 2000 5 15 6 1 6.478 40.8267 -118.0808 10 3.76 25 | 2000 5 15 12 3 14.401 38.1387 -116.0199 0 3.91 26 | 2000 5 29 23 21 37.052 37.3922 -117.1143 6.3979 3.56 27 | 2000 6 4 16 46 49.008 40.3591 -116.4164 10 4.55 28 | 2000 6 4 16 58 6.815 40.4389 -116.1014 10 4.16 29 | 2000 6 4 17 1 47.18 36.1581 -119.4593 10 4.09 30 | 2000 6 4 17 49 14.215 40.5044 -114.445 10 4.99 31 | 2000 6 9 7 59 32.531 35.4638 -116.6139 0 3.57 32 | 2000 6 10 5 41 13.837 37.4287 -119.814 10 3.84 33 | 2000 6 22 6 32 21.925 37.8392 -118.2139 3.7468 3.52 34 | 2000 6 23 14 2 31.394 38.751 -119.6018 8.5886 3.75 35 | 2000 7 5 12 26 31.434 40.2289 -119.613 4.5374 3.89 36 | 2000 8 17 23 36 7.691 37.8398 -118.213 7.6233 3.92 37 | 2000 8 27 2 3 37.026 35.639 -116.2147 10 4.1 38 | 2000 8 27 13 11 40.379 36.8293 -117.8682 0 3.61 39 | 2000 9 1 19 3 0.168 37.7968 -115.7975 16.2482 4.09 40 | 2000 9 1 19 8 29.51 37.8029 -115.8556 0 3.71 41 | 2000 9 26 7 20 21.786 38.6618 -119.5277 9.1474 4.16 42 | 2000 9 26 7 20 28.946 38.6588 -119.5307 9.2951 4.72 43 | 2000 9 26 7 27 29.097 38.6545 -119.5384 10.9568 3.98 44 | 2000 10 12 9 32 34.093 40.5124 -119.4964 6.4436 3.8 45 | 2000 10 12 9 59 6.255 40.5042 -119.5034 15.5417 3.52 46 | 2000 10 14 4 53 29.093 37.3714 -117.1197 8.0254 4.22 47 | 2000 10 20 14 2 49.72 36.5856 -116.262 2.7107 3.51 48 | 2000 11 3 2 29 16.103 36.7371 -117.024 0 3.98 49 | 2000 11 6 11 44 23.708 40.4789 -119.4329 0 3.66 50 | 2000 11 13 7 5 33.971 37.4432 -118.5735 0 3.82 51 | 2000 11 16 13 6 52.77 40.4968 -119.4793 2.9625 4.2 52 | 2000 11 18 10 57 6.114 36.3215 -118.3857 0 3.65 53 | 2000 11 18 18 41 50.669 39.7605 -118.0585 7.9685 3.82 54 | 2000 11 19 12 54 50.059 40.4822 -119.4855 12.9239 4.4 55 | 2000 11 22 10 53 27.667 36.3 -118.168 0 3.66 56 | 2000 12 2 15 34 15.367 39.3787 -120.4507 14.2795 4.75 57 | 2000 12 23 7 6 35.793 40.2214 -119.58 12.6035 3.72 58 | 2000 12 24 20 52 46.444 37.4453 -117.0889 6.8649 3.55 59 | 2000 12 26 13 22 32.326 38.7218 -119.3369 10 3.66 60 | 2000 12 29 2 45 11.562 37.5339 -118.4354 5.8036 3.93 61 | 2001 1 18 15 12 34.988 37.3666 -117.1837 4.4063 3.96 62 | 2001 2 4 3 29 2.651 36.1426 -115.3455 0 3.53 63 | 2001 2 17 22 54 19.5 38.25 -118.29 12.3607 4.06 64 | 2001 3 7 19 56 25.061 38.2325 -118.7491 11.5799 3.62 65 | 2001 3 11 12 10 52.094 36.3683 -117.4468 6.5539 3.8 66 | 2001 5 26 18 59 4.092 37.9809 -118.7657 11.3052 3.76 67 | 2001 5 29 1 9 55.561 37.0718 -117.7734 6.2511 3.63 68 | 2001 8 2 16 21 18.705 37.241 -117.8075 9.0085 4.32 69 | 2001 8 10 20 19 26.604 39.8233 -120.6459 17.8183 5.31 70 | 2001 8 11 12 1 30.672 39.8276 -120.6276 18.3041 4.22 71 | 2001 8 31 15 43 36.084 38.3777 -118.1639 9.9355 3.79 72 | 2001 8 31 15 45 2.247 38.3717 -118.1645 8.9275 3.73 73 | 2001 9 14 2 38 27.737 37.385 -118.5998 10.1307 3.89 74 | 2001 10 8 5 37 10.741 41.2252 -115.8581 0 4.51 75 | 2001 12 24 23 8 33.004 37.2143 -114.4454 2.0681 3.57 76 | 2002 1 4 13 46 6.133 40.5286 -119.7356 0 3.76 77 | 2002 2 7 16 18 58.274 40.4905 -115.8142 0 3.92 78 | 2002 3 2 7 19 4.205 40.7865 -120.5992 10.6962 3.68 79 | 2002 3 24 10 44 7.863 37.0012 -115.0728 10.229 4.19 80 | 2002 4 8 20 54 18.55 37.4808 -118.841 0 3.65 81 | 2002 6 14 12 40 44.481 36.7163 -116.3013 11.7318 4.36 82 | 2002 7 15 20 18 17.542 37.3762 -118.4108 11.8468 4.08 83 | 2002 9 28 1 26 45.697 39.3851 -116.6776 6.1076 3.56 84 | 2002 9 28 10 34 46.9 35.9732 -117.293 7.4342 4.29 85 | 2002 9 28 18 11 29.421 35.9682 -117.2923 6.4082 4.03 86 | 2002 10 21 22 30 57.415 39.5315 -119.1545 10.0819 3.52 87 | 2002 10 28 12 48 17.082 38.3893 -117.995 9.2807 3.54 88 | 2002 11 25 0 3 10.534 37.3839 -117.1883 7.1484 3.92 89 | 2002 12 12 5 58 37.163 37.532 -118.5547 10.5491 3.5 90 | 2002 12 14 13 7 9.881 37.9656 -117.1052 10.6781 3.6 91 | 2002 12 15 2 30 20.446 39.0466 -118.5086 10.3324 3.89 92 | 2002 12 22 4 17 55.685 39.8462 -120.6903 0 3.61 93 | 2003 1 25 2 43 0.318 39.9753 -117.8764 5.8287 3.62 94 | 2003 1 25 2 45 49.367 39.9668 -117.871 7.2733 3.78 95 | 2003 1 28 13 54 54.02 37.4586 -118.8504 0 3.68 96 | 2003 3 8 15 35 1.976 37.5269 -118.9212 0 3.65 97 | 2003 3 13 23 51 9.53 36.6488 -117.1521 9.4284 3.79 98 | 2003 4 5 14 18 26.218 39.3763 -119.2506 12.3674 3.67 99 | 2003 5 29 18 33 2.11 38.2577 -117.9011 8.0899 3.69 100 | 2003 5 29 22 52 14.21 38.2616 -117.9042 7.9552 4.04 101 | 2003 6 1 21 0 23.891 38.2546 -117.9125 6.8834 3.75 102 | 2003 6 8 10 14 56.231 41.2484 -116.3159 12.2065 4.22 103 | 2003 9 9 19 40 0.388 41.1187 -116.6161 10.3091 3.67 104 | 2003 9 10 12 37 47.968 39.3692 -118.0579 12.9711 3.61 105 | 2003 10 7 5 20 33.184 38.1175 -118.2891 8.9624 3.8 106 | 2003 11 15 20 11 59.231 38.2217 -117.873 8.7507 4.47 107 | 2003 11 15 21 19 36.66 38.2187 -117.8698 6.4457 4.47 108 | 2003 11 18 6 59 34.867 38.2216 -117.8743 6.2648 3.82 109 | 2003 11 23 12 19 59.71 40.8731 -115.1197 1.7339 4.74 110 | 2003 12 11 0 20 21.657 38.3031 -119.2172 8.2879 3.76 111 | 2003 12 14 11 6 50.321 40.8017 -116.6306 12.8198 3.71 112 | 2003 12 18 21 37 14.718 39.7597 -115.9366 0 4.22 113 | 2003 12 20 16 35 23.678 37.2009 -117.8694 8.9785 4.15 114 | 2004 4 19 6 20 14.026 40.3813 -120.6338 11.2185 3.78 115 | 2004 4 27 7 12 7.226 38.0519 -118.812 7.7104 3.57 116 | 2004 5 16 1 29 39.277 37.2798 -114.84 0 4.53 117 | 2004 5 20 17 0 20.838 37.3064 -114.8222 0.3183 3.86 118 | 2004 6 3 8 54 45.567 39.3303 -120.0213 8.3047 4.49 119 | 2004 6 12 14 49 41.001 39.4085 -120.2258 10.6412 3.64 120 | 2004 9 18 7 7 10.814 38.0082 -118.6702 2.7605 3.75 121 | 2004 9 18 7 8 0.037 38.0029 -118.672 7.1949 4.05 122 | 2004 9 18 23 2 17.987 38.0037 -118.677 4.9831 5.62 123 | 2004 9 18 23 43 41.864 38.0167 -118.6582 5.5458 5.39 124 | 2004 9 18 23 47 58.722 38.0183 -118.645 6.7783 4.03 125 | 2004 9 19 0 2 17.723 37.9989 -118.6821 7.7133 3.57 126 | 2004 9 19 4 51 30.774 38.0049 -118.6633 8.2877 3.65 127 | 2004 9 19 6 58 4.329 38.0043 -118.6816 6.5401 4.08 128 | 2004 9 20 16 51 5.037 38.0235 -118.6446 5.3177 5.04 129 | 2004 9 21 5 51 42.699 37.9926 -118.7155 6.8085 3.73 130 | 2004 9 21 8 25 11.304 38.0199 -118.6624 6.95 3.83 131 | 2004 9 24 0 7 3.845 37.9916 -118.7009 4.5619 3.61 132 | 2004 9 24 17 27 3.197 38.009 -118.6727 9.2215 3.51 133 | 2004 9 24 21 29 37.236 38.0065 -118.6834 0 3.52 134 | 2004 9 29 6 27 19.243 37.9705 -118.6582 6.8229 3.68 135 | 2004 10 1 19 22 18.611 37.4059 -117.1158 11.2088 3.91 136 | 2004 10 8 16 32 32.387 38.6895 -115.4123 0.7463 4.18 137 | 2004 10 9 3 45 48.866 37.9691 -118.6608 6.601 4.56 138 | 2004 10 10 14 3 22.548 37.9621 -118.6594 7.0514 3.78 139 | 2004 10 12 16 55 32.89 37.9704 -118.6717 9.1144 3.52 140 | 2004 10 13 8 34 16.962 38.0646 -118.6965 5.6118 3.55 141 | 2004 10 20 11 35 15.357 38.0388 -118.6078 4.8313 4.1 142 | 2004 10 20 12 3 11.554 38.0386 -118.612 5.6385 3.86 143 | 2004 10 27 21 41 16.368 37.9731 -118.6727 6.5848 3.5 144 | 2004 11 28 5 2 39.046 38.038 -118.5919 8.2545 3.62 145 | 2004 12 23 12 37 24.019 37.9652 -118.6675 6.5063 4.05 146 | 2004 12 26 21 13 43.693 39.8316 -120.8009 12.0468 3.73 147 | 2004 12 27 0 24 1.251 39.8307 -120.7785 7.9919 3.53 148 | 2005 1 10 12 13 12.884 38.0078 -118.7204 6.9913 3.52 149 | 2005 2 1 22 20 4.36 41.2771 -117.8129 2.1576 3.64 150 | 2005 2 18 22 8 37.685 38.3847 -118.2117 10.0714 3.52 151 | 2005 2 19 10 17 20.73 38.0365 -118.59 8.1519 3.58 152 | 2005 3 13 22 9 13.354 37.4351 -118.749 0 3.81 153 | 2005 4 13 21 55 15.725 38.6211 -118.5197 8.3528 3.55 154 | 2005 4 16 21 29 6.112 38.2258 -117.872 6.5516 3.52 155 | 2005 6 14 1 31 42.117 39.5249 -120.621 11.5347 3.66 156 | 2005 6 26 18 45 56.607 39.3067 -120.0731 15.6348 4.86 157 | 2005 9 16 15 9 44.425 39.0647 -119.6272 10.364 4.24 158 | 2005 10 6 1 1 45.171 40.4923 -117.6042 8.0495 3.88 159 | 2005 11 13 23 30 35.356 38.0402 -118.6128 8.7972 3.82 160 | 2005 11 21 9 33 11.282 38.0576 -118.8989 13.1816 3.76 161 | 2005 11 29 4 45 41.19 39.0793 -119.0115 6.0667 3.61 162 | 2006 1 23 7 58 52.605 38.6327 -118.5986 4.9308 3.93 163 | 2006 2 16 17 47 59.623 37.9805 -118.7746 13.2043 4.28 164 | 2006 3 10 7 53 9.466 38.4585 -118.3637 11.4762 3.65 165 | 2006 3 14 16 32 3.212 39.7309 -115.9132 0 3.75 166 | 2006 5 5 6 36 19.125 38.2284 -118.7567 14.0176 4.29 167 | 2006 5 7 13 59 42.998 38.2183 -118.7501 13.6382 3.58 168 | 2006 5 29 10 38 43.648 39.3662 -120.4649 9.5525 3.81 169 | 2006 6 20 4 16 25.263 37.2291 -114.6723 0 4.41 170 | 2006 9 7 1 39 0.002 37.31 -118.2906 8.9099 3.5 171 | 2006 11 8 8 3 10.906 40.2159 -118.2831 10 3.72 172 | 2006 11 8 8 3 10.938 40.2054 -118.2585 10.0905 3.68 173 | 2006 11 26 22 11 48.679 37.3898 -118.8642 0 3.83 174 | 2006 11 27 21 14 16.102 36.0647 -117.7438 6.2307 3.85 175 | 2006 11 27 21 21 2.258 36.0615 -117.7495 5.5522 3.52 176 | 2006 11 28 4 6 41.114 35.679 -120.7612 13 3.7 177 | 2006 12 5 17 59 21.509 37.5696 -117.028 0 3.59 178 | 2006 12 10 23 4 37.585 38.1856 -118.3876 9.0536 3.72 179 | 2006 12 19 15 21 42.669 37.4989 -118.187 2.1267 4.14 180 | 2006 12 25 8 44 10.7 37.2381 -114.641 4.0983 3.51 181 | 2007 1 24 11 30 16.1 37.4133 -117.0986 6.0987 4.09 182 | 2007 2 28 11 47 41.377 41.1544 -114.8697 11.384 3.69 183 | 2007 3 9 3 17 32.126 38.4267 -119.369 10.0817 4.9 184 | 2007 3 9 3 20 9.804 38.4093 -119.376 8.8165 3.72 185 | 2007 4 2 1 4 15.156 37.3599 -118.3792 13.9883 3.82 186 | 2007 4 20 3 25 26.48 38.6528 -119.5254 9.1865 3.67 187 | 2007 6 12 7 22 36.196 37.5339 -118.8629 6.7899 3.62 188 | 2007 6 12 7 23 43.151 37.5331 -118.8739 6.9408 4.69 189 | 2007 7 29 4 57 46.481 40.5498 -115.9313 11.2645 3.57 190 | 2007 9 9 1 33 23.775 40.3556 -117.107 7.8814 3.6 191 | 2007 9 13 10 30 48.891 40.6421 -116.7864 5.7799 3.62 192 | 2007 9 21 22 26 43.285 40.979 -116.4123 0.5366 3.94 193 | 2007 10 25 2 18 12.198 38.5886 -118.4811 4.7379 3.73 194 | 2007 12 13 7 54 45.175 37.3465 -114.0922 3.918 3.69 195 | 2008 2 7 12 53 9.715 38.2197 -117.8601 11.2719 3.78 196 | 2008 2 21 14 16 2.727 41.1602 -114.8768 8.0066 6 197 | 2008 2 21 14 20 51.634 41.1141 -114.8987 6.0321 4.74 198 | 2008 2 21 14 46 31.01 41.1627 -114.9282 3.9595 3.66 199 | 2008 2 21 15 34 25.466 41.1318 -114.9066 5.2826 4.1 200 | 2008 2 21 16 14 17.378 41.1951 -114.8299 0.8392 3.61 201 | 2008 2 21 16 20 2.314 41.205 -114.87 3.7552 4.43 202 | 2008 2 21 16 25 49.902 41.1073 -114.8966 8.8203 3.79 203 | 2008 2 21 16 39 29.214 41.1287 -114.9182 8.9838 3.82 204 | 2008 2 21 17 1 46.612 41.1192 -114.9337 14.3645 3.58 205 | 2008 2 21 19 37 8.522 41.1372 -114.9205 5.6174 3.51 206 | 2008 2 21 19 53 49.051 41.1164 -114.9279 20.151 3.54 207 | 2008 2 21 19 57 19.904 41.1173 -114.9204 12.8755 3.68 208 | 2008 2 21 20 4 58.853 41.1696 -114.9602 18.1918 3.82 209 | 2008 2 21 23 57 51.013 41.1505 -114.9316 10.5575 4.84 210 | 2008 2 22 1 50 5.348 41.1199 -114.902 11.7029 4.34 211 | 2008 2 22 5 7 22.741 41.1663 -114.9317 9.4873 3.56 212 | 2008 2 22 7 33 34.954 41.1581 -114.9544 5.4161 3.53 213 | 2008 2 22 11 5 29.863 41.1809 -114.9296 8.102 3.64 214 | 2008 2 22 11 17 24.643 41.1663 -114.9216 11.2059 3.5 215 | 2008 2 22 15 30 22.755 41.1184 -114.9225 14.704 3.71 216 | 2008 2 22 17 10 20.421 41.1208 -114.9127 8.2149 3.5 217 | 2008 2 22 18 30 19.282 41.114 -114.91 9.1268 3.56 218 | 2008 2 22 19 22 30.344 41.1222 -114.8879 5.2745 3.75 219 | 2008 2 22 23 24 3.925 41.1127 -114.9042 8.3886 3.82 220 | 2008 2 22 23 27 45.164 41.1276 -114.9269 11.0725 4.77 221 | 2008 2 23 23 32 40.988 41.1625 -114.8713 10.596 4.28 222 | 2008 2 24 21 2 15.665 41.2237 -114.9033 0 4.41 223 | 2008 2 25 13 23 13.277 41.0995 -114.8906 8.1988 4.09 224 | 2008 2 26 12 16 5.462 41.1961 -114.8839 5.4295 3.99 225 | 2008 2 27 4 39 43.245 41.0931 -114.8877 8.9281 4.14 226 | 2008 2 27 7 59 38.207 41.1876 -114.8318 9.1768 4.77 227 | 2008 2 28 15 10 37.756 41.153 -114.9237 8.1308 4.11 228 | 2008 2 29 8 49 47.832 41.1121 -114.8924 9.4201 3.61 229 | 2008 2 29 11 8 1.153 41.2288 -114.7702 5.1429 3.51 230 | 2008 3 3 22 45 2.904 41.2038 -114.8491 5.9094 3.54 231 | 2008 3 8 4 17 52.348 38.5724 -118.4464 7.3363 3.57 232 | 2008 3 15 16 22 33.53 41.1336 -114.9023 9.8584 3.85 233 | 2008 4 1 13 16 17.213 41.2285 -114.84 10.9913 4.78 234 | 2008 4 15 21 33 57.664 39.5364 -119.9332 1.5629 3.58 235 | 2008 4 22 20 40 9.273 41.2206 -114.8063 7.5712 4.4 236 | 2008 4 24 22 47 3.987 39.5304 -119.9212 6.2803 3.96 237 | 2008 4 24 22 55 49.037 39.5265 -119.9291 2.8845 4.14 238 | 2008 4 26 1 13 20.997 39.5299 -119.9256 1.0864 3.71 239 | 2008 4 26 6 39 59.736 39.5218 -119.9196 2.525 3.9 240 | 2008 4 26 6 40 10.595 39.5253 -119.9289 1.7179 4.67 241 | 2008 4 26 7 29 20.092 39.529 -119.9281 2.1374 3.51 242 | 2008 4 26 19 8 10.03 41.9014 -114.6634 0 3.81 243 | 2008 4 28 11 33 18.277 39.5329 -119.9307 0.1241 4.26 244 | 2008 5 8 5 55 1.59 39.5399 -119.9244 2.6018 3.76 245 | 2008 5 8 18 30 42.729 37.6363 -118.7998 16 4.12 246 | 2008 5 12 20 37 0.557 38.3791 -117.5262 16 3.51 247 | 2008 6 8 17 53 40.602 39.5495 -119.9124 2.6284 3.6 248 | 2008 6 8 17 55 19.368 39.5453 -119.9208 2.4653 3.87 249 | 2008 6 13 18 31 4.545 40.4747 -119.6291 5.0583 3.96 250 | 2008 6 28 14 44 10.629 37.5761 -118.7992 2 3.95 251 | 2008 6 30 22 49 58.983 37.3304 -114.3127 0 4.26 252 | 2008 7 30 21 32 9.012 39.3627 -116.8344 9.4599 3.83 253 | 2008 8 25 21 33 33.046 37.2998 -118.3245 3.5153 3.9 254 | 2008 10 18 2 27 37.892 36.1753 -114.5225 0 3.95 255 | 2008 10 26 15 53 25.556 36.2729 -114.5478 9.7125 3.72 256 | 2008 10 26 19 47 48.353 36.2353 -114.5539 10.7887 3.76 257 | 2008 11 25 4 11 36.718 35.9954 -117.29 5.6058 3.87 258 | 2008 11 29 21 14 8.457 35.9606 -117.3579 10.5127 4.21 259 | 2008 11 30 13 3 7.141 35.9865 -117.3166 4.5984 4.31 260 | 2008 12 2 11 23 43.162 35.9646 -117.3496 11.0685 4.05 261 | 2008 12 2 16 41 19.04 35.9717 -117.3341 10.4146 3.79 262 | 2008 12 2 16 53 8.15 35.9563 -117.3643 10.4776 4.1 263 | 2008 12 13 17 16 46.199 35.9744 -117.3245 11.2158 3.7 264 | 2008 12 26 12 19 40.031 39.958 -120.8697 9.7781 4.52 265 | 2009 1 7 6 37 30.191 38.4575 -119.3186 4.1921 3.53 266 | 2009 1 27 13 19 15.129 39.0336 -115.6212 0 3.52 267 | 2009 2 18 3 12 33.005 41.2241 -114.8652 5.8094 3.67 268 | 2009 4 2 3 52 19.688 41.0866 -117.0556 5.7582 3.75 269 | 2009 5 10 0 14 11.485 39.1626 -118.0827 6.2616 3.57 270 | 2009 5 14 16 15 27.747 36.8101 -118.2022 12.003 3.67 271 | 2009 7 14 2 22 38.858 35.7315 -117.5215 16 3.54 272 | 2009 7 20 5 31 50.126 37.4995 -114.6927 2.8789 3.58 273 | 2009 8 30 7 5 57.474 36.3885 -117.8858 8.3722 3.99 274 | 2009 8 30 18 13 59.285 36.3969 -117.8743 12.6369 3.74 275 | 2009 10 9 22 13 54.177 35.9628 -114.5455 10.93 3.85 276 | 2009 10 18 15 47 29.408 39.8555 -120.7909 10.1252 3.66 277 | 2009 11 8 18 34 34.375 37.3637 -114.5387 0 3.54 278 | 2009 11 30 17 54 28.606 40.8415 -115.1893 1.65 3.57 279 | 2009 12 23 4 59 54.103 39.3194 -119.9816 8.6362 3.7 280 | 2010 1 25 22 17 14.068 36.6734 -120.3678 16 4.07 281 | 2010 1 27 0 20 13.746 36.2962 -120.1573 16 4.15 282 | 2010 1 27 7 2 35.939 38.1975 -118.8563 0 3.71 283 | 2010 1 27 11 22 31.817 39.4627 -117.6474 0 4.02 --------------------------------------------------------------------------------