spechomo issueshttps://git.gfz-potsdam.de/geomultisens/spechomo/-/issues2022-07-25T18:08:38+02:00https://git.gfz-potsdam.de/geomultisens/spechomo/-/issues/14Add support for Landsat-92022-07-25T18:08:38+02:00Daniel SchefflerAdd support for Landsat-9So far, only Landsat-5/7/8 are supported. Compatibility to Landsat-9 is needed.So far, only Landsat-5/7/8 are supported. Compatibility to Landsat-9 is needed.Daniel SchefflerDaniel Schefflerhttps://git.gfz-potsdam.de/geomultisens/spechomo/-/issues/13Bad harmonization result when passing a float data scaled between 0 and 1 ins...2021-11-15T20:58:21+01:00Daniel SchefflerBad harmonization result when passing a float data scaled between 0 and 1 instead of integer dataThis leads to a result like this:
![image](/uploads/63a8821a002cb7dad830bcfe82a6aa15/image.png)This leads to a result like this:
![image](/uploads/63a8821a002cb7dad830bcfe82a6aa15/image.png)Daniel SchefflerDaniel Schefflerhttps://git.gfz-potsdam.de/geomultisens/spechomo/-/issues/12GeoArray of harmonized output does not contain GeoTransform, projection and o...2021-11-15T20:40:15+01:00Daniel SchefflerGeoArray of harmonized output does not contain GeoTransform, projection and other metadata.When calling SpectralHomogenizer as documented, the metadata from the input dataset is not copied to the output data.
```python
from spechomo import SpectralHomogenizer
print(image_l8.gt)
# get an instance of SpectralHomogenizer class...When calling SpectralHomogenizer as documented, the metadata from the input dataset is not copied to the output data.
```python
from spechomo import SpectralHomogenizer
print(image_l8.gt)
# get an instance of SpectralHomogenizer class:
SH = SpectralHomogenizer()
# run the spectral homogenization
image_s2, errors = SH.predict_by_machine_learner(
arrcube=image_l8[:,:,:7],
method='LR',
n_clusters=50,
src_satellite='Landsat-8',
src_sensor='OLI_TIRS',
src_LBA=['1', '2', '3', '4', '5', '6', '7'], # must be passed as list of strings and match the band numbers of the input
print(image_s2.gt)
)
```
```
(380100.0, 30.0, 0.0, 3696300.0, 0.0, -30.0)
[0, 1, 0, 0, 0, -1]
```Daniel SchefflerDaniel Schefflerhttps://git.gfz-potsdam.de/geomultisens/spechomo/-/issues/11pandas VisibleDeprecationWarning2021-07-22T00:24:37+02:00Daniel Schefflerpandas VisibleDeprecationWarning```bash
test_list_available_transformations (tests.test_utils.Test_Utils) ... /root/miniconda3/envs/ci_env/lib/python3.9/site-packages/pandas/core/dtypes/cast.py:869: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequ...```bash
test_list_available_transformations (tests.test_utils.Test_Utils) ... /root/miniconda3/envs/ci_env/lib/python3.9/site-packages/pandas/core/dtypes/cast.py:869: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
element = np.asarray(element)
```Daniel SchefflerDaniel Schefflerhttps://git.gfz-potsdam.de/geomultisens/spechomo/-/issues/10kNN weights of material-specific regressors should not be used for global reg...2021-07-22T23:27:50+02:00Daniel SchefflerkNN weights of material-specific regressors should not be used for global regressors.When using kNN classifiers for prediction and setting the global-classifier-threshold, the 'wrong' weights are used for those classifiers that exceed the theshold. Currently, the weights of the material-specific regressors are used altho...When using kNN classifiers for prediction and setting the global-classifier-threshold, the 'wrong' weights are used for those classifiers that exceed the theshold. Currently, the weights of the material-specific regressors are used although the global regressor is used for prediction.
Current version with threshold at 4 degrees SAM:
- SAM values like `[0.2, 1.75, 2.23, 4.56, 8.56, 12.34]`)
- classification map `[32, 34, 56, 1, 1, 1]`
- weights `[wMAT, wMAT, wMAT, wMAT, wMAT, wMAT]` # wMAT = weight of material specific classifier
But it should be:
- SAM values like `[0.2, 1.75, 2.23, 4.56, 8.56, 12.34]`)
- classification map `[32, 34, 56, 1, 1, 1]`
- weights `[wMAT, wMAT, wMAT, wGLOB, 0, 0]` # wGLOB = weight of global classifier which should only count once
The worst case effect of this is:
- SAM values like `[3.97, 20.54, 21.54, 22.54]`)
- classification map `[32, 1, 1, 1]`
- weights `[0.66, 0.025, 0.024, 0.023]` # wMAT = weight of material specific classifier
- => Here, the global regressor is nearly ignored due to the very small weights of regressors 2, 3, 4, i.e., the prediction result is mainly computed from a regressor that does not really match well. This might result in bad predictions.
But also an over-weighting of the global regressor is possible:
- SAM values like `[3.97, 4.01, 4.02, 4.03]`)
- classification map `[32, 1, 1, 1]`
- weights `[0.66, 0.67, 0.68, 0.69]`
- => Here, the global regressor accounts for three quarters of the prediction result and the improvement of the material-specific regressor is gone.Daniel SchefflerDaniel Schefflerhttps://git.gfz-potsdam.de/geomultisens/spechomo/-/issues/5Store classifiers in a human-readable format.2020-03-09T19:28:55+01:00Daniel SchefflerStore classifiers in a human-readable format.Storing the classifiers in a human-readable format such as JSON instead of dill or pickle files increases the across-versions-compatibility of scikit-learn. Additionally, the classifiers are also readable using different programming lang...Storing the classifiers in a human-readable format such as JSON instead of dill or pickle files increases the across-versions-compatibility of scikit-learn. Additionally, the classifiers are also readable using different programming languages.Daniel SchefflerDaniel Schefflerhttps://git.gfz-potsdam.de/geomultisens/spechomo/-/issues/4Update classifiers.2020-11-03T10:47:26+01:00Daniel SchefflerUpdate classifiers.Update LR, QR, RR and RFR classifiers.Update LR, QR, RR and RFR classifiers.Daniel SchefflerDaniel Schefflerhttps://git.gfz-potsdam.de/geomultisens/spechomo/-/issues/3Harmonization error estimation does not work for kNN algorithms.2019-09-25T00:12:43+02:00Daniel SchefflerHarmonization error estimation does not work for kNN algorithms.This line asserts a 2D classification map:
https://gitext.gfz-potsdam.de/geomultisens/spechomo/blob/master/spechomo/prediction.py#L490
However, in case of kNN classification, the classification map is 3D (contains classification maps r...This line asserts a 2D classification map:
https://gitext.gfz-potsdam.de/geomultisens/spechomo/blob/master/spechomo/prediction.py#L490
However, in case of kNN classification, the classification map is 3D (contains classification maps respecting N neighbours).
This causes the following exception:
```python
Performing k-nearest neighbour spectral angle mapper (kNN_SAM; k=10) image classification...
2019/09/25 00:10:31: Total classification time: 00:00:00
2019/09/25 00:10:31: Predicting tile ((0, 49), (0, 49))...
2019/09/25 00:10:31: Total prediction time: 00:00:00
2019/09/25 00:10:31: Inpainting error values for cluster #0...
/home/gfz-fe/scheffler/python/spechomo/spechomo/prediction.py:490: VisibleDeprecationWarning: boolean index did not match indexed array along dimension 2; dimension is 11 but corresponding boolean dimension is 10
errors[self.classif_map[:] == pixVal] = rmse_per_band_int
Error
Traceback (most recent call last):
File "/home/gfz-fe/python_GFZ/python/lib/python3.6/unittest/case.py", line 59, in testPartExecutor
yield
File "/home/gfz-fe/python_GFZ/python/lib/python3.6/unittest/case.py", line 605, in run
testMethod()
File "/home/gfz-fe/scheffler/python/spechomo/tests/test_prediction.py", line 91, in test_predict_by_machine_learner__LR_L8_S2
nodataVal=-9999
File "/home/gfz-fe/scheffler/python/spechomo/spechomo/prediction.py", line 178, in predict_by_machine_learner
errors = PR.compute_prediction_errors(im_homo, cls, nodataVal=nodataVal, cmap_nodataVal=nodataVal)
File "/home/gfz-fe/scheffler/python/spechomo/spechomo/prediction.py", line 490, in compute_prediction_errors
errors[self.classif_map[:] == pixVal] = rmse_per_band_int
Exception: shape mismatch: value array of shape (11,) could not be broadcast to indexing result of shape (287,)
```Daniel SchefflerDaniel Scheffler