find_granules

abstract Dataset.find_granules(start=datetime.datetime(1, 1, 1, 0, 0), end=datetime.datetime(9999, 12, 31, 23, 59, 59, 999999), include_last_before=False)[source]

Loop through all granules for indicated period.

This is a generator that will loop through all granules from start to end, inclusive.

See also: find_granules_sorted

Parameters:
  • start (datetime.datetime) – Start Starting datetime. When omitted, start at complete beginning of dataset.

  • end (datetime.datetime) – End End datetime. When omitted, continue to end of dataset. Last granule will start before this datetime, but contents may continue beyond it.

  • include_last_before (bool) – Be inclusive When True, also return the last granule /before/ start, so that a reader is sure to include all data in the covered period. When False, the first granule yielded is the first granule starting after start.

Yields:

pathlib.Path objects for all files in dataset. Sorting is not guaranteed; if you need guaranteed sorting, use find_granules_sorted.