timeseries#

geobricks.timeseries(data, *, coords='all', coords_crs=None, data_crs=None, mode='mean', start_date=None, end_date=None, var_list=None, cumul=False)[source]#

This function extracts the temporal data in one location given by coordinate.

Parameters#

datapath (str, pathlib.Path) or variable (xarray.Dataset or xarray.DataArray)

timeseries is only intended to handle raster data (ASCII and GeoTIFF) and netCDF. data will be loaded as a xarray.Dataset.

coords‘all’, str or path, geopandas.GeoDataFrame, shapely.geometry or tuple of (float, float), default ‘all’

The keyword, coordinates or mask that will be used to extract the timeseries. If ‘all’, all the pixels in data are considered. Mask can be raster or vector data. If a tuple of coordinates is passed, coordinates should be ordered as (x, y) or (lon, lat).

coords_crsany CRS accepted by pyproj.CRS.from_user_input, optional

CRS of coords, in case it is not already embedded in it.

Accepted CRS can be for example:

  • EPSG integer codes (such as 4326)

  • authority strings (such as “epsg:4326”)

  • CRS WKT strings

  • pyproj.CRS

data_crsany CRS accepted by pyproj.CRS.from_user_input, optional

CRS of data, in case it is not already embedded in it.

Accepted CRS can be for example:

  • EPSG integer codes (such as 4326)

  • authority strings (such as “epsg:4326”)

  • CRS WKT strings

  • pyproj.CRS

mode{‘mean’, ‘sum’, ‘max’, ‘min’}, default ‘mean’

How selected data will be aggregated.

start_datestr or datetime, optional

Start of the selected time period to extract.

end_datestr or datetime, optional

End of the selected time period to extract.

var_list(list of) str, optional

Fields (variables) to extract.

cumulbool, default False

If True, values will be retrieved as cumulated sums.

Returns#

pandas.DataFrame

Frame containing the timeseries.