cartopy.io.PostprocessedRasterSource#

class cartopy.io.PostprocessedRasterSource(contained_source, img_post_process)[source]#

A RasterSource which wraps another, an then applies a post-processing step on the raster fetched from the contained source.

Parameters:
  • contained_source (RasterSource instance.) – The source of the raster that this container is wrapping.

  • img_post_process (callable) – Called after each fetch_raster call which yields a non-None image result. The callable must accept the LocatedImage from the contained fetch_raster as its only argument, and must return a single LocatedImage.

fetch_raster(*args, **kwargs)[source]#

Return a sequence of images with extents given some constraining information.

Parameters:
  • projection (cartopy.crs.Projection) – The desired projection of the image.

  • extent (iterable of length 4) – The extent of the requested image in projected coordinates. The resulting image may not be defined exactly by these extents, and so the extent of the resulting image is also returned. The extents must be defined in the form (min_x, max_x, min_y, max_y).

  • target_resolution (iterable of length 2) – The desired resolution of the image as (width, height) in pixels.

Returns:

images – A sequence of LocatedImage instances.

validate_projection(projection)#

Raise an error if this raster source cannot provide images in the specified projection.

Parameters:

projection (cartopy.crs.Projection) – The desired projection of the image.