PybsmSensor

class nrtk.impls.perturb_image.pybsm.sensor.PybsmSensor(name: str, D: float, f: float, p_x: float, opt_trans_wavelengths: ndarray, optics_transmission: ndarray | None = None, eta: float = 0.0, w_x: float | None = None, w_y: float | None = None, int_time: float = 1.0, n_tdi: float = 1.0, dark_current: float = 0.0, read_noise: float = 0.0, max_n: int = 100000000, bit_depth: float = 100.0, max_well_fill: float = 1.0, s_x: float = 0.0, s_y: float = 0.0, da_x: float = 0.0, da_y: float = 0.0, qe_wavelengths: ndarray | None = None, qe: ndarray | None = None)

Wrapper for pybsm.sensor.Sensor.

This class allows for creating a sensor instance with specified parameters, managing sensor configurations, and enabling flexible integration into larger simulation frameworks.

Methods

create_sensor

Initializes and returns a pybsm.sensor.Sensor instance based on the current configuration.

from_config

Rehydrates an object instance from a serializable config dictionary

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__() Sensor

Alias for StoreSensor.sensor().

__init__(name: str, D: float, f: float, p_x: float, opt_trans_wavelengths: ndarray, optics_transmission: ndarray | None = None, eta: float = 0.0, w_x: float | None = None, w_y: float | None = None, int_time: float = 1.0, n_tdi: float = 1.0, dark_current: float = 0.0, read_noise: float = 0.0, max_n: int = 100000000, bit_depth: float = 100.0, max_well_fill: float = 1.0, s_x: float = 0.0, s_y: float = 0.0, da_x: float = 0.0, da_y: float = 0.0, qe_wavelengths: ndarray | None = None, qe: ndarray | None = None) None

Initializes a PybsmSensor instance with specified configuration parameters.

This is not intended to be a complete list but is more than adequate for the NIIRS demo (see pybsm.metrics.functional.niirs).

Parameters:
  • name – name of the sensor

  • D – effective aperture diameter (m)

  • f – focal length (m)

  • p_x – detector center-to-center spacings (pitch) in the x and y directions (meters); if p_y is not provided, it is assumed equal to p_x

  • opt_trans_wavelengths – specifies the spectral bandpass of the camera (m); at minimum, specify a start and end wavelength

  • optics_transmission – full system in-band optical transmission (unitless); do not include loss due to any telescope obscuration in this optical transmission array

  • eta – relative linear obscuration (unitless); obscuration of the aperture commonly occurs within telescopes due to secondary mirror or spider supports

  • p_y – detector center-to-center spacings (pitch) in the x and y directions (meters); if p_y is not provided, it is assumed equal to p_x

  • w_x – detector width in the x and y directions (m); if set equal to p_x and p_y, this corresponds to an assumed full pixel fill factor. In general, w_x and w_y are less than p_x and p_y due to non-photo-sensitive area (typically transistors) around each pixel.

  • w_y – detector width in the x and y directions (m); if set equal to p_x and p_y, this corresponds to an assumed full pixel fill factor. In general, w_x and w_y are less than p_x and p_y due to non-photo-sensitive area (typically transistors) around each pixel.

  • int_time – maximum integration time (s)

  • qe – quantum efficiency as a function of wavelength (e-/photon)

  • qe_wavelengths – wavelengths corresponding to the array qe (m)

  • other_irradiance – spectral irradiance from other sources (W/m^2 m); this is particularly useful for self emission in infrared cameras and may also represent stray light.

  • dark_current – detector dark current (e-/s); dark current is the relatively small electric current that flows through photosensitive devices even when no photons enter the device

  • max_n – detector electron well capacity (e-); the default 100 million initializes to a large number so that, in the absence of better information, it doesn’t affect outcomes

  • bit_depth – resolution of the detector ADC in bits (unitless); default of 100 is a sufficiently large number so that in the absence of better information, it doesn’t affect outcomes

  • n_tdi – number of TDI stages (unitless)

  • cold_shield_temperature – temperature of the cold shield (K); it is a common approximation to assume that the coldshield is at the same temperature as the detector array

  • optics_temperature – temperature of the optics (K)

  • optics_emissivity – emissivity of the optics (unitless) except for the cold filter; a common approximation is 1-optics transmissivity

  • cold_filter_transmission – transmission through the cold filter (unitless)

  • cold_filter_temperature – temperature of the cold filter; it is a common approximation to assume that the filter is at the same temperature as the detector array

  • cold_filter_emissivity – emissivity through the cold filter (unitless); a common approximation is 1-cold filter transmission

  • s_x – root-mean-squared jitter amplitudes in the x direction (rad)

  • s_y – root-mean-squared jitter amplitudes in the y direction (rad)

  • da_x – line-of-sight angular drift rate during one integration time in the x direction (rad/s)

  • da_y – line-of-sight angular drift rate during one integration time in the y direction (rad/s)

  • pv – wavefront error phase variance (rad^2) – tip: write as (2*pi*waves of error)^2

  • pv_wavelength – wavelength at which pv is obtained (m)

__repr__() str

Returns the provided name as the object representation

Returns:

str: name of instance

__str__() str

Returns the provided name as the string representation

Returns:

str: name of instance

__weakref__

list of weak references to the object (if defined)

create_sensor() Sensor

Initializes and returns a pybsm.sensor.Sensor instance based on the current configuration.

Returns:

Sensor: A configured instance of pybsm.sensor.Sensor, if pybsm is available.

Raises:

ImportError: If pybsm is not available.

classmethod from_config(config_dict: dict, merge_default: bool = True) Self

Rehydrates an object instance from a serializable config dictionary

Args:

cls (type[C]): The class of the object which will be instantiated config_dict (dict): Dictionary of serializable values that will be

included in the object instance

merge_default (bool, optional): Indicator variable describing whether

or not to use default config values. Defaults to True.

Returns:

C: Instantiation of class of type C

get_config() dict[str, Any]

Generates a serializable config that can be used to rehydrate object

Returns:

dict[str, Any]: serializable config containing all instance parameters

classmethod is_usable() bool

Checks if the necessary dependencies pyBSM is available.

Returns:

bool: True if pyBSM is available; False otherwise.