PybsmSensor
- class nrtk.impls.perturb_image.pybsm.sensor.PybsmSensor(name: str, D: float, f: float, p_x: float, opt_trans_wavelengths: ndarray[float64, Any], optics_transmission: ndarray[float64, Any] | 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[float64, Any] | None = None, qe: ndarray[float64, Any] | 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.
See https://pybsm.readthedocs.io/en/latest/explanation.html for image formation concepts and parameter details.
Methods
Initializes and returns a pybsm.sensor.Sensor instance based on the current configuration.
Rehydrates an object instance from a serializable config dictionary.
Generates a serializable config that can be used to rehydrate object.
get_default_configGenerate and return a default configuration dictionary for this class.
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[float64, Any], optics_transmission: ndarray[float64, Any] | 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[float64, Any] | None = None, qe: ndarray[float64, Any] | 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).
- Args:
- 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
- read_noise:
amount of noise generated by electronics as the charge present in the pixels
- 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
- max_well_fill:
maximum amount of charge an individual pixel can hold before it becomes saturated
- 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)
- Raises:
- raises ImportError:
If pyBSM is not found, install via pip install nrtk[pybsm].
- __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_sensor() Sensor
Initializes and returns a pybsm.sensor.Sensor instance based on the current configuration.
- Returns:
- return Sensor:
A configured instance of pybsm.sensor.Sensor, if pybsm is available.
- Raises:
- raises ImportError:
If pybsm is not available.
- classmethod from_config(config_dict: dict[str, Any], merge_default: bool = True) Self
Rehydrates an object instance from a serializable config dictionary.
- Args:
- cls:
The class of the object which will be instantiated.
- config_dict:
Dictionary of serializable values that will be included in the object instance.
- merge_default:
Indicator variable describing whether or not to use default config values. Defaults to True.
- Returns:
- return PybsmSensor:
Instantiation of class of type PybsmSensor.
- 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.