Skip to content
Snippets Groups Projects
Commit a8aa480c authored by tomrink's avatar tomrink
Browse files

make Files iterable

parent 556beaf8
No related branches found
No related tags found
No related merge requests found
......@@ -102,6 +102,8 @@ class Files:
self.ftimes = self.ftimes[sidxs, :]
self.flist = self.flist[sidxs]
self._current_index = 0
def get_datetime(self, pathname):
pass
......@@ -131,6 +133,17 @@ class Files:
def get_parameters(self):
pass
def __iter__(self):
return self
def __next__(self):
if self._current_index < len(self.flist):
self._current_index += 1
return self.flist[self._current_index]
else:
self._current_index = 0
raise StopIteration
class GOESL1B(Files):
def __init__(self, files_path, band='14', pattern='OR_ABI-L1b-RadC-M*C14'+'*.nc'):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment