code: def decompress(infile, outdir='.'):
      
      cmd = get_xritdecompress_cmd()
      infile = os.path.abspath(infile)
      cwd = os.getcwd()
      os.chdir(outdir)
  
      p = Popen([cmd, infile], stdout=PIPE)
      stdout = BytesIO(p.communicate()[0])
      status = p.returncode
      os.chdir(cwd)
  
      if status != 0:
          raise IOError("xrit_decompress '%s', failed, status=%d" % (infile, status))
  
      outfile = get_xritdecompress_outfile(stdout)
  
      if not outfile:
          raise IOError("xrit_decompress '%s', failed, no output file is generated" % infile)
  
      return os.path.join(outdir, outfile.decode('utf-8'))
docs: Decompress an XRIT data file and return the path to the decompressed file.
  
      It expect to find Eumetsat's xRITDecompress through the environment variable
      XRIT_DECOMPRESS_PATH.