:py:mod:`hazimp.raster` ======================= .. py:module:: hazimp.raster .. autoapi-nested-parse:: Manipulate raster data. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: hazimp.raster.Raster Functions ~~~~~~~~~ .. autoapisummary:: hazimp.raster.files_raster_data_at_points hazimp.raster.recalc_max .. py:class:: Raster(filename, upper_left_x, upper_left_y, x_pixel, y_pixel, no_data_value, x_size, y_size) Bases: :py:obj:`object` A simple class to describe a raster. .. py:method:: from_file(cls, filename) :classmethod: Load a file in a raster file format known to GDAL. Note, image must be 'North up'. :param filename: The raster file path string. :returns: A Raster instance. .. py:method:: raster_data_at_points(self, lon, lat, scaling_factor=None) Get data at lat lon points of the raster. :param lon: A 1D array of the longitude of the points. :param lat: A 1D array of the latitude of the points. :param scaling_factor: An optional scaling factor to apply to the values. :returns: A numpy array, First dimension being the points/sites. .. py:method:: extent(self) Return the extent, in lats and longs of the raster. :returns: min_long, min_lat, max_long, max_lat .. py:function:: files_raster_data_at_points(lon, lat, files, scaling_factor=None) Get data at lat lon points, based on a set of files :param files: A list of files. :param lon: A 1D array of the longitude of the points. :param lat: A 1d array of the latitude of the points. :param scaling_factor: An optional scaling factor to apply to the values. :returns: reshaped_data, max_extent reshaped_data: A numpy array, shape (sites, hazards) or shape (sites), for one hazard. max_extent: [min_long, min_lat, max_long, max_lat] A rectange covering the extents of all of the loaded rasters. .. py:function:: recalc_max(max_extent, extent) Given an extent and a maximum extent modify maximum extent so it covers the extent area. Both parameters describe a rectangle; [min_long, min_lat, max_long, max_lat] :param max_extent: A list describing a rectangular area. :param extent: A tuple/list describing the area that must be covered by max_extent.