def _get_slices(self, area): """Get the slices of raw data covering area. Args: area: the area to slice. Returns: slice_kwargs: kwargs to pass on to loading giving the span of the data to load. area: the trimmed area corresponding to the slices. """ slice_kwargs = {} if area is not None and self.filter_parameters.get('area') is not None: try: slices = get_area_slices(area, self.filter_parameters['area']) area = get_sub_area(area, *slices) slice_kwargs['xslice'], slice_kwargs['yslice'] = slices except (NotImplementedError, AttributeError): logger.info("Cannot compute specific slice of data to load.") return slice_kwargs, area