environmentaltools.common.read_copla

environmentaltools.common.read_copla(file_name: str, grid: dict = None)[source]

Read COPLA model velocity output files.

Loads velocity field data from COPLA model output and computes magnitude and direction on a 2D grid with ghost cells.

Parameters:
  • file_name (str) – Path to COPLA velocity output file.

  • grid (dict, optional) – Existing grid dictionary to update. If None, creates new dictionary. Defaults to None.

Returns:

Dictionary containing velocity components and derived fields:
  • ’u’: East-west velocity component (m/s) with ghost cells

  • ’v’: North-south velocity component (m/s) with ghost cells

  • ’U’: Velocity magnitude (m/s)

  • ’DirU’: Velocity direction (degrees, nautical convention)

Return type:

dict