https://github.com/andrebelem/pymhw
Small scripts to calculate statistics of Marine Heat Haves
https://github.com/andrebelem/pymhw
Last synced: 9 months ago
JSON representation
Small scripts to calculate statistics of Marine Heat Haves
- Host: GitHub
- URL: https://github.com/andrebelem/pymhw
- Owner: andrebelem
- License: gpl-3.0
- Created: 2024-06-21T18:12:05.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-15T19:32:34.000Z (almost 2 years ago)
- Last Synced: 2025-03-16T16:53:13.467Z (about 1 year ago)
- Language: Jupyter Notebook
- Size: 2.02 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyMHW: A Python Package for Marine Heatwave Detection and Analysis
**Attention**! Still under construction!!
`pymhw` is a Python package to calculate marine heatwaves (MHW) based on sea surface temperature (SST) data.
[](https://zenodo.org/doi/10.5281/zenodo.12700290)
Please, cite this DOI and check new releases.
## Installation
You can install the package using pip:
`pip install git+https://github.com/andrebelem/pymhw.git`
## Usage
```python
import pandas as pd
import pymhw
# Assuming df and df_clima are your already loaded DataFrames
df2 = pymhw.detect_MHW(df, df_clima)
mhw_periods = pymhw.calculate_mhw_periods(df2)
print(mhw_periods) #<-- results are condensated in a dataframe
```
## Example Analysis
There is an example (`Test_Marine_Heat_Waves_detection.ipynb`) with an overview of how to use the pymhw package for analyzing marine heatwaves.
**Key Steps:**
- Detect MHWs: Use the detect_MHW function to preprocess and detect potential MHW events in your SST data.
- Calculate MHW Periods: Use the calculate_mhw_periods function to identify and categorize MHW periods based on their intensity.
- Visualizing MHWs: Some example of graphics you can use (on the `.ipynb` file).
**Future code:**
- Include subsurface analysis and more statistics
- Create a MHW index or impact index
- Perform wavelet analysis on MHW index
**Attention**! This repository is still under construction!!