Closed apatlpo closed 1 year ago
I've add issues predicting tides and this seems to be related to date format: The tidal analysis looks like:
wt = pytide.WaveTable(["M2", "S2", "N2", "K2", "K1", "O1", "P1", "Q1", "S1", "M4"]) # to restrict time = ds.time.values.astype("datetime64[us]") f, vu = wt.compute_nodal_modulations(time) w = wt.harmonic_analysis(ds.XE.values, f, vu)
The following prediction does not work and produce a result that is very wrong:
ds["XE_harmonic"] = ("time", wt.tide_from_tide_series(time, w))
Manually changing the date into seconds works however:
_time = [(pd.Timestamp(t)-pd.Timestamp(1970,1,1)).total_seconds() for t in time] ds["XE_harmonic"] = ("time", wt.tide_from_tide_series(_time, w))
I modified the library to handle numpy dates directly in the compiled code. This should solve the problem.
I've add issues predicting tides and this seems to be related to date format: The tidal analysis looks like:
The following prediction does not work and produce a result that is very wrong:
Manually changing the date into seconds works however: