Commit 862a2aca authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Input radiometric unit of spectral homogenization is now checked. Linear...


Input radiometric unit of spectral homogenization is now checked. Linear interpolation is used if its not BOA_Ref.
Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 6d6894f1
Pipeline #8093 passed with stage
in 17 minutes and 7 seconds
......@@ -7,6 +7,7 @@ History
--------------------
* Fixed fallback algorithm within spectral homogenization.
* Input radiometric unit of spectral homogenization is now checked. Linear interpolation is used if its not BOA_Ref.
0.18.2 (2020-04-02)
......
......@@ -107,14 +107,19 @@ class L2B_object(L2A_object):
logger=self.logger,
CPUs=CFG.CPUs if is_mainprocess() else 1)
if method == 'LI' or CFG.datasetid_spectral_ref is None:
if method == 'LI' or CFG.datasetid_spectral_ref is None or self.arr_desc != 'BOA_Ref':
# linear interpolation (if intended by user or in case of custom spectral characteristics of target sensor)
# -> no classifier for that case available -> linear interpolation
if self.arr_desc != 'BOA_Ref' and CFG.target_radunit_optical == 'BOA_Ref':
self.logger.warning("Spectral homogenization with an '%s' classifier is not possible because the input "
"image is not atmospherically corrected (BOA reflectance is needed). Falling back "
"to linear spectral interpolation." % method)
im = SpH.interpolate_cube(self.arr, src_cwls, tgt_cwl, kind='linear')
if CFG.spechomo_estimate_accuracy:
self.logger.warning("Unable to compute any error information in case spectral homogenization algorithm "
"is set to 'LI' (Linear Interpolation)")
"is set to 'LI' (Linear Interpolation).")
errs = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment