Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EO Time Series Viewer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin Jakimow
EO Time Series Viewer
Commits
1b42a037
Commit
1b42a037
authored
8 years ago
by
benjamin.jakimow@geo.hu-berlin.de
Browse files
Options
Downloads
Patches
Plain Diff
added sensorOfInterest keyword to TimeSeries::getTSDs()
parent
457205e3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
timeseriesviewer/timeseries.py
+8
-7
8 additions, 7 deletions
timeseriesviewer/timeseries.py
with
8 additions
and
7 deletions
timeseriesviewer/timeseries.py
+
8
−
7
View file @
1b42a037
...
@@ -268,6 +268,7 @@ class TimeSeriesDatum(QObject):
...
@@ -268,6 +268,7 @@ class TimeSeriesDatum(QObject):
self
.
pathImg
=
pathImg
self
.
pathImg
=
pathImg
self
.
pathMsk
=
None
self
.
pathMsk
=
None
assert
os
.
path
.
exists
(
pathImg
)
self
.
lyrImg
=
QgsRasterLayer
(
pathImg
,
os
.
path
.
basename
(
pathImg
),
False
)
self
.
lyrImg
=
QgsRasterLayer
(
pathImg
,
os
.
path
.
basename
(
pathImg
),
False
)
assert
self
.
lyrImg
.
isValid
()
assert
self
.
lyrImg
.
isValid
()
self
.
uriImg
=
self
.
lyrImg
.
dataProvider
().
dataSourceUri
()
self
.
uriImg
=
self
.
lyrImg
.
dataProvider
().
dataSourceUri
()
...
@@ -275,7 +276,7 @@ class TimeSeriesDatum(QObject):
...
@@ -275,7 +276,7 @@ class TimeSeriesDatum(QObject):
self
.
crs
=
self
.
lyrImg
.
dataProvider
().
crs
()
self
.
crs
=
self
.
lyrImg
.
dataProvider
().
crs
()
self
.
sensor
=
SensorInstrument
(
self
.
lyrImg
)
self
.
sensor
=
SensorInstrument
(
self
.
lyrImg
)
self
.
date
=
getImageDate
2
(
self
.
lyrImg
)
self
.
date
=
getImageDate
(
self
.
lyrImg
)
assert
self
.
date
is
not
None
,
'
Unable to find acquisition date of {}
'
.
format
(
pathImg
)
assert
self
.
date
is
not
None
,
'
Unable to find acquisition date of {}
'
.
format
(
pathImg
)
self
.
ns
=
self
.
lyrImg
.
width
()
self
.
ns
=
self
.
lyrImg
.
width
()
...
@@ -413,8 +414,6 @@ class TimeSeries(QObject):
...
@@ -413,8 +414,6 @@ class TimeSeries(QObject):
with
open
(
path
,
'
w
'
)
as
f
:
with
open
(
path
,
'
w
'
)
as
f
:
f
.
writelines
(
lines
)
f
.
writelines
(
lines
)
def
getMaxSpatialExtent
(
self
,
crs
=
None
):
def
getMaxSpatialExtent
(
self
,
crs
=
None
):
if
len
(
self
.
data
)
==
0
:
if
len
(
self
.
data
)
==
0
:
return
None
return
None
...
@@ -429,11 +428,13 @@ class TimeSeries(QObject):
...
@@ -429,11 +428,13 @@ class TimeSeries(QObject):
def
getObservationDates
(
self
):
def
getObservationDates
(
self
):
return
[
tsd
.
getDate
()
for
tsd
in
self
.
data
]
return
[
tsd
.
getDate
()
for
tsd
in
self
.
data
]
def
getTSDs
(
self
,
date
_of_i
nterest
=
None
):
def
getTSDs
(
self
,
date
OfInterest
=
None
,
sensorOfI
nterest
=
None
):
if
date
_of_i
nterest
:
if
date
OfI
nterest
:
tsds
=
[
tsd
for
tsd
in
self
.
data
if
tsd
.
getDate
()
==
date
_of_i
nterest
]
tsds
=
[
tsd
for
tsd
in
self
.
data
if
tsd
.
getDate
()
==
date
OfI
nterest
]
else
:
else
:
tsds
=
self
.
data
tsds
=
self
.
data
if
sensorOfInterest
:
tsds
=
[
tsd
for
tsd
in
tsds
if
tsd
.
sensor
==
sensorOfInterest
]
return
tsds
return
tsds
def
clear
(
self
):
def
clear
(
self
):
...
@@ -532,7 +533,7 @@ class TimeSeries(QObject):
...
@@ -532,7 +533,7 @@ class TimeSeries(QObject):
regAcqDate
=
re
.
compile
(
r
'
acquisition[ ]*(time|date|day)
'
,
re
.
I
)
regAcqDate
=
re
.
compile
(
r
'
acquisition[ ]*(time|date|day)
'
,
re
.
I
)
regLandsatSceneID
=
re
.
compile
(
r
"
L[EMCT][1234578]{1}[12]\d{12}[a-zA-Z]{3}\d{2}
"
)
regLandsatSceneID
=
re
.
compile
(
r
"
L[EMCT][1234578]{1}[12]\d{12}[a-zA-Z]{3}\d{2}
"
)
def
getImageDate
2
(
lyr
):
def
getImageDate
(
lyr
):
assert
isinstance
(
lyr
,
QgsRasterLayer
)
assert
isinstance
(
lyr
,
QgsRasterLayer
)
mdLines
=
str
(
lyr
.
metadata
()).
splitlines
()
mdLines
=
str
(
lyr
.
metadata
()).
splitlines
()
date
=
None
date
=
None
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment