skmap.io.base.RasterData#

class RasterData(raster_files, raster_mask=None, raster_mask_val=nan, max_rasters=None, verbose=False)[source]#

Bases: SKMapBase

Methods

animate

Generates an animation with the given band(s) and saves it. :type cmap: str :param cmap: colormap name that will derived from matplotlib.colormaps() :type groups: list :param groups: this is used for to select the band(s) or to generate a composite images, that will be used as animation frame. Default is None but it will select the first band on RasterData. :type scaling: float :param scaling: scaling can be used to increase/decrease the frame size. Default is 2. :type cbar_title: str :param cbar_title:.

drop

filter

filter_contains

filter_date

from_stac_items

plot

Generates a grid plot to view and save with a colorscale with a desired layout.

point_query

Makes point queries on dataset and provide plots and data

read

rename

run

timespan

to_dir

to_s3

Attributes

BAND_COL

DT_COL

END_DT_COL

GROUP_COL

INTERVAL_DT_SEP

NAME_COL

PATH_COL

PLACEHOLDER_DT

START_DT_COL

TEMPORAL_COL

TRANSFORM_SEP

animate(cmap='Spectral_r', groups=None, scaling=2, cbar_title=None, img_title_text='index', img_title_fontsize=10, vminmax=(None, None), interval=250, to_gif=None, n_jobs=4)[source]#

Generates an animation with the given band(s) and saves it. :type cmap: str :param cmap: colormap name that will derived from matplotlib.colormaps() :type groups: list :param groups: this is used for to select the band(s) or to generate a composite images,

that will be used as animation frame. Default is None but it will select the first band on RasterData.

Parameters:
  • scaling (float) – scaling can be used to increase/decrease the frame size. Default is 2.

  • cbar_title (str)

plot(groups=None, cmap='Spectral_r', cbar_title=None, img_title_text='index', img_title_fontsize=10, vminmax=(None, None), to_img=None, dpi=100, layout_col=4)[source]#

Generates a grid plot to view and save with a colorscale with a desired layout. :param cmap : This sets the colorscale with given matplotlib.colormap. Default is Spectral_r :param cbar_title : This sets the colorbar title if the cbar exists in the plot. Default is None. :param img_title_text : This sets the image titles that will be display on top of the each image. Default is index. :param img_ltitle_fontsize : This sets the fontsize of the image label which will be on top of the image. Default is 10. :param v_minmax : This sets the loower and upper limits of the data that will be plot and the colorbar. Default is None and will be calculated on he fly. :param groups : This used for to generate composite plot. Pass one or tree group names (groups) which will be used to generate. Default is None. :param to_img : This sets the directory adn the format of the file where the generated image will be saved. Default is None. :param dpi : dot per inch value to save the figure. If the to_img param provided :param layout_col : This controls the column count that will be used in the grid plot. Default is 3.

point_query(x, y, cols=3, titles=None, label_xaxis='index', return_data=False)[source]#

Makes point queries on dataset and provide plots and data

Parameters:
  • x (list) – longitude value(s) of the given point(s)

  • y (list) – latitude value(s) of the given point(s)

  • cols (int) – column count of the desired layout. Default is 3.

  • titles (list) – list of the titles that will be placed on top of the each graph

  • label_xaxis (str) – labels of the x axes. it could be index, name,`date` or None.

  • return_data (bool) – If the user wants to access the data sampled from rasters, this needs to be set to True. Default is False

Examples

>>> import geopandas as gpd
>>> from skmap.data import toy
>>> rasterdata = toy.ndvi_rdata(gappy=False)
>>> points = gpd.read_file('./skmap/data/toy/samples/samples.gpkg')
>>> rasterdata.point_query(x=points.geometry.x.to_list(), y=points.geometry.y.to_list() , label_xaxis='index', cols=3, titles=points.label)