docs: def importevla(asdm, ms):
      """Convert an EVLA low-level SDM dataset to Measurement Set format.
  
      asdm (str)
        The path to the input ASDM dataset.
      ms (str)
        The path to the output MS dataset.
  
      This implementation automatically infers the value of the "tbuff"
      parameter.
  
      Example::
  
        from pwkit.environments.casa import tasks
        tasks.importevla('myvla.sdm', 'myvla.ms')
  
      """
      from .scripting import CasapyScript
  
      # Here's the best way I can figure to find the recommended value of tbuff
      #(= 1.5 * integration time). Obviously you might have different
      # integration times in the dataset and such, and we're just going to
      # ignore that possibility.
  
      bdfstem = os.listdir(os.path.join(asdm, 'ASDMBinary'))[0]
      bdf = os.path.join(asdm, 'ASDMBinary', bdfstem)
      tbuff = None
  
      with open(bdf, 'rb') as f:
          for linenum, line in enumerate(f):
              if linenum > 60:
                  raise PKError('cannot find integration time info in %s', bdf)
  
              if not line.startswith(b'<sdmDataSubsetHeader'):
                  continue
  
              try:
                  i1 = line.index(b'<interval>') + len(b'<interval>')
                  i2 = line.index(b'</interval>')
                  if i2 <= i1:
                      raise ValueError()
              except ValueError:
                  raise PKError('cannot parse integration time info in %s', bdf)
  
              tbuff = float(line[i1:i2]) * 1.5e-9 # nanosecs, and want 1.5x
              break
  
      if tbuff is None:
          raise PKError('found no integration time info')
  
      print('importevla: %s -> %s with tbuff=%.2f' % (asdm, ms, tbuff))
  
      script = os.path.join(os.path.dirname(__file__), 'cscript_importevla.py')
      with CasapyScript(script, asdm=asdm, ms=ms, tbuff=tbuff) as cs:
          pass