environmentaltools.common.read_pde

environmentaltools.common.read_pde(file_name: str, new_format: bool = False)[source]

Read data from Spanish Puertos del Estado (PdE) wave buoy files.

Parses wave data files from the Spanish port authority, handling both new and legacy file formats.

Parameters:
  • file_name (str) – Path to the PdE data file.

  • new_format (bool) – If True, uses new PdE file format. If False, uses legacy format with auto-detection of data start row. Defaults to False.

Returns:

Wave parameters with datetime index. Columns include significant

wave height (Hs), mean period (Tm), peak period (Tp), mean direction (DirM), and swell components. Invalid values (-100, -99.9, -9999) are replaced with NaN.

Return type:

pd.DataFrame