nrtk.impls.perturb_image.optical.otf.load_default_config#

nrtk.impls.perturb_image.optical.otf.load_default_config(*, preset: str, data_dir: str | None = None) dict[str, Any]#

Load default sensor and scenario configurations for a given configuration type.

This function loads pre-defined sensor and scenario configurations from JSON files located in the data directory. The configuration files should contain ‘sensor’ and ‘scenario’ keys with the appropriate PyBSM configuration parameters.

Currently supported presets: - “blackfly”: Blackfly camera configuration for low-flying UAV imaging systems - “sample”: Sample configuration for testing

Args:
preset:

String identifier for the configuration type to load. Must be one of the supported configuration types.

data_dir:

Optional path to the directory containing configuration files. If None, the function will search in default locations. Can be a string path or pathlib.Path object.

Returns:

A dictionary containing sensor and scenario parameters

Raises:
ValueError:

If the configuration type is not supported or the configuration file is missing required keys.

FileNotFoundError:

If the configuration file cannot be found.

json.JSONDecodeError:

If the configuration file contains invalid JSON.

IOError:

If there’s an error reading the configuration file.