DetectorOTFPerturber
- class nrtk.impls.perturb_image.pybsm.detector_otf_perturber.DetectorOTFPerturber(sensor: PybsmSensor | None = None, scenario: PybsmScenario | None = None, w_x: float | None = None, w_y: float | None = None, f: float | None = None, interp: bool = True)
Implements OTF-based image perturbation using detector specifications and atmospheric conditions.
The DetectorOTFPerturber class uses sensor and scenario configurations to apply realistic perturbations to images. This includes adjusting for detector width, focal length, and atmospheric conditions using pyBSM functionalities.
See https://pybsm.readthedocs.io/en/latest/explanation.html for image formation concepts and parameter details.
- Attributes:
- sensor (PybsmSensor | None):
The sensor configuration used to define perturbation parameters.
- scenario (PybsmScenario | None):
Scenario configuration providing environmental context.
- w_x (float | None):
Detector width in the x direction (meters).
- w_y (float | None):
Detector width in the y direction (meters).
- f (float | None):
Focal length of the detector (meters).
- interp (bool):
Indicates whether atmospheric database should use interpolation.
Methods
from_configInstantiate from configuration dictionary.
Get current configuration including perturber-specific parameters.
get_default_configRetrieves the default configuration.
get_implsDiscover and return a set of classes that implement the calling class.
get_type_stringReturns the fully qualified type string of the PerturbImage class or its subclass.
is_usableCheck if dependencies are available.
perturbApply the OTF-based perturbation to the provided image.
- __init__(sensor: PybsmSensor | None = None, scenario: PybsmScenario | None = None, w_x: float | None = None, w_y: float | None = None, f: float | None = None, interp: bool = True) None
Initializes the DetectorOTFPerturber.
- Args:
- sensor:
pyBSM sensor object.
- scenario:
pyBSM scenario object.
- w_x:
Detector width in the x direction (m).
- w_y:
Detector width in the y direction (m).
- f:
Focal length (m).
- interp:
a boolean determining whether load_database_atmosphere is used with or without interpolation.
If a value is provided for w_x, w_y and/or f that value(s) will be used in the otf calculation.
If both sensor and scenario parameters are provided, but not w_x, w_y and/or f, the value(s) of w_x, w_y and/or f will come from the sensor and scenario objects.
If either sensor or scenario parameters are absent, default values will be used for both sensor and scenario parameters (except for w_x/w_y/f, as defined below).
If any of w_x, w_y, or f are absent and sensor/scenario objects are also absent, the absent value(s) will default to 4um for w_x/w_y and 50mm for f.
- Raises:
- raises ImportError:
If pyBSM is not found, install via pip install nrtk[pybsm].
- get_config() dict[str, Any]
Get current configuration including perturber-specific parameters.