class_docstr: Reader for GAC and LAC data.
class_docstr_tok: ["Reader","for","GAC","and","LAC","data","."]
docstr: Select user-defined scanlines and/or strip invalid coordinates.
  
  Returns:
      Sliced data
docstr_tok: ["Select","user-defined","scanlines","and\/or","strip","invalid","coordinates",".","Returns",":","Sliced","data"]
code: def _slice(self, data):
      """Select user-defined scanlines and/or strip invalid coordinates.
  
      Returns:
          Sliced data
  
      """
      start_line = self.start_line if self.start_line is not None else 0
      end_line = self.end_line if self.end_line is not None else 0
  
      # Strip scanlines with invalid coordinates
      if self.strip_invalid_coords:
          first_valid_lat, last_valid_lat = self._strip_invalid_lat()
      else:
          first_valid_lat = last_valid_lat = None
  
      # Check and correct user-defined scanlines, if possible
      start_line, end_line = pygac.utils.check_user_scanlines(
          start_line=start_line,
          end_line=end_line,
          first_valid_lat=first_valid_lat,
          last_valid_lat=last_valid_lat,
          along_track=data.shape[0],
      )
  
      # Slice data
      sliced = pygac.utils.slice_channel(
          data,
          start_line=start_line,
          end_line=end_line,
          first_valid_lat=first_valid_lat,
          last_valid_lat=last_valid_lat,
      )
      if isinstance(sliced, tuple):
          # pygac < 1.4.0
          sliced = sliced[0]
  
      return sliced
  
imports: import logging
  from datetime import datetime, timedelta
  import dask.array
  import numpy
  import pygac.utils
  import xarray
  from pygac.gac_klm import GACKLMReader
  from pygac.gac_pod import GACPODReader
  from pygac.lac_klm import LACKLMReader
  from pygac.lac_pod import LACPODReader
  from satpy.readers.file_handlers import BaseFileHandler
  from satpy.utils import get_legacy_chunk_size
label_desc: Use image node_id 5 for calling the GACLACFile obj's underlying member method code with example usage: obj._slice(data) and returns: sliced