# magma-converter
Python package to convert CVGHM seismic data structures into SDS format.
## Install
```python
pip install magma-converter
```
## Supported Directory Structure (_Indonesia_)
| Volcano | directory_structure | Group |
|--------------------|--------------------------------------------------|-------------|
| Anak Krakatau | `kra`,`krakatau`,`anak krakatau`,`anak-krakatau` | SAC |
| Awu | `awu` | Seisan |
| Bromo | `bro`,`bromo` | SAC |
| Dieng** | `die`,`dieng` | SAC, Seisan |
| Dukono | `duk`,`dukono` | Seisan |
| Ibu | `ibu` | Seisan |
| Ijen* | `ije`,`ijen` | Ijen |
| Kelud | `kld`,`kelud` | Kelud |
| Lamongan | `lam`,`lamongan` | SAC |
| Lewotobi Laki-laki | `lwk`,`lewotobi laki-laki` | Seisan |
| Lokon | `lok`,`lokon` | Seisan |
| Mahawu | `mah`,`mahawu` | Seisan |
| Marapi | `mar`,`marapi` | SAC |
| Papandayan | `pap`,`papandayan` | SAC |
| Rinjani | `rin`,`rinjani` | SAC |
| Ruang | `rua`,`ruang` | Seisan |
| Semeru | `smr`,`semeru` | SAC |
| Soputan | `sop`,`soputan` | Seisan |
| Tambora | `tam`,`tambora` | Seisan |
| Tandikat | `tan`,`tandikat` | SAC |
*) Special case
**) Depends on time. For Dieng, SAC was used from 2013-08-12 to 2021-09-15 and 2023-10-16 to 2024-08-15.
Seisan was used from 2021-03-26 to 2023-10-16.
## How to
Run this codes:
```python
from magma_converter import Convert
input_dir = 'L:\\Ijen\\Seismik Ijen'
output_dir = 'L:\\converted'
start_date: str = "2019-01-01"
end_date: str = "2019-12-31"
convert = Convert(
input_dir=input_dir,
output_directory=output_dir,
directory_structure='ijen', # check table above
min_completeness=30, # convert to SDS if completeness of data greater than 30%
).between_dates(start_date, end_date)
convert.run()
```
## Check converting results
```python
convert.success
convert.failed
```
Example output for `convert.success` or `convert.failed`:
```json
[{'trace_id': 'VG.KRA1.00.EHZ',
'date': '2018-01-01',
'start_time': '2018-01-01 00:00:00',
'end_time': '2018-01-01 23:59:59',
'sampling_rate': 100.0,
'completeness': 99.7532986111111,
'file_location': 'L:\\converted\\SDS\\2018\\VG\\KRA1\\EHZ.D\\VG.KRA1.00.EHZ.D.2018.001'},
{'trace_id': 'VG.KRA2.00.EHZ',
'date': '2018-01-01',
'start_time': '2018-01-01 00:00:00',
'end_time': '2018-01-01 23:59:59',
'sampling_rate': 100.0,
'completeness': 99.99770833333334,
'file_location': 'L:\\converted\\SDS\\2018\\VG\\KRA2\\EHZ.D\\VG.KRA2.00.EHZ.D.2018.001'},
{'trace_id': 'VG.KRA3.00.EHZ',
'date': '2018-01-01',
'start_time': '2018-01-01 00:00:00',
'end_time': '2018-01-01 23:59:59',
'sampling_rate': 100.0,
'completeness': 99.79653935185185,
'file_location': 'L:\\converted\\SDS\\2018\\VG\\KRA3\\EHZ.D\\VG.KRA3.00.EHZ.D.2018.001'},
{'trace_id': 'VG.PULO.00.EHZ',
'date': '2018-01-01',
'start_time': '2018-01-01 00:00:00',
'end_time': '2018-01-01 23:59:59',
'sampling_rate': 100.0,
'completeness': 98.79126157407407,
'file_location': 'L:\\converted\\SDS\\2018\\VG\\PULO\\EHZ.D\\VG.PULO.00.EHZ.D.2018.001'},
{'trace_id': 'VG.SRTG.00.EHZ',
'date': '2018-01-01',
'start_time': '2018-01-01 00:00:00',
'end_time': '2018-01-01 23:59:59',
'sampling_rate': 100.0,
'completeness': 99.995625,
'file_location': 'L:\\converted\\SDS\\2018\\VG\\SRTG\\EHZ.D\\VG.SRTG.00.EHZ.D.2018.001'},
{'trace_id': 'VG.INFR.00.EHZ',
'date': '2018-01-01',
'start_time': '2018-01-01 00:00:00',
'end_time': '2018-01-01 23:59:59',
'sampling_rate': 100.0,
'completeness': 99.99770833333334,
'file_location': 'L:\\converted\\SDS\\2018\\VG\\INFR\\EHZ.D\\VG.INFR.00.EHZ.D.2018.001'}]
```
Raw data
{
"_id": null,
"home_page": null,
"name": "magma-converter",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "seismic, volcano, volcanology, convert, sds, seiscomp, mseed",
"author": null,
"author_email": "Martanto <martanto@live.com>, Devy Kamil Syahbana <devy.syahbana@gmail.com>, Syarif Abdul Manaf <riefmof@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/89/3e/880639958764560937c887a718675ab3e5d3d6651dc2abe5c7d342c4c181/magma_converter-1.8.10.tar.gz",
"platform": null,
"description": "# magma-converter\nPython package to convert CVGHM seismic data structures into SDS format.\n\n## Install\n```python\npip install magma-converter\n```\n\n## Supported Directory Structure (_Indonesia_)\n| Volcano | directory_structure | Group |\n|--------------------|--------------------------------------------------|-------------|\n| Anak Krakatau | `kra`,`krakatau`,`anak krakatau`,`anak-krakatau` | SAC |\n| Awu | `awu` | Seisan |\n| Bromo | `bro`,`bromo` | SAC |\n| Dieng** | `die`,`dieng` | SAC, Seisan |\n| Dukono | `duk`,`dukono` | Seisan |\n| Ibu | `ibu` | Seisan |\n| Ijen* | `ije`,`ijen` | Ijen |\n| Kelud | `kld`,`kelud` | Kelud |\n| Lamongan | `lam`,`lamongan` | SAC |\n| Lewotobi Laki-laki | `lwk`,`lewotobi laki-laki` | Seisan |\n| Lokon | `lok`,`lokon` | Seisan |\n| Mahawu | `mah`,`mahawu` | Seisan |\n| Marapi | `mar`,`marapi` | SAC |\n| Papandayan | `pap`,`papandayan` | SAC |\n| Rinjani | `rin`,`rinjani` | SAC |\n| Ruang | `rua`,`ruang` | Seisan |\n| Semeru | `smr`,`semeru` | SAC |\n| Soputan | `sop`,`soputan` | Seisan |\n| Tambora | `tam`,`tambora` | Seisan |\n| Tandikat | `tan`,`tandikat` | SAC |\n\n*) Special case\n\n**) Depends on time. For Dieng, SAC was used from 2013-08-12 to 2021-09-15 and 2023-10-16 to 2024-08-15. \nSeisan was used from 2021-03-26 to 2023-10-16. \n\n## How to\nRun this codes:\n```python\nfrom magma_converter import Convert\n\ninput_dir = 'L:\\\\Ijen\\\\Seismik Ijen'\noutput_dir = 'L:\\\\converted'\nstart_date: str = \"2019-01-01\"\nend_date: str = \"2019-12-31\"\n\nconvert = Convert(\n input_dir=input_dir,\n output_directory=output_dir,\n directory_structure='ijen', # check table above\n min_completeness=30, # convert to SDS if completeness of data greater than 30%\n).between_dates(start_date, end_date)\n\nconvert.run()\n```\n\n## Check converting results\n```python\nconvert.success\nconvert.failed\n```\nExample output for `convert.success` or `convert.failed`:\n```json\n[{'trace_id': 'VG.KRA1.00.EHZ',\n 'date': '2018-01-01',\n 'start_time': '2018-01-01 00:00:00',\n 'end_time': '2018-01-01 23:59:59',\n 'sampling_rate': 100.0,\n 'completeness': 99.7532986111111,\n 'file_location': 'L:\\\\converted\\\\SDS\\\\2018\\\\VG\\\\KRA1\\\\EHZ.D\\\\VG.KRA1.00.EHZ.D.2018.001'},\n {'trace_id': 'VG.KRA2.00.EHZ',\n 'date': '2018-01-01',\n 'start_time': '2018-01-01 00:00:00',\n 'end_time': '2018-01-01 23:59:59',\n 'sampling_rate': 100.0,\n 'completeness': 99.99770833333334,\n 'file_location': 'L:\\\\converted\\\\SDS\\\\2018\\\\VG\\\\KRA2\\\\EHZ.D\\\\VG.KRA2.00.EHZ.D.2018.001'},\n {'trace_id': 'VG.KRA3.00.EHZ',\n 'date': '2018-01-01',\n 'start_time': '2018-01-01 00:00:00',\n 'end_time': '2018-01-01 23:59:59',\n 'sampling_rate': 100.0,\n 'completeness': 99.79653935185185,\n 'file_location': 'L:\\\\converted\\\\SDS\\\\2018\\\\VG\\\\KRA3\\\\EHZ.D\\\\VG.KRA3.00.EHZ.D.2018.001'},\n {'trace_id': 'VG.PULO.00.EHZ',\n 'date': '2018-01-01',\n 'start_time': '2018-01-01 00:00:00',\n 'end_time': '2018-01-01 23:59:59',\n 'sampling_rate': 100.0,\n 'completeness': 98.79126157407407,\n 'file_location': 'L:\\\\converted\\\\SDS\\\\2018\\\\VG\\\\PULO\\\\EHZ.D\\\\VG.PULO.00.EHZ.D.2018.001'},\n {'trace_id': 'VG.SRTG.00.EHZ',\n 'date': '2018-01-01',\n 'start_time': '2018-01-01 00:00:00',\n 'end_time': '2018-01-01 23:59:59',\n 'sampling_rate': 100.0,\n 'completeness': 99.995625,\n 'file_location': 'L:\\\\converted\\\\SDS\\\\2018\\\\VG\\\\SRTG\\\\EHZ.D\\\\VG.SRTG.00.EHZ.D.2018.001'},\n {'trace_id': 'VG.INFR.00.EHZ',\n 'date': '2018-01-01',\n 'start_time': '2018-01-01 00:00:00',\n 'end_time': '2018-01-01 23:59:59',\n 'sampling_rate': 100.0,\n 'completeness': 99.99770833333334,\n 'file_location': 'L:\\\\converted\\\\SDS\\\\2018\\\\VG\\\\INFR\\\\EHZ.D\\\\VG.INFR.00.EHZ.D.2018.001'}]\n```\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Convert CVGHM seismic data structures into SDS format.",
"version": "1.8.10",
"project_urls": {
"Homepage": "https://github.com/martanto/magma-converter",
"Issues": "https://github.com/martanto/magma-converter/issues"
},
"split_keywords": [
"seismic",
" volcano",
" volcanology",
" convert",
" sds",
" seiscomp",
" mseed"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "206ee3498f7123131d5f9de009ee3f91272e5f6847f43a43bc56121c178c0f14",
"md5": "f271ccf398d5ae94c55dddbc3be11ddd",
"sha256": "b98b00bf8f58a2f0e033f410ab4a2c06335e86f1ac436cbced14062ac81ff5f5"
},
"downloads": -1,
"filename": "magma_converter-1.8.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f271ccf398d5ae94c55dddbc3be11ddd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 28868,
"upload_time": "2024-11-28T01:24:05",
"upload_time_iso_8601": "2024-11-28T01:24:05.277103Z",
"url": "https://files.pythonhosted.org/packages/20/6e/e3498f7123131d5f9de009ee3f91272e5f6847f43a43bc56121c178c0f14/magma_converter-1.8.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "893e880639958764560937c887a718675ab3e5d3d6651dc2abe5c7d342c4c181",
"md5": "ad4691e552088ca2ef354d515172ea7e",
"sha256": "dc9984c726e8a2a5ef39f0fe22083a83f8aebe89df0a4f042b48ab0a98861535"
},
"downloads": -1,
"filename": "magma_converter-1.8.10.tar.gz",
"has_sig": false,
"md5_digest": "ad4691e552088ca2ef354d515172ea7e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 23825,
"upload_time": "2024-11-28T01:24:07",
"upload_time_iso_8601": "2024-11-28T01:24:07.104012Z",
"url": "https://files.pythonhosted.org/packages/89/3e/880639958764560937c887a718675ab3e5d3d6651dc2abe5c7d342c4c181/magma_converter-1.8.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-28 01:24:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "martanto",
"github_project": "magma-converter",
"github_not_found": true,
"lcname": "magma-converter"
}