eodal.utils.stacking module

Stacking of pandas.DataFrame objects.

Copyright (C) 2022 Lukas Valentin Graf

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

eodal.utils.stacking.stack_dataframes(in_dir: Path, search_pattern: str, start_date: int | None = None, end_date: int | None = None, **kwargs) DataFrame[source]

stacks a list of pandas dataframes into a single big one to allow for calculating multitemporal statistics and more convenient handling of pixels and field polygons

Parameters:
  • in_dir – directory in which to search for CSV files to be read into memory

  • search_pattern – wild-card expression for searching for CSV files with pixel reflectance values (e.g., ‘*10m.csv’)

  • start_date – start date in the format YYYYMMDD to use for filtering CSV files. If None (Default), all files are stacked

  • end_date – end date in the format YYYYMMDD to use for filtering CSV files. If None (Default), all files are stacked

  • **kwargs

    keyword arguments to pass to pandas.read_csv()