code: def get_sub_area(area, xslice, yslice):
      
      new_area_extent = ((area.pixel_upper_left[0] +
                          (xslice.start - 0.5) * area.pixel_size_x),
                         (area.pixel_upper_left[1] -
                          (yslice.stop - 0.5) * area.pixel_size_y),
                         (area.pixel_upper_left[0] +
                          (xslice.stop - 0.5) * area.pixel_size_x),
                         (area.pixel_upper_left[1] -
                          (yslice.start - 0.5) * area.pixel_size_y))
  
      return AreaDefinition(area.area_id, area.name,
                            area.proj_id, area.proj_dict,
                            xslice.stop - xslice.start,
                            yslice.stop - yslice.start,
                            new_area_extent)
docs: Apply slices to the area_extent and size of the area.