dsar


Namedsar JSON
Version 1.1.0 PyPI version JSON
download
home_pageNone
SummaryCalculating Displacement Seismic Amplitude Ratio (DSAR) Value
upload_time2024-11-20 03:34:59
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseNone
keywords seismic volcano volcanology dsar
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            #  Displacement Seismic Amplitude Ratio (DSAR)

## How to Use
### Install using pip:
```python
pip install dsar
```

### Import `dsar` module
```python
from dsar import DSAR, PlotDsar
```

### Initiate DSAR
```python
dsar = DSAR(
    input_dir="G:\\Output\\Converted\\SDS",
    directory_structure='SDS',
    start_date="2024-01-01",
    end_date="2024-04-22",
    station="RUA3",
    channel="EHZ",
    resample="10min" # default
)
```

See https://github.com/martanto/magma-converter for supported `directory_structure`.

### Run DSAR
```python
dsar.run()
```

### Results/Output directory
Output directory would be as the same folder where DSAR code is running. It will create `output` directory.

### Plot DSAR
Initiate DSAR plot
```python
plot = PlotDsar(
    start_date="2024-01-01",
    end_date="2024-04-22",
    station="RUA3",
    channel="EHZ"
)
```

### Get combined dataframe to plot
```python
df = plot.df
```
The output of dataframe will be saved as CSV:
```text
✅ Saved to D:\Project\dsar\output\dsar\VG.RUA3.00.EHZ\combined_10min_VG.RUA3.00.EHZ.csv
```

Plot DSAR:
```python
plot.plot(
    interval_day=7,
    y_min=85,
    y_max=225,
    save=True,
    file_type='jpg',
)
```
Output:
```text
✅ Saved to D:\Project\dsar\output\dsar\VG.RUA3.00.EHZ\combined_10min_VG.RUA3.00.EHZ.csv
📷 Figure saved to: D:\Project\dsar\output\figures\dsar\VG.RUA3.00.EHZ\VG.RUA3.00.EHZ_10min_2024-01-01-2024-04-22.jpg
```

