DefocusPerturber#
- class nrtk.impls.perturb_image.optical.otf.DefocusPerturber(*, w_x: float | None = None, w_y: float | None = None, interp: bool = True, **kwargs: Any)#
Implements image perturbation using defocus and Optical Transfer Function (OTF).
DefocusPerturber applies optical defocus perturbations to input images based on specified sensor and scenario configurations. The perturbation uses the Optical Transfer Function (OTF) and Point Spread Function (PSF) for simulation.
See https://pybsm.readthedocs.io/en/latest/explanation.html for image formation concepts and parameter details.
Methods
from_configInstantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.
Get current configuration including perturber-specific parameters.
get_default_configGenerate and return a default configuration dictionary for this class.
get_implsDiscover plugins, skipping any entrypoints that fail to load.
get_type_stringReturns the fully qualified type string of the PerturbImage class or its subclass.
is_usableCheck whether this class is available for use.
perturbApply the OTF-based perturbation to the provided image.
- __init__(*, w_x: float | None = None, w_y: float | None = None, interp: bool = True, **kwargs: Any) None#
Initializes a DefocusPerturber instance with the specified parameters.
- Args:
- w_x:
the 1/e blur spot radii in the x direction. Defaults to the sensor’s value if provided.
- w_y:
the 1/e blur spot radii in the y direction. Defaults to the sensor’s value if provided.
- interp:
Whether to interpolate atmosphere data. Defaults to True.
- kwargs:
sensor and/or scenario values to modify
If a value is provided for w_x and/or w_y those values will be used in the otf calculation.
If both sensor and scenario parameters are provided, but not w_x and/or w_y, the value(s) of w_x and/or w_y 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 as defined below).
If any of w_x or w_y are absent and sensor/scenario objects are also absent, the absent value(s) will default to 0.0 for both.
- get_config() dict[str, Any]#
Get current configuration including perturber-specific parameters.