pybsm.simulation.functional.img_to_reflectance
- pybsm.simulation.functional.img_to_reflectance(*, img: ndarray, pix_values: ndarray, refl_values: ndarray) ndarray
Maps pixel values to reflectance values with linear interpolation between points.
Pixel values that map below zero reflectance or above unity reflectance are truncated. Implicitly, reflectance is contrast across the camera bandpass.
- Parameters:
img (np.array) – the image that will be transformed into reflectance (counts)
pix_values (np.array) – array of values in img that map to a known reflectance (counts)
refl_values (np.array) – array of reflectances that correspond to pix_values (unitless)
- Returns:
- ref_img:
the image in reflectance space
- Raises:
- ValueError:
if img, pix_values, or refl_values have a length < 2
- WARNING:
Output can be nan if all input arrays have the same values.