coecms / xmhw

Xarray version of Marine Heatwaves code by Eric Olivier
https://xmhw.readthedocs.io/en/latest/
Apache License 2.0
21 stars 10 forks source link

Reorgthresh #22

Closed paolap closed 3 years ago

paolap commented 3 years ago

This "version" has a working threshold and detect functions reproducing nearly exactly Eric code results. Only differences are for threshold with smoothPercentile around start and end of climatologies, i.e. around start and end of years. These are negligible in the examples we run up to now. This "version" also has a draft of block_average. While I focused on reproducing Eric code, there are a few differences introduced

Treatment of feb29 , Eric averaged values of 28 Feb and 1 st March to get values for Feb29, excluding actual Feb29 values when they existed. In order to reproduce Eric results I did the same as him but also left commented an average expression that includes Feb29, which will be part of final code.

category is define as a string in Eric code I left it as an integer (1 - Moderate, 2- Strong, 3- Severe, 4- Extreme)

All my results are returned as an array dataset rather then a dictionary of lists. mhw_severity has been introduced as (set-seasonal ave.)/(ssh-threshold)

This doesn't affect other results

block_average has option to define a different time array to assign mhm events to a block, Eric uses time_start only, this allows to use for example time_peak instead.