This class provides lookup functionality between source temperature, source radiance and sensor signal. In this class the sensor signal is called digital level, but it represents any atribrary sensor signal unit.
See the __main__ function for examples of use.
This package was partly developed to provide additional material in support of students and readers of the book Electro-Optical System Analysis and Design: A Radiometry Perspective, Cornelius J. Willers, ISBN 9780819495693, SPIE Monograph Volume PM236, SPIE Press, 2013. http://spie.org/x648.html?product_id=2021423&origin_id=x646
Given spectral data and temperature this class calculates loopup tables and provide lookup functions operating on the tables.
The class provides two parallel functional capabilities:
By not passing the calibration parameters simply means that that part of the code is not executed and only the simple radiance-based lookup is available.
Five spectral vectors can be supplied: (1) emissivity, (2) atmospheric transmittance, (3) filter transmittance, (4) optics tranmittance, and (5) sensor response. Two sets of calculations are performed, the first with all five spectral vectors, and the second without the filter, but all four remaining vectors. This option may be useful when compensating for neutral density filters, i.e., radiance before or after the filter (with/without). This option is relevant only in the functions LookupRadTemp, LookupTempRad, and PlotTempRadiance. In these three functions, the appropriate option can be selected by setting the withFilter=True function parameter.
Spectral data parameter may be either a filename (data read from file) or a numpy array np.array(:,1) with the data on (nuMin, nuMax,nuInc) scale. The data file must have two colums: first column is wavelength, and second column is the spectral value at this wavelength. Data read in from the file will be interpolated to (nuMin, nuMax,nuInc) scale. If the parameter is None, then unity spectral values will be used.
The camera calibration data set requires the following data:
Error handling is simply to test for certain conditions and then execute the task if conditions are met, otherwise do nothing.
Calculate the mapping functions between sensor signal, radiance and temperature.
Using the spectral curves and DL vs. temperature calibration inputs calculate the various mapping functions between digital level, radiance and temperature. Set up the various tables for later conversion.
The TableTempRad table has three columns: (1) temperature, (2) radiance with filter present and (3) radiance without filter.
Write the calibration data file data to a string and return string.
Load the five required spectral parameters, interpolate on the fly to local spectrals.
If the spectral parameters are strings, the strings are used as filenames and the data loaded from file. If None, unity values are assumed. If not a string or None, the parameters are used as is, and must be numpy arrays with shape (N,1) where the N vector exactly matches to spectral samples
Calculate the temperature associated with a radiance value for the given spectral shapes (no calibration involved).
Calculate the radiance associated with a temperature for the given spectral shapes (no calibration involved).
Plot DL level versus radiance for both camera temperatures
The filename is constructed from the given object name, save path, and the word ‘CaldlRadiance’.
Plot digital level versus temperature for both camera temperatures
The filename is constructed from the given object name, save path, and the word ‘CalDLTemp’.
Plot spectral radiance data for the calibration temperatures.
The filename is constructed from the given object name, save path, and the word ‘CalRadiance’.
Plot temperature versus radiance for both camera temperatures
The filename is constructed from the given object name, save path, and the word ‘CalTempRadiance’.
Plot optics radiance versus instrument temperature
The filename is constructed from the given object name, save path, and the word ‘CalInternal’.
Plot all spectral curve data to a single graph.
The filename is constructed from the given object name, save path, and the word ‘spectrals’.
Plot temperature versus radiance for both camera temperatures
The filename is constructed from the given object name, save path, and the word ‘TempRadiance’.