Skip to content

Commit 3ad0f93

Browse files
AlenaDostalovabgoesswe
authored andcommitted
added count_time method for the RestImagery class.
1 parent c95807e commit 3ad0f93

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

openeo/imagecollection.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ def median_time(self) -> 'ImageCollection':
117117
"""
118118
pass
119119

120+
def count_time(self) -> 'ImageCollection':
121+
"""
122+
Counts the number of images with a valid mask in a time series for all bands of the input dataset.
123+
124+
:return: An ImageCollection without a time dimension.
125+
"""
126+
pass
127+
120128
def ndvi(self, red, nir) -> 'ImageCollection':
121129
""" NDVI
122130

openeo/rest/imagery.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,19 @@ def median_time(self) -> 'ImageCollection':
198198

199199
return self.graph_add_process(process_id, args)
200200

201+
def count_time(self) -> 'ImageCollection':
202+
"""Counts the number of images with a valid mask in a time series for all bands of the input dataset.
203+
:return An ImageCollection instance
204+
"""
205+
206+
process_id = 'count_time'
207+
208+
args = {
209+
'imagery': self.graph
210+
}
211+
212+
return self.graph_add_process(process_id, args)
213+
201214
def ndvi(self, red, nir) -> 'ImageCollection':
202215
""" NDVI
203216
:param red: Reference to the red band

0 commit comments

Comments
 (0)