Commit 283d2ff7 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed some type hints.

parent b7565aaa
Pipeline #3179 passed with stages
in 18 minutes and 21 seconds
......@@ -186,7 +186,7 @@ class SpectralHomogenizer(object):
self.logger = None
def interpolate_cube(self, arrcube, source_CWLs, target_CWLs, kind='linear'):
# type: (Union[np.ndarray, GeoArray], list, list) -> np.ndarray
# type: (Union[np.ndarray, GeoArray], list, list, str) -> np.ndarray
"""Spectrally interpolate the spectral bands of a remote sensing image to new band positions.
:param arrcube: array to be spectrally interpolated
......@@ -407,7 +407,7 @@ class SpectralResampler(object):
return np.array(spectrum_rsp)
def resample_spectra(self, spectra, chunksize=200, CPUs=None):
# type: (Union[GeoArray, np.ndarray], int) -> np.ndarray
# type: (Union[GeoArray, np.ndarray], int, Union[None, int]) -> np.ndarray
"""Resample the given spectral signatures according to the spectral response functions of the target instrument.
:param spectra: spectral signatures, provided as 2D array
......@@ -430,7 +430,7 @@ class SpectralResampler(object):
return spectra_rsp
def resample_image(self, image_cube, tiledims=(20, 20), CPUs=None):
# type: (Union[GeoArray, np.ndarray], tuple) -> np.ndarray
# type: (Union[GeoArray, np.ndarray], tuple, Union[None, int]) -> np.ndarray
"""Resample the given spectral image cube according to the spectral response functions of the target instrument.
:param image_cube: image (3D array) containing the spectral information in the third dimension
......@@ -477,7 +477,7 @@ class SpectralResampler(object):
class KMeansRSImage(object):
"""Class for clustering a given input image by using K-Means algorithm."""
def __init__(self, im, n_clusters, CPUs=1, v=False):
# type: (GeoArray, int) -> None
# type: (GeoArray, int, Union[None, int], bool) -> None
# privates
self._clusters = None
......@@ -790,9 +790,9 @@ class ReferenceCube_Generator(object):
@property
def refcubes(self):
# type: () -> Dict[Tuple[str, str]: RefCube]
"""Return a dictionary holding instances of RefCube for each target satellite / sensor of self.tgt_sat_sen_list.
"""
# type: () -> Dict[Tuple[str, str]: RefCube]
if not self._refcubes:
# fill self._ref_cubes with GeoArray instances of already existing reference cubes read from disk
......@@ -850,7 +850,7 @@ class ReferenceCube_Generator(object):
return SRF(self._get_tgt_GMS_identifier(tgt_sat, tgt_sen), no_pan=False)
def generate_reference_cubes(self, fmt_out='ENVI', progress=True):
# type: (str, bool) -> self.refcubes
# type: (str, bool) -> ReferenceCube_Generator.refcubes
"""Generate reference spectra from all hyperspectral input images.
Workflow:
......@@ -1191,7 +1191,6 @@ class RefCube(object):
:param fmt: output format as GDAL format code
:return:
"""
# type: (str, str) -> None
self.data.save(out_path=path_out, fmt=fmt)
# save metadata as JSON file
......
......@@ -1869,7 +1869,7 @@ map_odictKeys_objAttrnames = {
def get_LayerBandsAssignment(GMS_id, nBands=None, sort_by_cwl=None, no_thermal=None, no_pan=None,
return_fullLBA=False, proc_level=''):
# type: (GMS_identifier, int, bool, bool) -> list
# type: (GMS_identifier, int, bool, bool, bool, bool, str) -> list
"""Returns LayerBandsAssignment corresponding to given satellite, sensor and subsystem and with respect to
CFG.sort_bands_by_cwl, CFG.skip_thermal and CFG.skip_pan.
......@@ -2032,7 +2032,7 @@ def get_bands_after_AC(GMS_id):
def get_center_wavelengths_by_LBA(satellite, sensor, LBA, subsystem=None):
# type: (str, str, list) -> List[float]
# type: (str, str, list, str) -> List[float]
"""Returns a list of center wavelengths of spectral bands for the given satellite/sensor/LayerBandsAss. combination.
:param satellite: target satellite (e.g., 'Sentinel-2A')
......
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