DetectorPerturber#

class nrtk.impls.perturb_image.optical.otf.DetectorPerturber(*, w_x: float | None = None, w_y: float | None = None, f: float | None = None, interp: bool = True, **kwargs: Any)#

Implements OTF-based image perturbation using detector specifications and atmospheric conditions.

The DetectorPerturber 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.

Methods

from_config

Instantiate a new instance of this class given the configuration JSON-compliant dictionary encapsulating initialization arguments.

get_config

Get current configuration including perturber-specific parameters.

get_default_config

Generate and return a default configuration dictionary for this class.

get_impls

Discover plugins, skipping any entrypoints that fail to load.

get_type_string

Returns the fully qualified type string of the PerturbImage class or its subclass.

is_usable

Check whether this class is available for use.

perturb

Apply the OTF-based perturbation to the provided image.

__init__(*, w_x: float | None = None, w_y: float | None = None, f: float | None = None, interp: bool = True, **kwargs: Any) None#

Initializes the DetectorPerturber.

Args:
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.

kwargs:

sensor and/or scenario values to modify.

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.

get_config() dict[str, Any]#

Get current configuration including perturber-specific parameters.