skmap.io.base.RasterData#
- class RasterData(raster_files, raster_mask=None, raster_mask_val=nan, max_rasters=None, verbose=False)[source]#
Bases:
SKMapBaseMethods
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:.dropfilterfilter_containsfilter_datefrom_stac_itemsGenerates a grid plot to view and save with a colorscale with a desired layout.
Makes point queries on dataset and provide plots and data
readrenameruntimespanto_dirto_s3Attributes
BAND_COLDT_COLEND_DT_COLGROUP_COLINTERVAL_DT_SEPNAME_COLPATH_COLPLACEHOLDER_DTSTART_DT_COLTEMPORAL_COLTRANSFORM_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.
- 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 graphlabel_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)