Commit f86a049f authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Bugfixes.

parent b4f39a7b
......@@ -163,7 +163,7 @@ class SpectralHomogenizer(object):
def predict_by_machine_learner(self, arrcube, method, src_satellite, src_sensor, src_LBA,
tgt_satellite, tgt_sensor, tgt_LBA, nodataVal=None, compute_errors=False,
**fallback_argskwargs):
# type: (Union[np.ndarray, GeoArray], str, str, str, list, str, str, list, int, dict) -> tuple
# type: (Union[np.ndarray, GeoArray], str, str, str, list, str, str, list, int, bool, dict) -> tuple
"""Predict spectral bands of target sensor by applying a machine learning approach.
:param arrcube: input image array for target sensor spectral band prediction (rows x cols x bands)
......
......@@ -97,6 +97,7 @@ def set_config(job_ID, json_config='', inmem_serialization=False, parallelizatio
:param path_archive: input path where downloaded data are stored
:param virtual_sensor_id: 1: Landsat-8, 10: Sentinel-2A 10m
:param datasetid_spatial_ref: 249 Sentinel-2A
:rtype: JobConfig
"""
#################################
# set GMS_JobConfig in builtins #
......
......@@ -110,8 +110,8 @@ class BaseTestCases:
dss = self.PC.add_local_availability([GMS_object_2_dataset_dict(obj) for obj in GMS_objs])
for ds in dss:
self.assertEqual(ds['proc_level'], tgt_procL,
msg='Written %s dataset %s %s %s is not found by PC.add_local_availability.'
% (ds['proc_level'], ds['satellite'], ds['sensor'], ds['subsystem']))
msg='Written %s dataset cannot be found by PC.add_local_availability().'
% (' '.join([ds['satellite'], ds['sensor'], ds['subsystem'], tgt_procL])))
def test_L1A_processing(self):
self.L1A_newObjects = self.PC.L1A_processing()
......
......@@ -201,7 +201,9 @@ class Test_SpectralHomogenizer(unittest.TestCase):
src_satellite='Landsat-8', src_sensor='OLI_TIRS',
src_LBA=['1', '2', '3', '4', '5', '6', '7'],
tgt_satellite='Sentinel-2A', tgt_sensor='MSI',
tgt_LBA=['1', '2', '3', '4', '5', '6', '7', '8', '8A', '9', '10', '11', '12'])
tgt_LBA=['1', '2', '3', '4', '5', '6', '7', '8', '8A', '9', '10', '11', '12'],
compute_errors=True
)
self.assertIsInstance(predarr, GeoArray)
self.assertEqual(predarr.shape, (50, 50, 13))
......@@ -209,7 +211,7 @@ class Test_SpectralHomogenizer(unittest.TestCase):
self.assertIsInstance(errors, np.ndarray)
self.assertEqual(errors.shape, (50, 50, 13))
# TODO add dtype assertion
self.assertEqual(errors.dtype, np.int16)
@unittest.SkipTest # Ridge regression classifiers have not yet been created
def test_predict_by_machine_learner__RR_L8_S2(self):
......
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