pytroll/pyspectral

rad-tb-conversions not exactly irreversible

adybbroe opened this issue · 0 comments

Code Sample, a minimal, complete, and verifiable piece of code

# Your code here
In [1]: from pyspectral.radiance_tb_conversion import RadTbConverter                                                                                            
In [2]: viirs = RadTbConverter('Suomi-NPP', 'viirs', 'I5')                                                                                                      
In [3]: viirs.radiance2tb(viirs.tb2radiance(290)['radiance'])                                                                                                   
Out[3]: 289.600620823891

Problem description

The radiance-tb converter looks like it has two functions going from tb to radiance and back again, making the user think one is the inverse of the other. However the radiance-to-tb method radiance2tb uses the central wavelength and does not make a convolution with the spectral response function, thus one does not arrive back to the exact same Tb as shown in the above example.

Expected Output

If the two functions were inverse of each other, one should expect smaller deviations in the calculations as the above.

Actual Result, Traceback if applicable

Versions of Python, package at hand and relevant dependencies

Python 3.7.3
pyspectral 0.9.3

Thank you for reporting an issue !