PybsmScenario

class nrtk.impls.perturb_image.pybsm.scenario.PybsmScenario(name: str, ihaze: int, altitude: float, ground_range: float, aircraft_speed: float = 0.0, target_reflectance: float = 0.15, target_temperature: float = 295.0, background_reflectance: float = 0.07, background_temperature: float = 293.0, ha_wind_speed: float = 21.0, cn2_at_1m: float = 1.7e-14, interp: bool = False)

Wrapper for pybsm.scenario.

This class defines a streamlined interface for creating and configuring a scenario within the pybsm framework, enabling the user to specify parameters such as atmospheric haze level, altitude, and ground range.

See https://pybsm.readthedocs.io/en/latest/explanation.html for image formation concepts and parameter details.

Attributes:
ihaze_values (list[int]):

Permissible values for the atmospheric haze parameter.

altitude_values (list[float]):

Permissible altitude values for scenario creation.

ground_range_values (list[float]):

Permissible ground range values for the scenario.

Methods

create_scenario

Creates and returns a pybsm.Scenario object based on the defined parameters.

from_config

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

get_config

Generates a serializable config that can be used to rehydrate object.

get_default_config

Generate and return a default configuration dictionary for this class.

is_usable

Checks if the necessary dependencies pyBSM is available.

__call__() Scenario

Alias for StoreScenario.create_scenario().

__init__(name: str, ihaze: int, altitude: float, ground_range: float, aircraft_speed: float = 0.0, target_reflectance: float = 0.15, target_temperature: float = 295.0, background_reflectance: float = 0.07, background_temperature: float = 293.0, ha_wind_speed: float = 21.0, cn2_at_1m: float = 1.7e-14, interp: bool = False) None

Initializes a PybsmScenario instance with the specified configuration parameters.

NOTE: if the niirs model is called, values for target/background temperature, reflectance, etc. are overridden with the NIIRS model defaults.

Args:
name:

name of the sensor

ihaze:

MODTRAN code for visibility, valid options are ihaze = 1 (Rural extinction with 23 km visibility) or ihaze = 2 (Rural extinction with 5 km visibility)

altitude:

sensor height above ground level in meters; the database includes the following altitude options: 2 32.55 75 150 225 500 meters, 1000 to 12000 in 1000 meter steps, and 14000 to 20000 in 2000 meter steps, 24500

ground_range:

projection of line of sight between the camera and target along on the ground in meters; the distance between the target and the camera is given by sqrt(altitude^2 + ground_range^2). The following ground ranges are included in the database at each altitude until the ground range exceeds the distance to the spherical earth horizon: 0 100 500 1000 to 20000 in 1000 meter steps, 22000 to 80000 in 2000 m steps, and 85000 to 300000 in 5000 meter steps.

aircraft_speed:

ground speed of the aircraft (m/s)

target_reflectance:

object reflectance (unitless); the default 0.15 is the giqe standard

target_temperature:

object temperature (Kelvin); 282 K is used for GIQE calculation

background_reflectance:

background reflectance (unitless)

background_temperature:

background temperature (Kelvin); 280 K used for GIQE calculation

ha_wind_speed:

the high altitude wind speed (m/s) used to calculate the turbulence profile; the default, 21.0, is the HV 5/7 profile value

cn2_at_1m:

the refractive index structure parameter “near the ground” (e.g. at h = 1 m) used to calculate the turbulence profile; the default, 1.7e-14, is the HV 5/7 profile value

interp:

A flag to indicate whether atmospheric interpolation should be used. Defaults to False.

Raises:
raises ImportError:

If pyBSM is not found, install via pip install nrtk[pybsm].

raises ValueError:

For Invalid ihaze value.

raises ValueError:

For Invalid altitude value.

raises ValueError:

For Invalid ground range value.

__repr__() str

Returns the provided name as the object representation.

Returns:
return str:

Name of instance.

__str__() str

Returns the provided name as the string representation.

Returns:
return str:

Name of instance

__weakref__

list of weak references to the object (if defined)

create_scenario() Scenario

Creates and returns a pybsm.Scenario object based on the defined parameters.

Returns:
return Scenario:

pybsm.Scenario object populated with instance parameters.

get_config() dict[str, Any]

Generates a serializable config that can be used to rehydrate object.

Returns:
return dict[str, Any]:

serializable config containing all instance parameters

classmethod is_usable() bool

Checks if the necessary dependencies pyBSM is available.

Returns:
return bool:

True if pyBSM is available; False otherwise.