boar module

Main entry point for BOAR (Bayesian Optimization for Automated Roughness calibration in two-dimensional hydrodynamic models).

This module orchestrates the calibration workflow by:
  • Loading user configuration from YAML files

  • Setting up logging for execution tracking

  • Importing simulation and observation data

  • Calculating mesh cell centroids

  • Running the friction calibration process

Example

Run the calibration with default settings:

>>> python boar.py

Run with a custom log file:

>>> python boar.py --log-file custom_log.log
boar.main(logger_filename: str = 'boar.log') None[source]

Run the BOAR calibration workflow.

This is the main script for the Basement-Calibrator, which orchestrates the entire calibration process. It performs the following steps:

  1. Loads user-defined options from a YAML configuration file.

  2. Sets up a logger to track the execution of the script.

  3. Creates necessary directories for input and output data.

  4. Logs the user options for reference.

  5. Imports simulation and observation data from CSV files.

  6. Calculates cell centroids from simulation data.

  7. Optimizes the friction region using Bayesian optimization.

Parameters:

logger_filename (str) – Name of the log file. Default is ‘boar.log’.

boar.parse_args() Namespace[source]

Parse command-line arguments.

Returns:

Parsed command-line arguments with the following:
  • log_file (str): Name of the log file (default: ‘boar.log’).

Return type:

argparse.Namespace

boar.setup_logger(filename) Logger[source]

Set up and configure a logger for the application.

Parameters:

filename (str) – Name of the log file to create.

Returns:

Configured logger instance.

Return type:

logging.Logger