Metadata-Version: 2.1
Name: seisclass
Version: 0.1.7
Summary: Seismic event classification package
Home-page: https://github.com/yourusername/seisclass
Author: Jia Luozhao
Author-email: Jia Luozhao <lezhao.jia@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Jia Luozhao
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: homepage, https://github.com/yourusername/seisclass
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy >=1.19.0
Requires-Dist: obspy >=1.2.0
Requires-Dist: tensorflow >=2.0.0
Requires-Dist: keras >=2.3.0
Requires-Dist: joblib >=1.0.0
Requires-Dist: scikit-learn >=0.24.0
Requires-Dist: pandas >=1.1.0
Provides-Extra: test
Requires-Dist: pytest ; extra == 'test'

# seisclass

Seismic event classification package for identifying natural and non-natural earthquakes.

## Overview

`seisclass` is a Python package designed to classify seismic events using deep learning models. It provides one main function:
- `check_seed`: Analyzes a seismic data file (SEED format) with corresponding phase file, returning a comma-separated result string: event_type,earthquake_prob,explode_prob,collapse_prob

For detailed information about the program and to cite it in your research publications, please refer to the following papers:

[1] Jia, L., Chen, H., & Xing, K. (2022). Rapid classification of local seismic events using machine learning. Journal of Seismology, 26(5), 897-912.

[2] Jia, L., Chen, S., Li, Y., & Zheng, P. (2025). A Semisupervised Seismic Events Classifier Based on Generative Adversarial Network. Seismological Research Letters, 96(3), 2039-2051.

Git-Repository: [https://github.com/epnet2018/]

## Usage
### Basic Usage
```python
from seisclass import check_seed
# Analyze a SEED file with corresponding phase file
result = check_seed('path/to/seed/file', 'path/to/phase/file')
print(result)
```
### phase file format
The phase file should be in the following format:
```
station,channel,time,phase
```
where `station` is the station code, `channel` is the channel code, `time` is the arrival time of the phase, and `phase` is the phase type (e.g., P, S).

Net_code	Sta_code	Loc_id	Chn_code	Phase_name	Phase_time	Phase_time_frac	Resi	Mag_val	Distance	Azi

XX	XXXXX	00	HHZ	P	2025-09-20 03:20:39	7600	-1.903390	2.391120	53.238400	339.952000

YY	YYYYY	00	HHZ	P	2025-09-20 03:20:46	4100	-2.548810	2.651560	104.083000	90.712900

## Installation

You can install the package from PyPI:

```bash
pip install seisclass
```

Or install from source:

```bash
pip install .
```
## Dependencies
- numpy
- obspy
- tensorflow
- keras
- joblib
- scikit-learn
- pandas



### Advanced Usage

```python
# Specify a different model
result = check_seed('path/to/seed/file', 'path/to/phase/file', model_str='251111nw')
```

## Testing

To run the tests:

```bash
pytest
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Authors

- Jia Luozhao - [lezhao.jia At gmail.com](mailto:lezhao.jia At gmail.com)

