def export(self, output_type='<STR_LIT>', filename=None, x_axis='<STR_LIT>', y_axis='<STR_LIT>', mixed=True,<EOL>all_layers=False, all_elements=False, all_isotopes=False, items_to_export=None,<EOL>offset_us=<NUM_LIT:0.>, source_to_detector_m=<NUM_LIT>,<EOL>t_start_us=<NUM_LIT:1>, time_resolution_us=<NUM_LIT>, time_unit='<STR_LIT>'):
if x_axis not in x_type_list:<EOL><INDENT>raise ValueError("<STR_LIT>".format(x_type_list))<EOL><DEDENT>if time_unit not in time_unit_list:<EOL><INDENT>raise ValueError("<STR_LIT>".format(time_unit_list))<EOL><DEDENT>if y_axis not in y_type_list:<EOL><INDENT>raise ValueError("<STR_LIT>".format(y_type_list))<EOL><DEDENT>if output_type not in export_type_list:<EOL><INDENT>raise ValueError("<STR_LIT>".format(export_type_list))<EOL><DEDENT>_stack_signal = self.stack_signal<EOL>_stack = self.stack<EOL>_x_axis = self.total_signal['<STR_LIT>']<EOL>x_axis_label = None<EOL>df = pd.DataFrame()<EOL>"""<STR_LIT>"""<EOL>if x_axis == '<STR_LIT>':<EOL><INDENT>x_axis_label = '<STR_LIT>'<EOL><DEDENT>if x_axis == '<STR_LIT>':<EOL><INDENT>x_axis_label = u"<STR_LIT>"<EOL>_x_axis = _utilities.ev_to_angstroms(array=_x_axis)<EOL><DEDENT>if x_axis == '<STR_LIT:time>':<EOL><INDENT>if time_unit == '<STR_LIT:s>':<EOL><INDENT>x_axis_label = '<STR_LIT>'<EOL>_x_axis = _utilities.ev_to_s(array=_x_axis,<EOL>source_to_detector_m=source_to_detector_m,<EOL>offset_us=offset_us)<EOL><DEDENT>if time_unit == '<STR_LIT>':<EOL><INDENT>x_axis_label = '<STR_LIT>'<EOL>_x_axis = <NUM_LIT> * _utilities.ev_to_s(array=_x_axis,<EOL>source_to_detector_m=source_to_detector_m,<EOL>offset_us=offset_us)<EOL><DEDENT>if time_unit == '<STR_LIT>':<EOL><INDENT>x_axis_label = '<STR_LIT>'<EOL>_x_axis = <NUM_LIT> * _utilities.ev_to_s(array=_x_axis,<EOL>source_to_detector_m=source_to_detector_m,<EOL>offset_us=offset_us)<EOL><DEDENT>print("<STR_LIT>"<EOL>.format(x_axis_label, source_to_detector_m, offset_us))<EOL><DEDENT>if x_axis == '<STR_LIT>':<EOL><INDENT>x_axis_label = '<STR_LIT>'<EOL>_x_axis = _utilities.ev_to_image_number(array=_x_axis,<EOL>source_to_detector_m=source_to_detector_m,<EOL>offset_us=offset_us,<EOL>time_resolution_us=time_resolution_us,<EOL>t_start_us=t_start_us)<EOL>print("<STR_LIT>"<EOL>.format(x_axis_label, source_to_detector_m, offset_us, time_resolution_us))<EOL><DEDENT>if x_axis_label is None:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>df[x_axis_label] = _x_axis<EOL>"""<STR_LIT>"""<EOL>if y_axis[:<NUM_LIT:5>] != '<STR_LIT>':<EOL><INDENT>y_axis_tag = y_axis<EOL>if y_axis_tag == '<STR_LIT>':<EOL><INDENT>mixed = False<EOL>print("<STR_LIT>")<EOL><DEDENT>if mixed:<EOL><INDENT>_y_axis = self.total_signal[y_axis_tag]<EOL>df['<STR_LIT>' + y_axis_tag] = _y_axis<EOL><DEDENT>if items_to_export is None:<EOL><INDENT>if all_layers:<EOL><INDENT>for _compound in _stack.keys():<EOL><INDENT>_y_axis = _stack_signal[_compound][y_axis_tag]<EOL>df[_compound] = _y_axis<EOL><DEDENT><DEDENT>if all_elements:<EOL><INDENT>for _compound in _stack.keys():<EOL><INDENT>for _element in _stack[_compound]['<STR_LIT>']:<EOL><INDENT>_y_axis = _stack_signal[_compound][_element][y_axis_tag]<EOL>df[_compound + '<STR_LIT:/>' + _element] = _y_axis<EOL><DEDENT><DEDENT><DEDENT>if all_isotopes:<EOL><INDENT>for _compound in _stack.keys():<EOL><INDENT>for _element in _stack[_compound]['<STR_LIT>']:<EOL><INDENT>for _isotope in _stack[_compound][_element]['<STR_LIT>']['<STR_LIT:list>']:<EOL><INDENT>_y_axis = _stack_signal[_compound][_element][_isotope][y_axis_tag]<EOL>df[_compound + '<STR_LIT:/>' + _element + '<STR_LIT:/>' + _isotope] = _y_axis<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for _path_to_export in items_to_export:<EOL><INDENT>_path_to_export = list(_path_to_export)<EOL>_live_path = _stack_signal<EOL>_label = "<STR_LIT:/>".join(_path_to_export)<EOL>while _path_to_export:<EOL><INDENT>_item = _path_to_export.pop(<NUM_LIT:0>)<EOL>_live_path = _live_path[_item]<EOL><DEDENT>_y_axis = _live_path[y_axis_tag]<EOL>df[_label] = _y_axis<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>if y_axis == '<STR_LIT>':<EOL><INDENT>y_axis_tag = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>y_axis_tag = '<STR_LIT>'<EOL><DEDENT>_stack_sigma = self.stack_sigma<EOL>if items_to_export is None:<EOL><INDENT>for _compound in _stack.keys():<EOL><INDENT>for _element in _stack[_compound]['<STR_LIT>']:<EOL><INDENT>_y_axis = _stack_sigma[_compound][_element]['<STR_LIT>']  <EOL>df[_compound + '<STR_LIT:/>' + _element + '<STR_LIT>'] = _stack[_compound][_element]['<STR_LIT>']<EOL>df[_compound + '<STR_LIT:/>' + _element] = _y_axis<EOL>if all_isotopes:<EOL><INDENT>for _isotope in _stack[_compound][_element]['<STR_LIT>']['<STR_LIT:list>']:<EOL><INDENT>_y_axis = _stack_sigma[_compound][_element][_isotope][y_axis_tag]<EOL>df[_compound + '<STR_LIT:/>' + _element + '<STR_LIT:/>' + _isotope] = _y_axis<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for _path_to_export in items_to_export:<EOL><INDENT>if y_axis_tag[-<NUM_LIT:3>:] == '<STR_LIT>':<EOL><INDENT>if len(_path_to_export) < <NUM_LIT:3>:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(_path_to_export[<NUM_LIT:0>]))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if len(_path_to_export) < <NUM_LIT:2>:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(_path_to_export[<NUM_LIT:0>]))<EOL><DEDENT><DEDENT>_path_to_export = list(_path_to_export)<EOL>_live_path = _stack_sigma<EOL>_label = "<STR_LIT:/>".join(_path_to_export)<EOL>while _path_to_export:<EOL><INDENT>_item = _path_to_export.pop(<NUM_LIT:0>)<EOL>_live_path = _live_path[_item]<EOL><DEDENT>_y_axis = _live_path[y_axis_tag]<EOL>df[_label] = _y_axis<EOL><DEDENT><DEDENT><DEDENT>if len(df.columns) <= <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if output_type == '<STR_LIT>':<EOL><INDENT>if filename is None:<EOL><INDENT>filename = '<STR_LIT>'<EOL><DEDENT>if '<STR_LIT>' not in filename:<EOL><INDENT>filename += '<STR_LIT>'<EOL><DEDENT>df.to_csv(filename, index=False)<EOL>print("<STR_LIT>".format(filename))<EOL><DEDENT>elif output_type == '<STR_LIT>':<EOL><INDENT>df.to_clipboard(excel=True, index=False)<EOL>print('<STR_LIT>')<EOL><DEDENT>else:  <EOL><INDENT>return df<EOL><DEDENT>
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'