environmentaltools.processes.delft_raw_files

environmentaltools.processes.delft_raw_files(folder, vars_, case_id_)[source]

Load Delft3D raw output files for a single case.

Parameters:
  • folder (str or Path) – Directory containing case subdirectories

  • vars (dict) – Dictionary with variable groups: - ‘vars_com_guad’: Communication module variables - ‘vars_wavm’: Wave module variables

  • case_id (str) – Case identifier (e.g., ‘case0001’)

Returns:

Dictionary with variable names as keys and 2D numpy arrays as values

Return type:

dict

Notes

File format: - Text files with headers (first 3 lines + variable-specific header) - Line 4 contains: nodesxt, nodesyt, nodest (total nodes in x*t, y*t, t) - Data starts at line: nodesxt - nodesx + 5 - nodesx = nodesxt / nodest

The function processes two variable groups independently, reading all files specified in vars_[‘vars_com_guad’] and vars_[‘vars_wavm’].

Examples

>>> vars_dict = {
...     'vars_com_guad': ['waterlevel', 'velocity_u', 'velocity_v'],
...     'vars_wavm': ['hs', 'tp', 'dir']
... }
>>> data = delft_raw_files('./runs', vars_dict, 'case0001')
>>> print(data['hs'].shape)