XMHW - Xarray based Marine HeatWave code -
XMHW identifies marine heatwaves from a timseries of Sea Surface Temperature data and calculates statistics associated to the detected heatwaves. It is based on the marineHeatWaves code by Eric Olivier
Functions:
- threshold
- detect
- block_average work in progress!!
- mhw_rank work in progress!!
As this code uses xarray results are xarray datasets.
You can install the latest version of xmhw directly from conda (coecms channel)
conda install -c coecms -c conda-forge xmhw
If you want to install an unstable version or a different branch:
- git clone https://github.com/coecms/xmhw
- git checkout <branch-name> (if installing a a different branch from master)
- cd xmhw
- python setup.py install or pip install ./ use --user with either othe commands if you want to install it in ~/.local
Some examples of how to use the functions and explanations of how the functions work are shown in the readthedocs documentation linked above and the xmhw_demo.ipynb notebook <https://github.com/coecms/xmhw/blob/master/docs/xmhw_demo.ipynb>_ in the docs folder.
- Main updates:
- Fixed missing initialisation of point boolean variable to False
- Main updates:
- Updated coordinates handling following recent updates of xarray
- Added a separate workflow if only a single point time-series is passed as input, the functions are called in the same way, the code will check number of dimensions and if when only one dimension I present it will skip the operations needed to work with multidimensional grids
- Main updates:
- Added a tstep (timestep) option to use the original timestep of the timeseries passed as input as step, rather than assuming data is daily. This allows to calculate climatologies and detect mhw events at different frequency.
- Added conda support
- Added readthedocs documentation
- Main updates:
- redesigned threshold function, to make it faster In particular there is an option to run the averages and percentile calculation without skipping NaNs. This makes the calculation faster.
- Instead of delayed the entire main function calculating both climatologies, the calculation of percentile and seasonal average were further separated so they are now both delayed, so it is the runavg() function used to smooth them. This allows more parallelisation.
- There are more options to manage the handling of NaNs this are explained in the demo notebook
- Improved documentation of functions
This is a work in progress, I tested both threshold and detect and these can reproduced Eric Olivier results with the data I used. Still I haven't extensively tested this and most unit tests in the code need updating. In particular the code is potentially not ready for timeseries with a 360 days calendar year
I am currently working on block_average and mhw_rank functions.