Commit 03e00ce2 authored by Benjamin Jakimow's avatar Benjamin Jakimow
Browse files

qps update,


date field in spectral library now of type "QDate"
Signed-off-by: Benjamin Jakimow's avatarBenjamin Jakimow benjamin.jakimow@geo.hu-berlin.de <benjamin.jakimow@geo.hu-berlin.de>
parent fe3ab236
Pipeline #13959 failed with stage
in 6 seconds
...@@ -694,7 +694,11 @@ class SpectralProfile(QgsFeature): ...@@ -694,7 +694,11 @@ class SpectralProfile(QgsFeature):
assert isinstance(feature, QgsFeature) assert isinstance(feature, QgsFeature)
if isinstance(value_field, QgsField): if isinstance(value_field, QgsField):
value_field = value_field.name() value_field = value_field.name()
assert value_field in feature.fields().names(), f'field "{value_field}" does not exist'
if not value_field in feature.fields().names():
print(f'field "{value_field}" does not exist. Allows values: {",".join(feature.fields().names())}')
return None
sp = SpectralProfile(fields=feature.fields(), value_field=value_field) sp = SpectralProfile(fields=feature.fields(), value_field=value_field)
sp.setId(feature.id()) sp.setId(feature.id())
sp.setAttributes(feature.attributes()) sp.setAttributes(feature.attributes())
......
...@@ -1394,8 +1394,7 @@ class SpectralLibraryPlotWidget(pg.PlotWidget): ...@@ -1394,8 +1394,7 @@ class SpectralLibraryPlotWidget(pg.PlotWidget):
else: else:
# create a new PDI # create a new PDI
profile = self.speclib().profile(fid, value_field=field_name) profile = self.speclib().profile(fid, value_field=field_name)
assert isinstance(profile, SpectralProfile) if not isinstance(profile, SpectralProfile) or profile.isEmpty():
if profile.isEmpty():
self.mNumberOfEmptyProfiles += 1 self.mNumberOfEmptyProfiles += 1
continue continue
......
...@@ -63,7 +63,7 @@ from eotimeseriesviewer import debugLog ...@@ -63,7 +63,7 @@ from eotimeseriesviewer import debugLog
DEBUG = False DEBUG = False
SPECTRA_PROFILE_FIELDS = SpectralProfile().fields() SPECTRA_PROFILE_FIELDS = SpectralProfile().fields()
SPECTRA_PROFILE_FIELDS.append(QgsField('date', QVariant.String, 'varchar')) SPECTRA_PROFILE_FIELDS.append(QgsField('date', QVariant.Date, 'date'))
SPECTRA_PROFILE_FIELDS.append(QgsField('doy', QVariant.Int, 'int')) SPECTRA_PROFILE_FIELDS.append(QgsField('doy', QVariant.Int, 'int'))
SPECTRA_PROFILE_FIELDS.append(QgsField('sensor', QVariant.String, 'varchar')) SPECTRA_PROFILE_FIELDS.append(QgsField('sensor', QVariant.String, 'varchar'))
...@@ -111,7 +111,6 @@ class AboutDialogUI(QDialog): ...@@ -111,7 +111,6 @@ class AboutDialogUI(QDialog):
self.setWindowTitle(title) self.setWindowTitle(title)
class EOTimeSeriesViewerUI(QMainWindow): class EOTimeSeriesViewerUI(QMainWindow):
sigAboutToBeClosed = pyqtSignal() sigAboutToBeClosed = pyqtSignal()
......
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