Commit 11f940f3 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

minor improvements.

Former-commit-id: 3728956d
Former-commit-id: cd3c924c
parent 815bcd04
......@@ -11,6 +11,7 @@ import scipy as sp
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from pandas import DataFrame
from typing import Union # noqa F401 # flake8 issue
from sklearn.cluster import k_means_ # noqa F401 # flake8 issue
from geoarray import GeoArray # noqa F401 # flake8 issue
......@@ -33,7 +34,7 @@ class L2B_object(L2A_object):
self.proc_level = 'L2B'
def spectral_homogenization(self, subset=None, kind='linear'):
def spectral_homogenization(self, kind='linear'):
src_cwls = self.meta_odict['wavelength']
# FIXME exclude or include thermal bands; respect sorted CWLs in context of LayerBandsAssignment
tgt_cwls = CFG.usecase.target_CWL
......@@ -57,7 +58,7 @@ class L2B_object(L2A_object):
def interpolate_cube_linear(arrcube, source_CWLs, target_CWLs):
# type: (np.ndarray,list,list) -> np.ndarray
# type: (Union[np.ndarray, GeoArray], list, list) -> np.ndarray
assert arrcube is not None,\
'L2B_obj.interpolate_cube_linear expects a numpy array as input. Got %s.' % type(arrcube)
orig_CWLs, target_CWLs = np.array(source_CWLs), np.array(target_CWLs)
......@@ -72,7 +73,7 @@ class SpectralResampler(object):
def __init__(self, wvl_src, srf_tgt, wvl_unit='nanometers', logger=None):
# type: (np.ndarray, SRF, str) -> None
"""Get an instance of the SpectralResampler1D class.
"""Get an instance of the SpectralResampler class.
:param wvl_src: center wavelength positions of the source spectrum
:param srf_tgt: spectral response of the target instrument as an instance of io.Input_reader.SRF.
......@@ -261,7 +262,7 @@ class KMeansRSImage(object):
rows, cols = self.im_clust.shape[:2]
plt.imshow(self.im_clust,, interpolation='none', extent=(0, cols, rows, 0))
plt.imshow(self.im_clust, plt.get_cmap('prism'), interpolation='none', extent=(0, cols, rows, 0))
def get_random_spectra_from_each_cluster(self, samplesize=50):
Supports Markdown
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