SwashModelWrapper

Bases: BaseModelWrapper

Wrapper for the SWASH model. https://swash.sourceforge.io/online_doc/swashuse/swashuse.html#input-and-output-files

Attributes:
  • swash_exec (str) –

    The SWASH executable path.

  • default_parameters (dict) –

    The default parameters type for the model.

Methods:

Name Description
set_swash_exec

Set the SWASH executable path.

_read_tabfile

Read a tab file and return a pandas DataFrame.

_convert_output_tabs_to_nc

Convert output tabs files to a netCDF file.

run_model

Run the SWASH model for the specified case.

__init__(templates_dir, templates_name, model_parameters, output_dir)

Initialize the SWASH model wrapper.

Parameters:
  • templates_dir (str) –

    The directory where the templates are stored.

  • templates_name (list) –

    The names of the templates.

  • model_parameters (dict) –

    The parameters to be used in the templates.

  • output_dir (str) –

    The directory where the output files will be saved.

run_model(case_dir, log_file='swash_exec.log')

Run the SWASH model for the specified case.

Parameters:
  • case_dir (str) –

    The case directory.

  • log_file (str, default: 'swash_exec.log' ) –

    The log file name. Default is "swash_exec.log".

Raises:
  • ValueError

    If the SWASH executable was not set.