docs: def export(self, output_type='df', filename=None, x_axis='energy', y_axis='attenuation', mixed=True,
                 all_layers=False, all_elements=False, all_isotopes=False, items_to_export=None,
                 offset_us=0., source_to_detector_m=16.,
                 t_start_us=1, time_resolution_us=0.16, time_unit='us'):
          """
          output x and y values to clipboard or .csv file
          output the transmission or attenuation or sigma of compound, element and/or isotopes specified
          'sigma_b' exported for each isotope is the product resulted from (sigma * isotopic ratio)
          'atoms_per_cm3' of each element is also exported in 'sigma' mode based on molar mass within stack.
  
          :param output_type: export type : ['df', 'csv', 'clip']
          :type output_type: str
          :param mixed: True -> display the total of each layer
                                 False -> not displayed
          :type mixed: boolean
          :param filename: string. filename (with .csv suffix) you would like to save as
                                  None -> export to clipboard
          :type filename: string
          :param x_axis: string. x type for export. Must in ['energy', 'lambda', 'time', 'number']
          :param y_axis: string. y type for export. Must in ['transmission', 'attenuation', 'sigma', 'sigma_raw', 'miu_per_cm']
          :param all_layers: boolean. True -> export all layers
                                      False -> not export
          :param all_elements: boolean. True -> export all elements signal
                                        False -> not export
          :param all_isotopes: boolean. True -> export all isotopes signal
                                        False -> not export
          :param items_to_export: array that describes what to export
              ex:
                  [['CoAg','Ag','107-Ag'], ['CoAg']]
              if the dictionary is empty, everything is exported
          :param time_unit: string. Must be either 's' or 'us' or 'ns'
                 Note: this will be used only when x_axis='time'
          :param offset_us: default: 0
                 Note: only used when x_axis='number' or 'time'
          :param source_to_detector_m: Note: this will be used only when x_axis='number' or 'time'
          :param time_resolution_us: Note: this will be used only when x_axis='number'
          :param t_start_us: when is the first acquisition occurred. default: 1
                 Note: this will be used only when x_axis='number'
  
          :return: simulated resonance signals or sigma in the form of 'clipboard' or '.csv file' or 'pd.DataFrame'
          """
          if x_axis not in x_type_list:
              raise ValueError("Please specify the x-axis type using one from '{}'.".format(x_type_list))
          if time_unit not in time_unit_list:
              raise ValueError("Please specify the time unit using one from '{}'.".format(time_unit_list))
          if y_axis not in y_type_list:
              raise ValueError("Please specify the y-axis type using one from '{}'.".format(y_type_list))
          if output_type not in export_type_list:
              raise ValueError("Please specify export type using one from '{}'.".format(export_type_list))
          # stack from self
          _stack_signal = self.stack_signal
          _stack = self.stack
  
          _x_axis = self.total_signal['energy_eV']
          x_axis_label = None
          df = pd.DataFrame()
  
          """X-axis"""
          # determine values and labels for x-axis with options from
          # 'energy(eV)' & 'lambda(A)' & 'time(us)' & 'image number(#)'
          if x_axis == 'energy':
              x_axis_label = 'Energy (eV)'
          if x_axis == 'lambda':
              x_axis_label = u"Wavelength (\u212B)"
              _x_axis = _utilities.ev_to_angstroms(array=_x_axis)
          if x_axis == 'time':
              if time_unit == 's':
                  x_axis_label = 'Time (s)'
                  _x_axis = _utilities.ev_to_s(array=_x_axis,
                                               source_to_detector_m=source_to_detector_m,
                                               offset_us=offset_us)
              if time_unit == 'us':
                  x_axis_label = 'Time (us)'
                  _x_axis = 1e6 * _utilities.ev_to_s(array=_x_axis,
                                                     source_to_detector_m=source_to_detector_m,
                                                     offset_us=offset_us)
              if time_unit == 'ns':
                  x_axis_label = 'Time (ns)'
                  _x_axis = 1e9 * _utilities.ev_to_s(array=_x_axis,
                                                     source_to_detector_m=source_to_detector_m,
                                                     offset_us=offset_us)
              print("'{}' was obtained with the following:\nsource_to_detector_m={}\noffset_us={}"
                    .format(x_axis_label, source_to_detector_m, offset_us))
  
          if x_axis == 'number':
              x_axis_label = 'Image number (#)'
              _x_axis = _utilities.ev_to_image_number(array=_x_axis,
                                                      source_to_detector_m=source_to_detector_m,
                                                      offset_us=offset_us,
                                                      time_resolution_us=time_resolution_us,
                                                      t_start_us=t_start_us)
              print("'{}' was obtained with the following:\nsource_to_detector_m={}\noffset_us={}\ntime_resolution_us={}"
                    .format(x_axis_label, source_to_detector_m, offset_us, time_resolution_us))
  
          if x_axis_label is None:
              raise ValueError("x_axis_label does NOT exist, please check.")
          df[x_axis_label] = _x_axis
  
          """Y-axis"""
          if y_axis[:5] != 'sigma':
              # export transmission or attenuation or miu_per_cm
              y_axis_tag = y_axis
              if y_axis_tag == 'miu_per_cm':
                  mixed = False
                  print("'y_axis='miu_per_cm'' is selected. Auto force 'mixed=False'")
              if mixed:
                  _y_axis = self.total_signal[y_axis_tag]
                  df['Total_' + y_axis_tag] = _y_axis
              if items_to_export is None:
                  # export based on specified level : layer|element|isotope
                  if all_layers:
                      for _compound in _stack.keys():
                          _y_axis = _stack_signal[_compound][y_axis_tag]
                          df[_compound] = _y_axis
  
                  if all_elements:
                      for _compound in _stack.keys():
                          for _element in _stack[_compound]['elements']:
                              _y_axis = _stack_signal[_compound][_element][y_axis_tag]
                              df[_compound + '/' + _element] = _y_axis
  
                  if all_isotopes:
                      for _compound in _stack.keys():
                          for _element in _stack[_compound]['elements']:
                              for _isotope in _stack[_compound][_element]['isotopes']['list']:
                                  _y_axis = _stack_signal[_compound][_element][_isotope][y_axis_tag]
                                  df[_compound + '/' + _element + '/' + _isotope] = _y_axis
              else:
                  # export specified transmission or attenuation
                  for _path_to_export in items_to_export:
                      _path_to_export = list(_path_to_export)
                      _live_path = _stack_signal
                      _label = "/".join(_path_to_export)
                      while _path_to_export:
                          _item = _path_to_export.pop(0)
                          _live_path = _live_path[_item]
                      _y_axis = _live_path[y_axis_tag]
                      df[_label] = _y_axis
          else:
              # export sigma
              if y_axis == 'sigma':
                  y_axis_tag = 'sigma_b'
              else:
                  y_axis_tag = 'sigma_b_raw'
              # y_axis_tag = 'sigma_b_raw'
              _stack_sigma = self.stack_sigma
              if items_to_export is None:
                  for _compound in _stack.keys():
                      for _element in _stack[_compound]['elements']:
                          _y_axis = _stack_sigma[_compound][_element]['sigma_b']  # No 'sigma_b_raw' at this level
                          df[_compound + '/' + _element + '/atoms_per_cm3'] = _stack[_compound][_element]['atoms_per_cm3']
                          df[_compound + '/' + _element] = _y_axis
                          if all_isotopes:
                              for _isotope in _stack[_compound][_element]['isotopes']['list']:
                                  _y_axis = _stack_sigma[_compound][_element][_isotope][y_axis_tag]
                                  df[_compound + '/' + _element + '/' + _isotope] = _y_axis
              else:
                  # export specified sigma
                  for _path_to_export in items_to_export:
                      if y_axis_tag[-3:] == 'raw':
                          if len(_path_to_export) < 3:
                              raise ValueError(
                                  "Getting raw sigma of '{}' at layer or element level is not supported. "
                                  "If it is a single element layer, please follow "
                                  "['layer', 'element', 'isotope'] format.".format(_path_to_export[0]))
                      else:
                          if len(_path_to_export) < 2:
                              raise ValueError(
                                  "Getting weighted sigma of '{}' at layer level is not supported. "
                                  "If it is a single element layer, please follow "
                                  "['layer', 'element'] format.".format(_path_to_export[0]))
                      _path_to_export = list(_path_to_export)
                      _live_path = _stack_sigma
                      _label = "/".join(_path_to_export)
                      while _path_to_export:
                          _item = _path_to_export.pop(0)
                          _live_path = _live_path[_item]
                      _y_axis = _live_path[y_axis_tag]
                      df[_label] = _y_axis
  
          if len(df.columns) <= 1:
              raise ValueError("No y values have been selected to export!")
          if output_type == 'csv':
              if filename is None:
                  filename = 'data.csv'
              if '.csv' not in filename:
                  filename += '.csv'
              df.to_csv(filename, index=False)
              print("Exporting to file ('./{}') completed.".format(filename))
          elif output_type == 'clip':
              df.to_clipboard(excel=True, index=False)
              print('Exporting to clipboard completed.')
          else:  # output_type == 'df'
              return df