Figures:
![output.png](https://github.com/martanto/dsar/blob/master/images/output.png?raw=true)


## References
> Caudron, C., et al., 2019, Change in seismic attenuation as a long-term precursor of gas-driven
eruptions: Geology, https://doi.org/10.1130/G46107.1  
> 
> Chardot, L., Jolly, A. D., Kennedy, B. M., Fournier, N., & Sherburn, S. (2015). Using volcanic tremor for eruption forecasting at White Island volcano (Whakaari), New Zealand. Journal of Volcanology and Geothermal Research, 302, 11–23. https://doi.org/10.1016/j.jvolgeores.2015.06.001


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dsar",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "seismic, volcano, volcanology, dsar",
    "author": null,
    "author_email": "Martanto <martanto@live.com>, Corentin Caudron <corentin@ulb.be>",
    "download_url": "https://files.pythonhosted.org/packages/9a/1d/6602177ce251ea075b5bb04bfe484751e876618233b15833fc0628619293/dsar-1.1.0.tar.gz",
    "platform": null,
    "description": "#  Displacement Seismic Amplitude Ratio (DSAR)\n\n## How to Use\n### Install using pip:\n```python\npip install dsar\n```\n\n### Import `dsar` module\n```python\nfrom dsar import DSAR, PlotDsar\n```\n\n### Initiate DSAR\n```python\ndsar = DSAR(\n    input_dir=\"G:\\\\Output\\\\Converted\\\\SDS\",\n    directory_structure='SDS',\n    start_date=\"2024-01-01\",\n    end_date=\"2024-04-22\",\n    station=\"RUA3\",\n    channel=\"EHZ\",\n    resample=\"10min\" # default\n)\n```\n\nSee https://github.com/martanto/magma-converter for supported `directory_structure`.\n\n### Run DSAR\n```python\ndsar.run()\n```\n\n### Results/Output directory\nOutput directory would be as the same folder where DSAR code is running. It will create `output` directory.\n\n### Plot DSAR\nInitiate DSAR plot\n```python\nplot = PlotDsar(\n    start_date=\"2024-01-01\",\n    end_date=\"2024-04-22\",\n    station=\"RUA3\",\n    channel=\"EHZ\"\n)\n```\n\n### Get combined dataframe to plot\n```python\ndf = plot.df\n```\nThe output of dataframe will be saved as CSV:\n```text\n\u2705 Saved to D:\\Project\\dsar\\output\\dsar\\VG.RUA3.00.EHZ\\combined_10min_VG.RUA3.00.EHZ.csv\n```\n\nPlot DSAR:\n```python\nplot.plot(\n    interval_day=7,\n    y_min=85,\n    y_max=225,\n    save=True,\n    file_type='jpg',\n)\n```\nOutput:\n```text\n\u2705 Saved to D:\\Project\\dsar\\output\\dsar\\VG.RUA3.00.EHZ\\combined_10min_VG.RUA3.00.EHZ.csv\n\ud83d\udcf7 Figure saved to: D:\\Project\\dsar\\output\\figures\\dsar\\VG.RUA3.00.EHZ\\VG.RUA3.00.EHZ_10min_2024-01-01-2024-04-22.jpg\n```\n\nFigures:\n![output.png](https://github.com/martanto/dsar/blob/master/images/output.png?raw=true)\n\n\n## References\n> Caudron, C., et al., 2019, Change in seismic attenuation as a long-term precursor of gas-driven\neruptions: Geology, https://doi.org/10.1130/G46107.1  \n> \n> Chardot, L., Jolly, A. D., Kennedy, B. M., Fournier, N., & Sherburn, S. (2015). Using volcanic tremor for eruption forecasting at White Island volcano (Whakaari), New Zealand. Journal of Volcanology and Geothermal Research, 302, 11\u201323. https://doi.org/10.1016/j.jvolgeores.2015.06.001\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Calculating Displacement Seismic Amplitude Ratio (DSAR) Value",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/martanto/dsar",
        "Issues": "https://github.com/martanto/dsar/issues"
    },
    "split_keywords": [
        "seismic",
        " volcano",
        " volcanology",
        " dsar"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8122889794153f4b29c668734145e1173f01a782beea6c4cc14217493c781b43",
                "md5": "d8859f2db728951ab9b2018270e4bb89",
                "sha256": "3322b21e80eed20ea434e191f5002e993c33f9b8e1df25fec9236188a55058fa"
            },
            "downloads": -1,
            "filename": "dsar-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d8859f2db728951ab9b2018270e4bb89",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 9830,
            "upload_time": "2024-11-20T03:34:57",
            "upload_time_iso_8601": "2024-11-20T03:34:57.708584Z",
            "url": "https://files.pythonhosted.org/packages/81/22/889794153f4b29c668734145e1173f01a782beea6c4cc14217493c781b43/dsar-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9a1d6602177ce251ea075b5bb04bfe484751e876618233b15833fc0628619293",
                "md5": "19a9da2b92058d92d6810d1c24a51a60",
                "sha256": "c35b8083d0828304d74e0bd301bcf5a2af1951268335757d9e6d65b8e9990a63"
            },
            "downloads": -1,
            "filename": "dsar-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "19a9da2b92058d92d6810d1c24a51a60",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 8957,
            "upload_time": "2024-11-20T03:34:59",
            "upload_time_iso_8601": "2024-11-20T03:34:59.310585Z",
            "url": "https://files.pythonhosted.org/packages/9a/1d/6602177ce251ea075b5bb04bfe484751e876618233b15833fc0628619293/dsar-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-20 03:34:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "martanto",
    "github_project": "dsar",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "dsar"
}
        
Elapsed time: 0.83758s