environmentaltools.spectral.analysis.reconstruct_tidal_level
- environmentaltools.spectral.analysis.reconstruct_tidal_level(df: DataFrame, tidalConstituents: dict)[source]
Reconstruct tidal elevations from harmonic constituents.
This function uses tidal constituents (obtained from harmonic analysis) to reconstruct the tidal signal at specified times. The reconstruction includes all analyzed constituents with their phases and amplitudes.
- Parameters:
df (pd.DataFrame) – DataFrame with datetime index specifying the times for reconstruction. A new column ‘ma’ will be added with the reconstructed tidal anomalies.
tidalConstituents (dict) – Dictionary containing tidal constituents from harmonic analysis, typically the output from
harmonic_analysis(). Must include amplitude, phase, and mean level information.
- Returns:
Input dataframe with added ‘ma’ column containing reconstructed tidal anomalies (reconstructed level minus mean level).
- Return type:
pd.DataFrame
Notes
The ‘ma’ column represents tidal anomalies (deviations from mean level), which is useful for isolating tidal effects from other oceanographic processes.
Uses the UTide reconstruct function to generate predictions from constituents.