coecms / xmhw

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

Add Julian calendar #46

Open paolap opened 2 years ago

paolap commented 2 years ago

I can actually treat Julian calendar exactly as a 365.25, so calling add_doi function to convert it to a 366 days year.

linncarl commented 2 months ago

Hi, I can't read anywhere about how you treat leap years, or specifically the leap day of the 29th of February when calcualting MHW days. The climatologies from the outcome of the threshold() function have 366 days (assuming one uses daily values). Assume one having 10 years of daily values, with two of them consisting of 366 days due to leap years, and the rest is 365 days. How do the detect() function calculate the marine heat waves across all these years using a climatology of 366 days? In short, how do you handle the leap days?

Best regards, Linn

paolap commented 2 months ago

28 Feb, 29 feb and 1st of March get averaged to provide a value for 29 of Feb, unless using a 360 days calendar.

linncarl commented 2 months ago

Ok, so you do that to provide a value for the climatology, but then using the detect function, how is it calcualted for the non-leap years running a 366 day climatology to detect MHWs? You just skip that day for those years? Thanks