Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into update_conda_versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jakimowb committed Nov 29, 2024
2 parents 783a8d5 + 1d549a6 commit bb5fe04
Show file tree
Hide file tree
Showing 113 changed files with 3,055 additions and 1,491 deletions.
2 changes: 1 addition & 1 deletion .env/conda/enmapbox_full_3.38.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
- flake8
- git-lfs
- gitpython
- hy5py
- h5py
- lightgbm
- matplotlib
- netcdf4
Expand Down
2 changes: 1 addition & 1 deletion .env/conda/enmapbox_full_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
- flake8
- git-lfs
- gitpython
- hy5py
- h5py
- lightgbm
- matplotlib
- netcdf4
Expand Down
2 changes: 1 addition & 1 deletion .env/conda/enmapbox_full_longterm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
- flake8
- git-lfs
- gitpython
- hy5py
- h5py
- lightgbm
- matplotlib
- netcdf4
Expand Down
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ per-file-ignores =
# QGS104 Use 'import qgis.PyQt.pyrcc_main' instead of 'import PyQt5.pyrcc_main'
# just not available in OSGeo4W installations
# script should run immediately which site.addsitedir(REPO) before other imports
scripts/*.py : E402
# scripts/*.py : E402
enmapbox/eo4qapps/geetimeseriesexplorerapp/*.py : F821
enmapbox/__main__.py: E402
enmapbox/gui/__init__.py: F401
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.12"
- name: Run flake8
uses: julianwachholz/flake8-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests-mamba.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 🐍 Conda Environments
on:
push:
branches:
- mamba**
- main
- release-**

pull_request:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/urlcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
push:
branches:
- main
- 'releases/**'
- 'release_**'
- urlcheck
pull_request:
branches:
- main
- 'releases/**'
- 'release_**'

jobs:
build:
Expand All @@ -34,7 +34,7 @@ jobs:
force_pass : false

exclude_files:
test_glossary.py,snippets/grabPotsdamWmsData.py
test_glossary.py,snippets/grabPotsdamWmsData.py,scripts/update_splashscreen.py

# {z}/{x}/{y}: ESRI
# {z]/{y}/{x}: CartoDB, Open Weather, OpenTopoMap, OSM, Stamen, Strava, Wikimedia
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ examples/*.json
examples/*.qml
symbology-style.db
# enmapbox/exampledata/*.gpkg

splashscreen_tmp.*

# we do not like to have compiled qt resource files in our repository!
*_rc.py
Expand Down
3 changes: 2 additions & 1 deletion .plugin.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = EnMAP-Box 3
version = 3.15-alpha.0
version = 3.16-alpha.0
qgisMinimumVersion = 3.34
description = Imaging Spectroscopy and Remote Sensing for QGIS
tags =
Expand Down Expand Up @@ -80,6 +80,7 @@ include =
rx:enmapboxexternal/.*\.(py)
enmapboxplugins/*
enmapboxgeoalgorithms/*
enmapbox/gui/splashscreen/splashscreen.png
__init__.py
CHANGELOG.rst
CHANGELOG.md
Expand Down
49 changes: 45 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
# CHANGELOG
## Version 3.15 (2024-10-01)
_This release was tested under QGIS 3.34 (LTR) and 3.38 (latest release)._
### New Features
#### Applications
* add algorithm and interactive tool for plotting trajectories of land cover change over time via Sankey plot [#924](https://github.com/EnMAP-Box/enmap-box/issues/924)
#### Data / Metadata Model
* support temporal metadata provided by 'time' dimension in NetCDF files [#906](https://github.com/EnMAP-Box/enmap-box/issues/906)
* support temporal metadata provided by .aux.json files created with R-cran terra package [#907](https://github.com/EnMAP-Box/enmap-box/issues/907)
#### GUI
* [Data Views] add "Apply mask" option to the raster layer context menu [#942](https://github.com/EnMAP-Box/enmap-box/issues/942)
#### Processing Algorithms
* Import USGS ASCII Speclib [#302](https://github.com/EnMAP-Box/enmap-box/issues/302)
* add import algorithms for Planet Scope products [#492](https://github.com/EnMAP-Box/enmap-box/issues/492)
* [Classification workflow] support OOB validation [#910](https://github.com/EnMAP-Box/enmap-box/issues/910)
* [Create classification/regression/unsupervised dataset] store sample locations inside a dataset if available [#911](https://github.com/EnMAP-Box/enmap-box/issues/911)
* [Classification workflow] add "classification layer accuracy and area report" output [#912](https://github.com/EnMAP-Box/enmap-box/issues/912)
* implement "Create spectral library (from classification dataset)" [#917](https://github.com/EnMAP-Box/enmap-box/issues/917)
* add algorithm and interactive tool for plotting trajectories of land cover change over time via Sankey plot [#924](https://github.com/EnMAP-Box/enmap-box/issues/924)
* add algorithms for creating spectral library from classification/regression dataset [#931](https://github.com/EnMAP-Box/enmap-box/issues/931)
* [Raster layer bounding polygon] add option for convex hull [#950](https://github.com/EnMAP-Box/enmap-box/issues/950)
* [Analysis ready data] add algorithm for raster tiling [#953](https://github.com/EnMAP-Box/enmap-box/issues/953)
* add "Aggregate raster layers" algorithm [#956](https://github.com/EnMAP-Box/enmap-box/issues/956)
* add algorithm for creating a raster mask [#959](https://github.com/EnMAP-Box/enmap-box/issues/959)
* [Import EnMAP L2A product] support L2A Analysis Ready Data from Geoservice / EOLAB [#973](https://github.com/EnMAP-Box/enmap-box/issues/973)
* [Import EnMAP L2A product] derive bad band information from metadata file [#974](https://github.com/EnMAP-Box/enmap-box/issues/974)
* in all algorithms with VRT raster output, also support GTiff and ENVI outputs [#977](https://github.com/EnMAP-Box/enmap-box/issues/977)
#### Miscellaneous
* implement auto-generated changelog [#938](https://github.com/EnMAP-Box/enmap-box/issues/938)
### Fixed Bugs
<details><summary>Show all (5)</summary>

* Save current profiles on CTRL+S [#871](https://github.com/EnMAP-Box/enmap-box/issues/871)
* [Spectral resampling] EMIT sensor is missing [#891](https://github.com/EnMAP-Box/enmap-box/issues/891)
* [Classification layer accuracy and area report (for simple random sampling)] wrong confidence intervals for area estimates [#909](https://github.com/EnMAP-Box/enmap-box/issues/909)
* Regression based unmixing | problem with implementation of LinearSVR [#967](https://github.com/EnMAP-Box/enmap-box/issues/967)
* [Regression-based unmixing] _catboost.CatBoostError: Expected callable object or stream-like object [#980](https://github.com/EnMAP-Box/enmap-box/issues/980)
</details>

## Version 3.14 (2024-04-11)
_This release was tested under QGIS 3.34 (LTR) and 3.36 (latest release)._
### New Features
Expand Down Expand Up @@ -30,7 +68,7 @@ _This release was tested under QGIS 3.34 (LTR) and 3.36 (latest release)._
* [Scripts/EnFireMAP] add script for sampling point data from data cube [#681](https://github.com/EnMAP-Box/enmap-box/issues/681)
* split and restructure the requirement.txt file by operating system and Python environment [#701](https://github.com/EnMAP-Box/enmap-box/issues/701)
### Fixed Bugs
<details><summary>Show all</summary>
<details><summary>Show all (39)</summary>

* [GEE Time Series Explorer] AttributeError: 'GeeTemporalProfileDockWidget' object has no attribute 'onDownloadLayerProfilesClicked' [#691](https://github.com/EnMAP-Box/enmap-box/issues/691)
* splash screen not showing up on EnMAP-Box startup [#714](https://github.com/EnMAP-Box/enmap-box/issues/714)
Expand Down Expand Up @@ -64,10 +102,13 @@ _This release was tested under QGIS 3.34 (LTR) and 3.36 (latest release)._
* AttributeError: 'NoneType' object has no attribute 'highlightedVariables' [#863](https://github.com/EnMAP-Box/enmap-box/issues/863)
* [RasterReader] open a WMS layer with "openWithGdal=False" isn't working [#865](https://github.com/EnMAP-Box/enmap-box/issues/865)
* EnMAP L2A data isn't scaled correctly between 0 and 1 [#879](https://github.com/EnMAP-Box/enmap-box/issues/879)
* [Scale/truncate/convert raster layer] algo is placed in the wrong algo group [#885](https://github.com/EnMAP-Box/enmap-box/issues/885)
* Couldn't load plugin 'enmapboxplugin' due to an error when calling its classFactory() method [#886](https://github.com/EnMAP-Box/enmap-box/issues/886)
* [SpectralView] GeoJSON library with NaN values not correctly plotted [#887](https://github.com/EnMAP-Box/enmap-box/issues/887)
* [Classification layer accuracy and area report] issue with unclassified pixel inside map [#900](https://github.com/EnMAP-Box/enmap-box/issues/900)
* [Data Sources] right-click on nodes inside a model file (*.pkl) gives error [#908](https://github.com/EnMAP-Box/enmap-box/issues/908)
* Spectral library axis flipped [#916](https://github.com/EnMAP-Box/enmap-box/issues/916)
* [SpectralLibraryUtils] SpectralLibraryUtils.writeToSource is creating wrong CRS [#936](https://github.com/EnMAP-Box/enmap-box/issues/936)
</details>

## Version 3.13 (2023-10-06)
Expand Down Expand Up @@ -123,7 +164,7 @@ _This release was tested under QGIS 3.28 (LTR), 3.32 and 3.34 (latest release)._
* [Example Dataset Potsdam] add library and continuous-vector-layer [#576](https://github.com/EnMAP-Box/enmap-box/issues/576)
* [Scripts] implement script for cutting EnMAP L2A scenes according to a given tiling scheme [#583](https://github.com/EnMAP-Box/enmap-box/issues/583)
### Fixed Bugs
<details><summary>Show all</summary>
<details><summary>Show all (62)</summary>

* [Profile Analytics] ignore or handle WMS layers properly [#443](https://github.com/EnMAP-Box/enmap-box/issues/443)
* [Scripts/create_plugin.py] can't build plugin (somehow related to Markdown) [#452](https://github.com/EnMAP-Box/enmap-box/issues/452)
Expand Down Expand Up @@ -227,7 +268,7 @@ _This release was tested under QGIS 3.28 (LTR)._
* Reporting [#258](https://github.com/EnMAP-Box/enmap-box/issues/258)
* make typeguard optional [#345](https://github.com/EnMAP-Box/enmap-box/issues/345)
### Fixed Bugs
<details><summary>Show all</summary>
<details><summary>Show all (69)</summary>

* The setup for testing non-blocking-dependencies is gone. [#176](https://github.com/EnMAP-Box/enmap-box/issues/176)
* CatBootRegressor issue [#189](https://github.com/EnMAP-Box/enmap-box/issues/189)
Expand Down Expand Up @@ -326,7 +367,7 @@ _This release was tested under QGIS 3.26._
* Application path not initialized [#4](https://github.com/EnMAP-Box/enmap-box/issues/4)
* RasterReader wavelength fails with FORCE TSI images [#9](https://github.com/EnMAP-Box/enmap-box/issues/9)
### Fixed Bugs
<details><summary>Show all</summary>
<details><summary>Show all (49)</summary>

* link extraction from glossary.rst is broken [#1](https://github.com/EnMAP-Box/enmap-box/issues/1)
* temporal pixel profile from FORCE TSI raster not correctly displayed in SpectralView [#5](https://github.com/EnMAP-Box/enmap-box/issues/5)
Expand Down
29 changes: 16 additions & 13 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@ People who made large contributions to the EnMAP-Box (in alphabetical order).
### Earth Observation Lab, Humboldt-Universität zu Berlin, Germany

* Andreas Janz <[email protected]>
* Akpona Okujeni <[email protected]>
* Akpona Okujeni
* Benjamin Jakimow <[email protected]>
* Franz Schug <[email protected]>
* Katja Kowalski <[email protected]>
* Philippe Rufin <[email protected]>
* Marcel Schwieder <[email protected]>
* Matthias Held <[email protected]>
* Sam Cooper <[email protected]>
* Stefan Ernst <[email protected]>
* Franz Schug
* Katja Kowalski
* Philippe Rufin
* Marcel Schwieder
* Matthias Held
* Sam Cooper
* Stefan Ernst

### Earth Observation and Geoinformation Science Lab, University of Greifswald, Germany

* Fabian Thiel <[email protected]>
* Fabian Thiel
* Sebastian van der Linden <[email protected]>

### Ludwig-Maximilians-Universität München, Germany

* Matthias Wocher <[email protected]>
* Martin Danner
* Katja Berger <[email protected]>
* Matthias Wocher <[email protected]>
* Martin Danner <[email protected]>
* Stefanie Steinhauser <[email protected]>
* Tobias Hank <[email protected]>

### GFZ German Research Centre For Geosciences, Potsdam, Germany

Expand All @@ -43,6 +46,6 @@ People who made large contributions to the EnMAP-Box (in alphabetical order).
### AWI Alfred Wegener Institute for Polar and Marine Research, Bremerhaven, Germany

* Astrid Bracher <[email protected]>
* Brenner Silva <[email protected]>
* Leonardo Alvarado <leonardo.alvarado@awi.de>
* Brenner Silva
* Leonardo Alvarado <leonardo.alvarado@dlr.de>
* Mariana Altenburg Soppa <[email protected]>
11 changes: 3 additions & 8 deletions enmapbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@
import warnings

from osgeo import gdal

from qgis.PyQt.QtCore import QSettings
from qgis.PyQt.QtGui import QIcon
from qgis.core import Qgis, QgsApplication, QgsProcessingRegistry, QgsProcessingProvider, QgsProcessingAlgorithm
from qgis.core import Qgis, QgsApplication, QgsProcessingAlgorithm, QgsProcessingProvider, QgsProcessingRegistry
from qgis.gui import QgisInterface, QgsMapLayerConfigWidgetFactory

# provide shortcuts
Expand Down Expand Up @@ -96,7 +95,6 @@

ENMAP_BOX_KEY = 'EnMAP-Box'

_ENMAPBOX_PROCESSING_PROVIDER: QgsProcessingProvider = None
_ENMAPBOX_MAPLAYER_CONFIG_WIDGET_FACTORIES: typing.List[QgsMapLayerConfigWidgetFactory] = []

gdal.SetConfigOption('GDAL_VRT_ENABLE_PYTHON', 'YES')
Expand Down Expand Up @@ -262,13 +260,11 @@ def registerEnMAPBoxProcessingProvider():
assert isinstance(registry, QgsProcessingRegistry)
provider = registry.providerById(ID)
if not isinstance(provider, QgsProcessingProvider):
provider = EnMAPBoxProcessingProvider()
provider = EnMAPBoxProcessingProvider.instance()
registry.addProvider(provider)

assert isinstance(provider, EnMAPBoxProcessingProvider)
assert id(registry.providerById(ID)) == id(provider)
global _ENMAPBOX_PROCESSING_PROVIDER
_ENMAPBOX_PROCESSING_PROVIDER = provider

try:
existingAlgNames = [a.name() for a in registry.algorithms() if a.groupId() == provider.id()]
Expand All @@ -293,8 +289,7 @@ def unregisterEnMAPBoxProcessingProvider():
provider = registry.providerById(ID)

if isinstance(provider, EnMAPBoxProcessingProvider):
global _ENMAPBOX_PROCESSING_PROVIDER
_ENMAPBOX_PROCESSING_PROVIDER = None
EnMAPBoxProcessingProvider._ENMAPBOX_PROCESSING_PROVIDER = None
# this deletes the C++ object
registry.removeProvider(ID)

Expand Down
9 changes: 9 additions & 0 deletions enmapbox/algorithmprovider.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ class EnMAPBoxProcessingProvider(QgsProcessingProvider):
It enhances the "standard" processing.core.AlgorithmProvider by functionality to add and remove GeoAlgorithms during runtime.
"""

_ENMAPBOX_PROCESSING_PROVIDER = None

@staticmethod
def instance() -> 'EnMAPBoxProcessingProvider':

if EnMAPBoxProcessingProvider._ENMAPBOX_PROCESSING_PROVIDER is None:
EnMAPBoxProcessingProvider._ENMAPBOX_PROCESSING_PROVIDER = EnMAPBoxProcessingProvider()
return EnMAPBoxProcessingProvider._ENMAPBOX_PROCESSING_PROVIDER

def __init__(self):
super(EnMAPBoxProcessingProvider, self).__init__()
# internal list of GeoAlgorithms. Is used on re-loads and can be manipulated
Expand Down
2 changes: 1 addition & 1 deletion enmapbox/apps/lmuvegetationapps/IVVRM/IVVRM_GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ def read_file(self):
self.gui.tablePreview.setItem(row, col, item_wl) # place wavelength item
self.gui.tablePreview.setItem(row, col + 1, item_weigh) # place weight item

self.gui.tablePreview.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
self.gui.tablePreview.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.flag_srf = True
self.flag_image = False
self.check_flags() # check if the app is ready to be run
Expand Down
Binary file removed enmapbox/apps/lmuvegetationapps/IVVRM/IVVRM_manual.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions enmapbox/apps/lmuvegetationapps/LUT/CreateLUT_GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ def read_file(self):
self.gui.tablePreview.setItem(row, col, item_wl) # place wavelength item
self.gui.tablePreview.setItem(row, col + 1, item_weigh) # place weight item

self.gui.tablePreview.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
self.gui.tablePreview.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.flag_srf = True
self.flag_image = False
self.check_flags() # check if the app is ready to be run
Expand Down Expand Up @@ -1297,7 +1297,7 @@ def image_read(self): # read only necessary info: fwhm and center wavelengths
for i in self.outreach:
self.gui.tablePreview.item(i, 0).setBackground(QColor(200, 0, 0))
self.gui.tablePreview.setHorizontalHeaderLabels(header_items)
self.gui.tablePreview.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
self.gui.tablePreview.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
wavelength_srf = np.delete(wavelength, self.outreach)
fwhm_srf = np.delete(fwhm, self.outreach)
self.x = np.array(list(zip(wavelength_srf, fwhm_srf)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def initial_values(self):
self.out_image = None # File for output results
self.out_mode = 'single' # 'single' all PROSAIL parameters in one file as bands, 'individual' one file per para

self.geo_mode = "file" # Is the geometry (SZA, OZA, rAA) suplied through 'file' or are they 'fix'
self.geo_mode = "fix" # Is the geometry (SZA, OZA, rAA) suplied through 'file' or are they 'fix'
self.geo_file = None # if geo_mode == 'file', which is the path?
self.geo_fixed = [None]*3 # if geo_mode == 'fix', which are the three geometry angles?

Expand All @@ -112,6 +112,7 @@ def initial_values(self):
self.gui.mLayerMask.setLayer(None)

self.algorithm = None
self.gpr_flag = False

# Initial Model is set to EnMAP as default
self.model_meta_file = os.path.join(APP_DIR, 'Resources/Processor/EnMAP.meta')
Expand Down Expand Up @@ -306,13 +307,15 @@ def open_file(self, mode):
self.mask_image = None
return

elif mode == "model": # Select algorithm for inversion my picking its Meta-file (*.meta)
elif mode == "model": # Select algorithm for inversion by picking its Meta-file (*.meta)
result = str(QFileDialog.getOpenFileName(caption='Select Machine Learning Model',
filter="Processor META File (*.meta)")[0])
if not result:
return
self.meta_dict = self._get_processor_meta(file=result)
self.algorithm = self.meta_dict['alg']
if self.algorithm == 'GPR':
self.gpr_flag = True

targets = self.meta_dict.get('target_parameters')
if isinstance(targets, str):
Expand Down Expand Up @@ -628,7 +631,7 @@ def run_inversion(self):
mask_ndvi=self.mask_ndvi, ndvi_thr=self.ndvi_thr,
ndvi_bands=self.ndvi_bands, mask_image=self.mask_image,
geo_in=self.geo_file, fixed_geos=self.geo_fixed,
spatial_geo=self.spatial_geo, paras=self.paras)
spatial_geo=self.spatial_geo, paras=self.paras, gpr_flag=self.gpr_flag)
except ValueError as e:
self.abort(message="Failed to setup inversion: {}".format(str(e)))
return
Expand Down Expand Up @@ -656,11 +659,13 @@ def run_inversion(self):
self.abort(message="An error occurred while trying to write output-image: {}".format(str(e)))
return

if self.gpr_flag is True:
proc.predict_main.write_prediction_std()

self.prg_widget.gui.lblCancel.setText("")
self.prg_widget.gui.allow_cancel = True
self.prg_widget.gui.close()
QMessageBox.information(self.gui, "Finish", "ML mapping finished")
self.gui.close()

def open_train_gui(self):
# Open the GUI for training new models
Expand Down
Loading

0 comments on commit bb5fe04

Please sign in to comment.