docs: def tdms2rtdc():
      """Convert .tdms datasets to the hdf5-based .rtdc file format"""
      parser = tdms2rtdc_parser()
      args = parser.parse_args()
  
      path_tdms = pathlib.Path(args.tdms_path).resolve()
      path_rtdc = pathlib.Path(args.rtdc_path)
  
      # Determine whether input path is a tdms file or a directory
      if path_tdms.is_dir():
          files_tdms = fmt_tdms.get_tdms_files(path_tdms)
          if path_rtdc.is_file():
              raise ValueError("rtdc_path is a file: {}".format(path_rtdc))
          files_rtdc = []
          for ff in files_tdms:
              ff = pathlib.Path(ff)
              rp = ff.relative_to(path_tdms)
              # determine output file name (same relative path)
              rpr = path_rtdc / rp.with_suffix(".rtdc")
              files_rtdc.append(rpr)
      else:
          files_tdms = [path_tdms]
          files_rtdc = [path_rtdc]
  
      for ii in range(len(files_tdms)):
          ff = pathlib.Path(files_tdms[ii])
          fr = pathlib.Path(files_rtdc[ii])
  
          print_info("Converting {:d}/{:d}: {}".format(
              ii + 1, len(files_tdms), ff))
          # load dataset
          ds = load.load_file(ff)
          # create directory
          if not fr.parent.exists():
              fr.parent.mkdir(parents=True)
          # determine features to export
          features = []
          if args.compute_features:
              tocomp = dfn.feature_names
          else:
              tocomp = ds._events
          for feat in tocomp:
              if feat not in dfn.scalar_feature_names:
                  if not ds[feat]:
                      # ignore non-existent contour, image, mask, or trace
                      continue
              elif feat not in ds:
                  # ignore non-existent feature
                  continue
              features.append(feat)
          # export as hdf5
          ds.export.hdf5(path=fr,
                         features=features,
                         filtered=False,
                         override=True)