Skip to content
Snippets Groups Projects
Commit bbcfcc78 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Bug fix: interpret Matlab serial date number

[Matlab serial date
number](https://fr.mathworks.com/help/matlab/ref/datenum.html) is the
number of days from Jan 1st, year 0, in a proleptic gregorian
calendar.
parent 73a64eea
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@
and all the anticyclones are processed before all the cyclones."""
import scipy.io as sio
import datetime
def convert_id(orientation, eddy_index_Matlab):
"""Convert from Matlab eddy identification to eddy
......@@ -17,7 +18,10 @@ def convert_id(orientation, eddy_index_Matlab):
"""
k = (eddy_index_Matlab - 1) // n_max
date = Assoc_eddies_Anti_max["date_num"][k]
date = datetime.date.fromordinal(Assoc_eddies_Anti_max["date_num"][k]
- 366) - datetime.date(1950,1,1)
date = date.days
if orientation == "anticyclone":
eddy_index_F = eddy_index_Matlab - k * n_max
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment