diff --git a/modules/aeolus/datasource.py b/modules/aeolus/datasource.py index 7b2a987e381d6935ef05de66a55fa77b807804bf..1b0761297fec2c1901e27dd726bbfad77f865949 100644 --- a/modules/aeolus/datasource.py +++ b/modules/aeolus/datasource.py @@ -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'):