<jupyter_start><jupyter_text>[![Notebook Tutorial](__code/__all/notebook_tutorial.png)](https://neutronimaging.pages.ornl.gov/tutorial/notebooks/bragg_edge_peak_fitting/activate-search)  Select Your IPTS<jupyter_code>from __code import system
from __code.bragg_edge.bragg_edge_peak_fitting import BraggEdge, Interface

system.System.select_working_dir(facility='SNS', instrument='VENUS')
from __code.__all import custom_style
custom_style.style()

# from plotly.offline import plot, init_notebook_mode, iplot
# init_notebook_mode()<jupyter_output><empty_output><jupyter_text>Prepare UI engine<jupyter_code>%gui qt<jupyter_output><empty_output><jupyter_text>Select Normalized Data Input FolderData and time spectra files will be loaded<jupyter_code>o_bragg = BraggEdge(working_dir=system.System.get_working_dir())
o_bragg.select_working_folder()<jupyter_output><empty_output><jupyter_text>Select Open Beam Data Input folder<jupyter_code>o_bragg.select_ob_folder()<jupyter_output><empty_output><jupyter_text>Select sample region and peak to fit  Select how many random files to use to select region to fit<jupyter_code>o_bragg.how_many_data_to_use_to_select_sample_roi()<jupyter_output><empty_output><jupyter_text>fit ui<jupyter_code>o_interface = Interface(o_bragg=o_bragg, spectra_file=o_bragg.spectra_file)
o_interface.show()<jupyter_output><empty_output><jupyter_text>DEBUGGING<jupyter_code>from __code import system
from __code.bragg_edge.bragg_edge_peak_fitting import BraggEdge, Interface
%gui qt
data_path = "/Users/j35/IPTS/VENUS/IPTS-25778_normalized"
import glob
import os
list_data = glob.glob(data_path + "*.tif")
spectra_file = os.path.join(data_path, "Image019_Spectra.txt")
assert os.path.exists(spectra_file)
o_bragg = BraggEdge(working_dir=data_path)
o_bragg.load_data(data_path)
o_interface = Interface(o_bragg=o_bragg,
                        working_dir=data_path,
                        spectra_file=spectra_file)
o_interface.show()<jupyter_output><empty_output><jupyter_text>DEBUGGING using import straight<jupyter_code>from __code import system
from __code.bragg_edge.bragg_edge_peak_fitting import BraggEdge, Interface
%gui qt
data_path = "/Users/j35/IPTS/SNAP/Si_normalized"
o_interface = Interface(working_dir=data_path)
o_interface.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09324618736383443, 'fraction_numerical': 0.00522875816993464, 'mean_word_length': 8.728813559322035, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '21595', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 858, 'n_tokens_neox': 829, 'n_words': 120, 'path': 'notebooks/bragg_edge_peak_fitting.ipynb', 'repo_name': 'mabrahamdevops/python_notebooks', 'size': '2295'}