eqcctpro 0.4.6__py3-none-any.whl → 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,373 +0,0 @@
1
- Metadata-Version: 2.2
2
- Name: eqcctpro
3
- Version: 0.4.6
4
- Summary: EQCCTPro: A powerful seismic event detection toolkit
5
- Author-email: Constantinos Skevofilax <constantinos.skevofilax@austin.utexas.edu>, Victor Salles <victor.salles@beg.utexas.edu>
6
- Project-URL: Homepage, https://pypi.org/project/eqcctpro/
7
- Project-URL: Repository, https://github.com/ut-beg-texnet/eqcctpro
8
- Project-URL: Issues, https://github.com/ut-beg-texnet/eqcctpro/issues
9
- Project-URL: Documentation, https://github.com/ut-beg-texnet/eqcct/blob/main/eqcctpro/README.md
10
- Requires-Python: >=3.10.14
11
- Description-Content-Type: text/markdown
12
- Requires-Dist: numpy==1.26.4
13
- Requires-Dist: pandas==2.2.3
14
- Requires-Dist: matplotlib==3.10.0
15
- Requires-Dist: obspy==1.4.1
16
- Requires-Dist: progress==1.6
17
- Requires-Dist: psutil==6.1.1
18
- Requires-Dist: ray==2.42.1
19
- Requires-Dist: schedule==1.2.2
20
- Requires-Dist: sdnotify==0.3.2
21
- Requires-Dist: tensorflow<2.19,>=2.15
22
- Requires-Dist: tensorflow-estimator<2.19,>=2.15
23
- Requires-Dist: tensorflow-io-gcs-filesystem==0.37.1
24
- Requires-Dist: tensorboard==2.15.2
25
- Requires-Dist: tensorboard-data-server==0.7.2
26
- Requires-Dist: silence-tensorflow==1.2.3
27
- Requires-Dist: scipy==1.15.1
28
- Requires-Dist: protobuf==4.25.6
29
- Requires-Dist: grpcio==1.70.0
30
- Requires-Dist: absl-py==2.1.0
31
- Requires-Dist: h5py==3.12.1
32
- Requires-Dist: pynvml==12.0.0
33
-
34
- # EQCCTPro: powerful seismic event detection toolkit
35
-
36
- EQCCTPro is a high-performace seismic event detection and processing framework that leverages EQCCT to process seismic data efficiently. It enables users to fully leverage the computational ability of their computing resources for maximum performance for simultaneous seismic waveform processing, achieving real-time performance by identifying and utilizing the optimal computational configurations for their hardware. More information about the development, capabilities, and real-world applications about EQCCTPro can be read about in our research publication here.
37
-
38
- ## Features
39
- - Supports both CPU and GPU execution
40
- - Configurable parallelism execution for optimized performance
41
- - Includes tools for evaluating system performance for optimal usecase configurations
42
- - Automatic selection of best-usecase configurations
43
- - Efficient handling of large-scale seismic data
44
-
45
- ## Installation
46
- To install `EQCCTPro`, there are two installation approaches:
47
- 1. Install **EQCCTPro** out the box with no sample waveform data to test the application with (experts)
48
- 2. Install **EQCCTPro** with the sample waveform data as provided from the Github folder (first-time users)
49
-
50
- It is **highly** recommended you pull the `EQCCTPro` folder to gain access to the sample waveform data and code to help you get acquainted with **EQCCTPro** and its capabilites.
51
-
52
- However, if you wish to install **only the EQCCTPro Python package and use it out of the box** (method 1), run:
53
- ```sh
54
- pip install eqcctpro
55
- ```
56
- **You must have at least Python verison 3.10.14 for the application to run**.
57
-
58
- You can install Python 3.10.14 using either traditional methods or do the following commands:
59
- ```sh
60
- [skevofilaxc] conda create --name yourenvironemntname python=3.10.14 -y
61
- [skevofilaxc] conda activate yourenvironemntname
62
- [skevofilaxc] python3 --version
63
- Python 3.10.14 (it should return)
64
- [skevofilaxc] pip install eqcctpro
65
- ```
66
- You will have access to **EQCCTPro** and its capabilities, however, it is **highly** recommended you pull the `EQCCTPro` folder to gain access to the sample waveform data to help you get acquainted with **EQCCTPro's** functionality.
67
- You can pull the `EQCCTPro` folder by running the following commands:
68
-
69
- ```sh
70
- [skevofilaxc] mkdir my_work_directory
71
- [skevofilaxc] cd my_work_directory
72
- [skevofilaxc] git clone --depth 1 --filter=tree:0 https://github.com/ut-beg-texnet/eqcct.git --sparse
73
- [skevofilaxc] cd eqcct
74
- [skevofilaxc] git sparse-checkout set eqcctpro
75
- ```
76
-
77
- If you wish to install **EQCCTPro** with the sample waveform data as **originally intended for first-time users**, and or are having trouble installing Python 3.10.14, there has been a precreated conda environment under the `EQCCTPro` folder that will install the necessary packages
78
- and dependencies needed for **EQCCTPro** to run (method 2).
79
-
80
- You can pull the `EQCCTPro` folder, create the precreated conda environment, and activate it as originally intended for first-time users using the following commands:
81
- ```sh
82
- [skevofilaxc] mkdir my_work_directory
83
- [skevofilaxc] cd my_work_directory
84
- [skevofilaxc] git clone --depth 1 --filter=tree:0 https://github.com/ut-beg-texnet/eqcct.git --sparse
85
- [skevofilaxc] cd eqcct
86
- [skevofilaxc] git sparse-checkout set eqcctpro
87
- [skevofilaxc] conda env create -f environment.yml
88
- [skevofilaxc] conda activate eqcctpro
89
- ```
90
-
91
- After creating and activating the conda environment, install the **EQCCTPro Python package** using the following command:
92
- ```sh
93
- [skevofilaxc] pip install eqcctpro
94
- ```
95
- The pip package will install the remaining packages needed for **EQCCTPro** to work. More information on the eqcctpro pip package can be found at our PyPi project link here [(EQCCTPro)](https://pypi.org/project/eqcctpro/).
96
-
97
- ## Creating a Test Workspace Environment
98
- It's highly suggested to create a workspace environment to first understand how eqcctpro works.
99
- Sample seismic waveform data from 50 TexNet stations have provided in the eqcctpro repository under the `sample_1_minute_data.zip` file.
100
-
101
- After downloading the .zip file, either individually or through the git pull methods, run the following command to unzip it:
102
- ```sh
103
- [skevofilaxc] unzip sample_1_minute_data.zip
104
- ```
105
- It's contents will look like:
106
- ```sh
107
- [skevofilaxc sample_1_minute_data]$ ls
108
- AT01 CF01 DG05 EF54 EF76 HBVL MB09 MB21 MID02 ODSA PB16 PB25 PB35 PB52 PH02 SM03 WB11
109
- BB01 CT02 DG09 EF63 FOAK4 HNDO MB13 MB25 MID03 PB04 PB17 PB26 PB39 PB54 PL01 SMWD WB12
110
- BP01 DB02 EF02 EF75 FW13 MB06 MB19 MID01 MO01 PB11 PB18 PB34 PB42 PECS SM02 WB06
111
- ```
112
- Where each subdirectory is named after station code, and is made up of mSEED files of different poses:
113
- ```sh
114
- [skevofilaxc PB35]$ ls
115
- TX.PB35.00.HH1__20241215T115800Z__20241215T120100Z.mseed TX.PB35.00.HHZ__20241215T115800Z__20241215T120100Z.mseed
116
- TX.PB35.00.HH2__20241215T115800Z__20241215T120100Z.mseed
117
- ```
118
- EQCCT only needs one pose for the detection to occur, however more poses allow for better detection of the direction of the P and S waves.
119
-
120
- You are now set up for testing.
121
- ## Usage
122
- There are three main capabilities of EQCCTPro:
123
- 1. Process mSEED data from singular or multiple seismic stations using either CPUs or GPUs
124
- 2. Evaluate your system to identify the optimal parallelization configurations needed to get the minimum runtime performance out of your system
125
- 3. Identify and return back the optimal parallelization configurations for both specific and general-use usecases for both CPU (a) and GPU applications (b)
126
-
127
- These capabilities are achieved by the following functions in order respect to the above descriptions:
128
- **EQCCTMSeedRunner (1)**, **EvaluateSystem (2)**, **OptimalCPUConfigurationFinder (3a)**, **OptimalGPUConfigurationFinder (3b)**.
129
-
130
- ### Processing mSEED data using EQCCTPro (EQCCTMSeedRunner)
131
- To use EQCCTPro to process mSEED from various seismic stations, use the **EQCCTMSeedRunner** class.
132
- **EQCCTMSeedRunner** enables users to process multiple mSEED from a given input directory. The input directory is made up of station directories such as:
133
-
134
- ```sh
135
- [skevofilaxc sample_1_minute_data]$ ls
136
- AT01 CF01 DG05 EF54 EF76 HBVL MB09 MB21 MID02 ODSA PB16 PB25 PB35 PB52 PH02 SM03 WB11
137
- BB01 CT02 DG09 EF63 FOAK4 HNDO MB13 MB25 MID03 PB04 PB17 PB26 PB39 PB54 PL01 SMWD WB12
138
- BP01 DB02 EF02 EF75 FW13 MB06 MB19 MID01 MO01 PB11 PB18 PB34 PB42 PECS SM02 WB06
139
- ```
140
- Where each subdirectory is named after station code. If you wish to use create your own input directory with custom information, **please follow the above naming convention.** Otherwise, EQCCTPro will **not** work.
141
-
142
- Within each subdirectory, such as PB35, it is made up of mSEED files of different poses (EX. N, E, Z):
143
- ```sh
144
- [skevofilaxc PB35]$ ls
145
- TX.PB35.00.HH1__20241215T115800Z__20241215T120100Z.mseed TX.PB35.00.HHZ__20241215T115800Z__20241215T120100Z.mseed
146
- TX.PB35.00.HH2__20241215T115800Z__20241215T120100Z.mseed
147
- ```
148
- EQCCT only needs one pose for the detection to occur, however more poses allow for better detection of the direction of the P and S waves.
149
-
150
- After setting up or utilizing the provided sample waveform directory, and install eqcctpro, import **EQCCTMseedRunner** as show below:
151
-
152
- ```python
153
- from eqcctpro import EQCCTMSeedRunner
154
-
155
- eqcct_runner = EQCCTMSeedRunner(
156
- use_gpu=False,
157
- intra_threads=1,
158
- inter_threads=1,
159
- cpu_id_list=[0,1,2,3,4],
160
- input_dir='/path/to/mseed',
161
- output_dir='/path/to/outputs',
162
- log_filepath='/path/to/outputs/eqcctpro.log',
163
- P_threshold=0.001,
164
- S_threshold=0.02,
165
- p_model_filepath='/path/to/model_p.h5',
166
- s_model_filepath='/path/to/model_s.h5',
167
- number_of_concurrent_predictions=5,
168
- best_usecase_config=True,
169
- csv_dir='/path/to/csv',
170
- selected_gpus=[0],
171
- set_vram_mb=24750,
172
- specific_stations='AT01, BP01, DG05'
173
- )
174
- eqcct_runner.run_eqcctpro()
175
- ```
176
-
177
- **EQCCTMseedRunner** has multiple input paramters that need to be configured and are defined below:
178
-
179
- - **`use_gpu (bool)`: True or False**
180
- - Tells Ray to use either the GPU(s) (True) or CPUs (False) on your computer to process the waveforms in the entire workflow
181
- - Further specification of which GPU(s) and CPU(s) are provided in the parameters below
182
- - **`intra_threads (int)`: default = 1**
183
- - Controls how many intra-parallelism threads Tensorflow can use
184
- - **`inter_threads (int)`: default = 1**
185
- - Controls how many inter-parallelism threads Tensorflow can use
186
- - **`cpu_id_list (list)`: default = [1]**
187
- - List that defines which specific CPU cores that sched_setaffinity will allocate for executing the current EQCCTPro process.
188
- - Allows for specific allocation and limitation of CPUs for a given EQCCTPro process
189
- - "I want this program to run only on these specific cores."
190
- - **`input_dir (str)`**
191
- - Directory path to the the mSEED directory
192
- - EX. `/home/skevofilaxc/my_work_directory/eqcct/eqcctpro/sample_1_minute_data`
193
- - **`output_dir (str)`**
194
- - Directory path to where the output picks and logs will be sent
195
- - Doesn't need to exist, will be created if doesn't exist
196
- - Recommended to be in the same working directory as the input directory for convience
197
- - **`log_filepath (str)`**
198
- - Filepath to where the EQCCTPro log will be written to and stored
199
- - Doesn't need to exist, will be created if doesn't exist
200
- - Recommended to be **in** the **output directory** and called **eqcctpro.log**, however the name can be changed for your own purposes
201
- - **`P_threshold (float)`: default = 0.001**
202
- - Threshold in which the P probabilities above it will be considered as P arrival
203
- - **`S_threshold (float)`: default = 0.02**
204
- - Threshold in which the S probabilities above it will be considered as S arrival
205
- - **`p_model_filepath (str)`**
206
- - Filepath to where the P EQCCT detection model is stored
207
- - **`s_model_filepath (str)`**
208
- - Filepath to where the S EQCCT detection model is stored
209
- - **`number_of_concurrent_predictions (int)`**
210
- - The number of concurrent EQCCT detection tasks that can happen simultaneously on a given number of resources
211
- - EX. if number_of_concurrent_predictions = 5, there will be up to 5 EQCCT instances analyzing 5 different waveforms at the sametime
212
- - Best to use the optimal amount for your hardware, which can be identified using **EvaluateSystem** (below)
213
- - **`best_usecase_config (bool)`: default = False**
214
- - If True, will override inputted cpu_id_list, number_of_concurrent_predictions, intra_threads, inter_threads values for the best overall usecase configurations
215
- - Best overall usecase configurations are defined as the best overall input configurations that minimize runtime while doing the most amount of processing with your available hardware
216
- - Can only be used if EvaluateSystem has been run
217
- - **`csv_dir (str)`**
218
- - Directory path containing the CSV's outputted by EvaluateSystem that contain the trial data that will be used to find the best_usecase_config
219
- - Script will look for specific files, will only exist if EvaluateSystem has been run
220
- - **`selected_gpus (list)`: default = None**
221
- - List of GPU IDs on your computer you want to use if `use_gpu = True`
222
- - None existing GPU IDs will cause the code to exit
223
- - **`set_vram_mb (float)`**
224
- - Value of the maximum amount of VRAM EQCCTPro can use
225
- - Must be a real value that is based on your hardware's physical memory space, if it exceeds the space the code will break due to **OutOfMemoryError**
226
- - **`specific_stations (str)`: default = None**
227
- - String that contains the "list" of stations you want to only analyze
228
- - EX. Out of the 50 sample stations in `sample_1_minute_data`, if I only want to analyze AT01, BP01, DG05, then specific_stations='AT01, BP01, DG05'.
229
- - Removes the need to move station directories around to be used as input, can contain all stations in one directory for access
230
- - **`cpu_id_list (list)`: default = [1]**
231
- - List that defines which specific CPU cores that sched_setaffinity will allocate for executing the current EQCCTPro process.
232
- - Allows for specific allocation and limitation of CPUs for a given EQCCTPro process
233
- - "I want this program to run only on these specific cores."
234
- ### Evaluating Your Systems Runtime Performance Capabilites
235
- To evaluate your system’s runtime performance capabilites for both your CPU(s) and GPU(s), the **EvaluateSystem** class allows you to autonomously evaluate your system:
236
-
237
- ```python
238
- from eqcctpro import EvaluateSystem
239
-
240
- eval_gpu = EvaluateSystem(
241
- mode='gpu',
242
- intra_threads=1,
243
- inter_threads=1,
244
- input_dir='/path/to/mseed',
245
- output_dir='/path/to/outputs',
246
- log_filepath='/path/to/outputs/eqcctpro.log',
247
- csv_dir='/path/to/csv',
248
- P_threshold=0.001,
249
- S_threshold=0.02,
250
- p_model_filepath='/path/to/model_p.h5',
251
- s_model_filepath='/path/to/model_s.h5',
252
- stations2use=2,
253
- cpu_id_list=[0,1],
254
- set_vram_mb=24750,
255
- selected_gpus=[0]
256
- )
257
- eval_gpu.evaluate()
258
- ```
259
- **EvaluateSystem** will iterate through different combinations of CPU(s), Concurrent Predictions, and Workloads (stations), as well as GPU(s), and the amount of VRAM (MB) each Concurrent Prediction can use.
260
- **EvaluateSystem** will take time, depending on the number of CPU/GPUs, the amount of VRAM available, and the total workload that needs to be tested. However, after doing the testing once for most if not all usecases,
261
- the trial data will be available and can be used to identify the optimal input parallelization configurations for **EQCCTMSeedRunner** to use to get the maximum amount of processing out of your system in the shortest amonut of time.
262
-
263
- The following input parameters need to be configurated for **EvaluateSystem** to evaluate your system based on your desired utilization of EQCCTPro:
264
-
265
- - **`mode (str)`**
266
- - Can be either `cpu` or `gpu`
267
- - Tells `EvaluateSystem` which configuration trials should it iterate through
268
- - **`intra_threads (int)`: default = 1**
269
- - Controls how many intra-parallelism threads Tensorflow can use
270
- - **`inter_threads (int)`: default = 1**
271
- - Controls how many inter-parallelism threads Tensorflow can use
272
- - **`input_dir (str)`**
273
- - Directory path to the the mSEED directory
274
- - EX. /home/skevofilaxc/my_work_directory/eqcct/eqcctpro/sample_1_minute_data
275
- - **`output_dir (str)`**
276
- - Directory path to where the output picks and logs will be sent
277
- - Doesn't need to exist, will be created if doesn't exist
278
- - Recommended to be in the same working directory as the input directory for convience
279
- - **`log_filepath (str)`**
280
- - Filepath to where the EQCCTPro log will be written to and stored
281
- - Doesn't need to exist, will be created if doesn't exist
282
- - Recommended to be **in** the **output directory** and called **eqcctpro.log**, however the name can be changed for your own purposes
283
- - **`csv_dir (str)`**
284
- - Directory path where the CSV's outputted by EvaluateSystem will be saved
285
- - Doesn't need to exist, will be created if doesn't exist
286
- - **`P_threshold (float)`: default = 0.001**
287
- - Threshold in which the P probabilities above it will be considered as P arrival
288
- - **`S_threshold (float)`: default = 0.02**
289
- - Threshold in which the S probabilities above it will be considered as S arrival
290
- - **`p_model_filepath (str)`**
291
- - Filepath to where the P EQCCT detection model is stored
292
- - **`s_model_filepath (str)`**
293
- - Filepath to where the S EQCCT detection model is stored
294
- - **`stations2use (int)`: default = None**
295
- - Controls the maximum amount of stations EvaluateSystem can use in its trial iterations
296
- - Sample data has been provided so that the maximum is 50, however, if using custom data, configure for your specific usecase
297
- - **`cpu_id_list (list)`: default = [1]**
298
- - List that defines which specific CPU cores that sched_setaffinity will allocate for executing the current EQCCTPro process and **is the maximum amount of cores EvaluteSystem can use in its trial iterations**
299
- - Allows for specific allocation and limitation of CPUs for a given EQCCTPro process
300
- - "I want this program to run only on these specific cores."
301
- - Must be at least 1 CPU if using GPUs (Ray needs CPUs to manage the Raylets (concurrent tasks), however the processing of the waveform is done on the GPU)
302
- - **`set_vram_mb (float)`**
303
- - Value of the maximum amount of VRAM EQCCTPro can use
304
- - Must be a real value that is based on your hardware's physical memory space, if it exceeds the space the code will break due to OutOfMemoryError
305
- - **`selected_gpus (list)`: default = None**
306
- - List of GPU IDs on your computer you want to use if `mode = 'gpu'`
307
- - Non-existing GPU IDs will cause the code to exit
308
-
309
- ### Finding Optimal CPU/GPU Configurations
310
- After running **EvalutateSystem**, you can use either the **OptimalCPUConfigurationFinder** or the **OptimalGPUConfigurationFinder** determine the best CPU or GPU configurations (respectively) for your specific usecase:
311
-
312
- ```python
313
- from eqcctpro import OptimalCPUConfigurationFinder, OptimalGPUConfigurationFinder
314
-
315
- csv_filepath = '/path/to/csv'
316
-
317
- cpu_finder = OptimalCPUConfigurationFinder(csv_filepath)
318
- best_cpu_config = cpu_finder.find_best_overall_usecase()
319
- print(best_cpu_config)
320
-
321
- optimal_cpu_config = cpu_finder.find_optimal_for(cpu=3, station_count=2)
322
- print(optimal_cpu_config)
323
-
324
- gpu_finder = OptimalGPUConfigurationFinder(csv_filepath)
325
- best_gpu_config = gpu_finder.find_best_overall_usecase()
326
- print(best_gpu_config)
327
-
328
- optimal_gpu_config = gpu_finder.find_optimal_for(num_cpus=1, gpu_list=[0], station_count=1)
329
- print(optimal_gpu_config)
330
- ```
331
- Both **OptimalCPUConfigurationFinder** and **OptimalGPUConfigurationFinder** each have two usecases:
332
-
333
- 1. **`find_best_overall_usecase`**
334
- - Returns the best overall usecase configuration
335
- - Uses middle 50% of CPUs for moderate, balanced CPU usage, with the maximum amount of stations processed with the minimum runtime
336
- 2. **`find_optimal_for`**
337
- - Return the paralleliztion configurations (EX. concurrent predictions, intra/inter thread counts, vram, etc.) for a given number of CPU(s)/GPU(s) and stations
338
- - Enables users to quickly identify which input parameters should be used for the given amount of resources and workload they have for the minimum runtime possible on their computer
339
-
340
- A input CSV directory path must be passed for the classes to use as a reference point:
341
- - **`csv_filepath (str)`**
342
- - Directory path where the CSV's outputted by EvaluateSystem are
343
-
344
- Using **OptimalCPUConfigurationFinder.find_best_overall_usecase()**, no input parameters are needed. It will return back the best usecase parameters.
345
-
346
- For **OptimalCPUConfigurationFinder.find_optimal_for()**, the function requires two input parameters:
347
- - **`cpu (int)`**
348
- - The number of CPU(s) you want to use in your application
349
- - **`station_count (int)`**
350
- - The number of station(s) you want to use in your application
351
-
352
- **OptimalCPUConfigurationFinder.find_optimal_for()** will return back a trial data point containing the mimimum runtime based on your input paramters
353
-
354
- Similar to **OptimalCPUConfigurationFinder.find_best_overall_usecase()**, **OptimalGPUConfigurationFinder.find_best_overall_usecase()** will return back the best usecase parameters and no input parameters are needed.
355
-
356
- For **OptimalGPUConfigurationFinder.find_optimal_for()**, the function requires three input parameters:
357
- - **`cpu (int)`**
358
- - The number of CPU(s) you want to use in your application
359
- - **`gpu_list (list)`**
360
- - The specific GPU ID(s) you want to use in your application
361
- - Useful if you have multiple GPUs available and want to use/dedicate a specific one to using EQCCTPro
362
- - **`station_count (int)`**
363
- - The number of station(s) you want to use in your application
364
-
365
- ## Configuration
366
- The `environment.yml` file specifies the dependencies required to run EQCCTPro. Ensure you have the correct versions installed by using the provided conda environment setup.
367
-
368
- ## License
369
- EQCCTPro is provided under an open-source license. See LICENSE for details.
370
-
371
- ## Contact
372
- For inquiries or issues, please contact constantinos.skevofilax@austin.utexas.edu or victor.salles@beg.utexas.edu.
373
-
@@ -1,5 +0,0 @@
1
- eqcctpro/__init__.py,sha256=JK27ZrLxVDNHsdorp7UAislI8haH23rZhnEivVM7hgA,141
2
- eqcctpro-0.4.6.dist-info/METADATA,sha256=fgPT7RLqvOJvQxZYgDnF8doCIg--4I8l4BwbeDW7sVU,21373
3
- eqcctpro-0.4.6.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
4
- eqcctpro-0.4.6.dist-info/top_level.txt,sha256=u0cu2JdF7Z0ob7y4XdUCLoSGp_xOudAYz-fbsQ-B1yY,9
5
- eqcctpro-0.4.6.dist-info/RECORD,,