Deltares / hatyan

Harmonic tidal analysis and prediction
https://deltares.github.io/hatyan/
GNU General Public License v3.0
13 stars 2 forks source link

cannot make prediction of dummy component set without tzone attr #317

Closed veenstrajelmer closed 4 days ago

veenstrajelmer commented 3 months ago

The code below raises "KeyError: 'tzone'" due to tzone_comp = metadata_comp.pop('tzone'):

import pandas as pd
import hatyan

comp = pd.DataFrame({"A": [1, 0.5, 0.2],
                     "phi_deg": [10,15,20]}, 
                    index=["M2","M4","S2"])
comp.attrs["nodalfactors"] = True
comp.attrs["fu_alltimes"] = True
comp.attrs["xfac"] = False
comp.attrs["source"] = "schureman"
dtindex = pd.date_range("2020-01-01","2024-01-01", freq="10min")
pred = hatyan.prediction(comp, times=dtindex)

Todo: